2. I. Smart Guardian의 통신 BT Spec
1. Bluetooth 4.0
2. Ganeral Attribute Profile (GATT)
3. Proximity Profile (PXP)
II. iOS 구성 설명
1. 사용 API 설명
2. Sequence diagram
III. Android 구성 설명
1. 사용 API 설명
2. Sequence diagram
목차
4. 1. Bluetooth 4.0
1) 소개
소비전역을 줄인 저에너지 기술에 고
속 무선통신을 지원. 평균 전력과 대
기전력을 줄여 동전 크기 배터리로 수
년동안 작동할 수 있도록 했으며, 전
송 속도를 24Mbps로 확장하여 실시
간 대용량 데이터 전송을 쉽고 빠르게
할 수 있다.
2) 종류
싱글 모드와 듀얼 모드로 분리된다.
싱글 모드는 통합성이 고도로 높고 크
기가 매우 작은 디바이스들을 가능하
게 만들었다.(예. Smart Guardian,
Smart Nudge)
듀얼 모드는 저에너지 블루투스 기능
이 기존 블루투스 기능에 통합한다.
5. 2. Generic Attribute Profile (GATT)
.
.
.
Alert Notification Profile(ANP)
Health Thermometer
Profile(HTP)
Heart Rate Profile(HRP)
Proximity Profile(PXP)
Link Loss Service
Immediate Alert Service
Tx Power Service
GATT Profile
PXP Profile
1) 소개
Genaral Attribute Profile (GATT)는 Attribute Protocol을 사용하여 서비스 프레임워크, 서비스 포맷 및 절차를 정의한다. 이 절차는
검색, 읽기, 쓰기, 알림, 지시 특성의 설정을 정의한다.
2) 캡슐화
Smart Guardian에서 사용하는 Proximity Profile (PXP)은 GATT Profile에서 제공하는 서비스들을 캡슐화 한 것으로, Link Loss
Service, Immediate Alert Service, Tx Power Service가 들어있다.
제공하는 다른 Profile로는 Heart Rate Profile(HRP)가 있는데 이 Profile을 사용하여 심박모니터 기능을 구현할 수 있다.
6. 3. Proximity Profile (PXP)
1) 소개
Proximity Profile은 연결이 해제되거나 또는 경로 손실이 일어났을 때 즉시 경고를 일으킬 수 있는 기능이 가능하게 설계
되었다.
2) Service in profile
Proximity Profile에는 3가지 서비스가 구성되어 있음.
3) 추가 Service
Service 용도
org.bluetooth.service.link_loss 연결 해제 모니터링 용도
org.bluetooth.service.immediate_alert Find me(Find Phone)
org.bluetooth.service.tx_power 사용 안함.
Service 용도
org.bluetooth.service.battery_service Device battery
8. 1. 사용 API 설명
1) Framework
a. Corebluetooth Framework 사용.
b. Master(Phone)에서 Slave에 Trace 기능을 Support하도록 Service Server 개념 도입
(Phone단에 Find me Profile을 Server 개념으로 등록하여 Slave에서 Find Phone 기능 구현)
9. 2. Sequence diagram
Master(Phone) Slave(Device)
new CBCentralManager()
scanForPeripheralsWithService
didDiscoverPeripheral
connectPeripheral
didConnectPeripheral
discoverService
didDiscoverService
discoverCharacteristics
didDiscoverCharacteristicsForService
1
2
3
4
5
6
7
8
9
번호 설명
1 CBCentralManager 생성
2 BLE Device 검색
3 BLE Device 검색 완료
4 Device에 연결 요청
5 Device 연결 완료
6 Device에서 제공하는 Service 검색
7 Service 검색 완료(Proximity Profile)
8 각 Service의 Characteristic 요청
9 Characteristic 검색 완료.
1) 검색 및 연결
10. writeValue
didWriteValueForCharacteristic
1
2
번호 설명
1
Immediate Alert Service를 이용하
여 Device에 알람 요청
2
Call back으로 알람 요청 처리 결과
리턴
3
Phone에서 Finde Phone(Find me)
제공할 Service 추가
(Immediate Alert Service)
4
Device에서 버튼을 눌러
Server(Phone)에 알람 요청
2) Find me
Slave((Device)
didReceiveWriteRequests
3) Find phone(Find me 서비스를 폰단에 등록 하여야 함)
3
Master(Phone) Slave(Device)
Master(Phone)
addService
4
2. Sequence diagram
12. 1. 사용 API 설명
1) Android 4.1.2, Android 4.2.2 (삼성 전용)
a. 삼성에서 제공하는 SDK 사용
b. 패키지명 : com.samsung.android.sdk.bt.gatt.*
c. 삼성에서 제조한 Device만 사용 가능.
2) Android 4.3 이상
a. 구글에서 제공하는 API 사용
b. 패키지명 : android.bluetooth.*
13. 2. Sequence diagram
Master(Phone) Slave(Device)
new BluetoothAdapter()
startLeScan()
BluetoothAdpater.LeScanCallback
connectGatt()
BluetoothGattCallback. onConnectionStateChange()
discoverServices()
BluetoothGattCallback .onServicesDiscovered()
getService()
getCharacteristic()
1
2
3
4
5
6
7
8
9
번호 설명
1 BluetoothAdapter 생성
2 BLE Device 검색
3 BLE Device 검색 완료
4 Device에 연결 요청
5 Device 연결 완료
6 Device에서 제공하는 Service 검색
7 Service 검색 완료(Proximity Profile)
8
Service 요청(link_loss,
immediate_alert, tx_power)
9 각 Service의 Characteristic 요청
1) 검색 및 연결
14. BluetoothGattCharacteristic.setValue() 1
번호 설명
1
Immediate Alert Service를 이용하
여 Device에 알람 요청
2
Phone에서 제공할 Service 추가
(Immediate Alert Service)
3
Device에서 버튼을 눌러
Server(Phone)에 알람 요청
Slave(Device)
onCharacteristicWriteRequest()
2
Master(Phone) Slave(Device)
Master(Phone)
addService()
3
2) Find me
2) Find phone(Android 4.1.2, 4.3, 4.4 지원 안함)
2. Sequence diagram