일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- mac
- 볼링
- 설치
- Mobile
- 아이맥
- windows7
- c#
- WebService
- 형식
- VISTA
- java
- 윈도구7
- install
- windows
- 오브젝티브C
- cagr48com
- 퇴사
- 애플
- WSDL
- iPhone
- Number
- 맥
- Objective-C
- 7932
- 아이폰
- ObjectiveC
- 링크
- 윈도우즈7
- screen
- 윈도구
Archives
- Today
- Total
A colossal Dreamer: GR鐵塔-天生我材
iOS BLE 코딩 난이도 CBPeripheralManager >> CBCentralManager 본문
Development/비에리(Bluetooth LE)
iOS BLE 코딩 난이도 CBPeripheralManager >> CBCentralManager
江多林 2019. 5. 13. 22:05CoreBluetooth (Ble) 코딩 까도 까도 계속 어려움이 나오는 구나.
CBCentralManager (Client 모드) 관련 코드도 무지 어려웠는데..
CBPeripheralManager (Server 모드) 관련 코드는 더 어렵구나..
CoreBluetooth 진입장벽
- 접속 프로세스
- 용어도 어색하고, 제약도 많아서 개념파악이 쉽지 않음
- 어색한 delegate 모델
- 운영상황이 서로 다른 상태모형을 하나의 delegate 가 받아 처리하기에 꼬리의 꼬리를 물게 된다.
- 객체지향모델과는 서로 결이 달라 매우 어색한 코드 작성되며, 스텝이 꼬인 것을 복원하려 하면, 더욱 복잡해진다.
- Central 상태모형 분리
- scanning: idle → scanning → peripheral identifier
- working: peripheral identifier → connect & configurate → working
- restoring: restoring info → configuration 재구성
- CBCentralManager.connect(peripheral) 이후에 Peripheral 메시지를 받을 수 있다.
- Peripheral 상태모형
- configuration: idle → configurate → running → idle
- advertisement: idle → advertising
- subscribing 이것은 또 어떻게.. ㅡㅜ
접근 순서
- 꼬리의 꼬리를 무는 예제로 순환구조를 테스트해보자
- 이 때는 PeripheralManager 가 CentralManager 보다 100배는 쉽다.
- Central 을 3가지 상태모형으로 분리하여 구성하자.
- scanning 은 완전히 독립된 CentralManager 로 분리할 수 있다. ( 복수의 CentralManager 인스턴스를 써도 잘 동작하므로 )
- Peripheral 처리기를 별도로 분리하자.
- Restoring 을 구성하자.
- Peripheral 은 새로운 접근 방법을 요구하는데...
- '어떻게?' 에 대해서 아직은 잘 모르겠다.
'Development > 비에리(Bluetooth LE)' 카테고리의 다른 글
Bluetooth Event (0) | 2021.03.18 |
---|---|
Bluetooth LE iOS MTU maximumWriteValueLength (0) | 2019.04.16 |
Bluetooth LE Pairing 과정 Workflow (0) | 2019.04.02 |
BLE 훑어보기 (0) | 2019.03.14 |