AF_BLUETOOTH

AF_BLUETOOTHは、Bluetoothのアドレスファミリーということ。

http://people.csail.mit.edu/albert/bluez-intro/x502.html

bindする時もsockaddr_rcで使う。

local_addr.rc_familyにもAF_BLUETOOTHを指定。
sockaddr_rcは、BluetoothというかRFCOMM用のsockaddr。
bindまでしてみる。

$ pwd
/home/bg1/project/cloud/github.com/Sample/bluez/AF_BLUETOOTH/AF_BLUETOOTH/src/AF_BLUETOOTH
$ vi AF_BLUETOOTH.c
$ ls
AF_BLUETOOTH.c
$ gcc -o AF_BLUETOOTH AF_BLUETOOTH.c -lbluetooth
$ ls
AF_BLUETOOTH  AF_BLUETOOTH.c
$ ./AF_BLUETOOTH
soc = 3
bind success.
$

一応bindまで出来たみたい。
でもここから先が大変。

Sample/bluez/AF_BLUETOOTH/AF_BLUETOOTH/src/AF_BLUETOOTH at master · bg1bgst333/Sample · GitHub