hci_open_devで、デバイスIDからBluetoothソケットを開く。
http://people.csail.mit.edu/albert/bluez-intro/c404.html
hci_open_dev.cで、
dev_idを取得し、hci_open_devに渡すと、socが返る。
これがBluetoothソケットファイルディスクリプタ。
$ vi hci_open_dev.c $ gcc -o hci_open_dev hci_open_dev.c -lbluetooth $ ./hci_open_dev dev_id = 0 soc = 3 $
dev_idは0から始まり、socは3から始まる。
Sample/bluez/hci_open_dev/hci_open_dev/src/hci_open_dev at master · bg1bgst333/Sample · GitHub