SFU-Embedded-Cosplay / Halo-Suit-BeagleBone

2 stars 0 forks source link

Does set_bluetooth_mode need to create a socket? #9

Closed HamiltonChris closed 9 years ago

HamiltonChris commented 9 years ago

I'm not 100% sure but this function seems to set the mode of the bluetooth device to SCAN_INQUIRY and SCAN_PAGE but in the process it creates a socket and then closes it. I just wondering if this is necessary since I found an example here that doesn't create a socket but seems to do a similar thing.

abrykajlo commented 9 years ago

hci_open_dev in the example yiu supplied is a convenience function that does exactly what I did and returns a bluetooth socket. So either way you have to close it but that code sample he forgets to

HamiltonChris commented 9 years ago

OK I guess we can replace the socket() function with hci_open_dev so that it's more clear.