2012년 7월 31일 화요일

bluetooth stack 분석

Android : bluez 를 이용
* bluez 구성
* linux kernel (net/bluetooth ) 부분에 hci command 를 이용한 l2cap 이 구현되어 있음.
* library 형태로 profile 들이 구현되어 있음.
* bluetoothd 라는 daemon 을 띄우고 d-bus 를 통해 android platform 과 통신함.
* sdp tree 관련 처리는 tool을 이용해서 따로 하고 있음.

Windows 7,8
* MS 에서 구현 bthport.sys 라는 port 가 있고 여기에 miniport 로 bthusb.sys 랑 bthuart.sys 같은게 있음. ( l2cap 이 여기서 다 구현되어 있음)

- 참고
bthusb 등이 bthport 에 있는 함수를 직접 부를 형태여서 이 사이에 filter를 달거나 할 수 없음.
따라서 당연히 device tree 를 확인하는 툴로 봐도 bthport.sys는 안보임.

* profile 들도 driver 형태로 구현함
* BRB 라고 bluetooth request block 을 만들어서 ioctl로 내리면 알아서 처리해줌.
* sdp tree 관련해서 처리하는 inteface 를 비슷한 layer에서 제공해줌.