Hi all, I'm trying to implement passkey bonding using pc-ble-driver-py.
It doesn't appear to be supported in the BLEDriver.py itself, so I tried to add the sd_ble_gap_auth_key_reply call to pc-ble-driver myself.
I'm using:
@NordicSemiErrorCheck
@wrapt.synchronized(api_lock)
def ble_gap_auth_key_reply(self, conn_handle, key_type, key):
assert (driver.BLE_GAP_AUTH_KEY_TYPE_PASSKEY ==
key_type)
print( util.list_to_uint8_array(key))
print( util.list_to_uint8_array(key).cast())
return driver.sd_ble_gap_auth_key_reply(
self.rpc_adapter,
conn_handle,
key_type,
util.list_to_uint8_array(key).cast())
And feeding in:
input_val = map(ord,raw_input("Enter passkey: ")[:-1])
As far as I can see, i'm sending it a list of ASCII characters of 6 bytes, removing the null terminator (as per https://github.com/NordicSemiconductor/pc-ble-driver/blob/971241c19abc33bbc6469e1be601a2ab78fbb35b/src/sd_api_v5/sdk/components/softdevice/s132/headers/ble_gap.h#L1183)
I'm getting a auth_status returned of (BLEGapSecStatus.confirm_value), as far I can see that's an error telling me I have fed it an incorrect passcode?
What am I doing wrong?
Cheers!