Add ioctl's for the bluetooth authentication
For dive computers which are using an application specific proprietary pairing mechanism instead of the standard bluetooth pairing, we need to be able to exchange some additional information with the application. Therefore, 3 new BLE specific ioctl's are added: When a device has not been paired yet, libdivecomputer will request the PIN code from the application with DC_IOCTL_BLE_GET_PINCODE. Once the device has been paired successfully, the access code is passed back to the application with DC_IOCTL_BLE_SET_ACCESSCODE. On the next download, libdivecomputer will request this access code again from the application with DC_IOCTL_BLE_GET_ACCESSCODE. If no access code is available, the pairing procedure will start again by requesting the PIN.
This commit is contained in:
parent
47f6949db1
commit
8e349d4046
@ -33,6 +33,21 @@ extern "C" {
|
||||
*/
|
||||
#define DC_IOCTL_BLE_GET_NAME DC_IOCTL_IOR('b', 0, DC_IOCTL_SIZE_VARIABLE)
|
||||
|
||||
/**
|
||||
* Get the bluetooth authentication PIN code.
|
||||
*
|
||||
* The data format is a NULL terminated string.
|
||||
*/
|
||||
#define DC_IOCTL_BLE_GET_PINCODE DC_IOCTL_IOR('b', 1, DC_IOCTL_SIZE_VARIABLE)
|
||||
|
||||
/**
|
||||
* Get/set the bluetooth authentication access code.
|
||||
*
|
||||
* The data format is a variable sized byte array.
|
||||
*/
|
||||
#define DC_IOCTL_BLE_GET_ACCESSCODE DC_IOCTL_IOR('b', 2, DC_IOCTL_SIZE_VARIABLE)
|
||||
#define DC_IOCTL_BLE_SET_ACCESSCODE DC_IOCTL_IOW('b', 2, DC_IOCTL_SIZE_VARIABLE)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user