I’m using the library pc_ble_driver_py last release 0.14.1, and Nordic DevKit PCA10040. My goal is to set the central IRK value and generate a private resolvable address.
I call ble_gap_privacy_set to set a new IRK with privacy mode = BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY & private_addr_type = BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE; No error is returned however when I call ble_gap_addr_get after that it returns always centralAdd.addr_type = Types.random_static (0x01) instead of BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE (0x02). Please see the code below:
centralNewIRK = BLEGapPrivacyParams(privacy_mode, 0, private_addr_cycle_s, irk)
centralNewIRK.privacy_mode = 0x01
centralNewIRK.private_addr_type = 0x02
centralNewIRK.private_addr_cycle_s = 300
centralNewIRK.irk = irk
error = self.driver.ble_gap_privacy_set(centralNewIRK)
error, centralAdd = self.driver.ble_gap_addr_get()
print(centralAdd.addr_type)
I am not sure which part of the library doesn't work so well the set or the get but I don't see what I could do wrong since the code is very simple.
NB: when I set private_addr_type to BLEGapAddr.random_private_resolvable, an error is generated in to_c() of the class BLEGapPrivacyParams() saying that the value should be an uint8_t so I have to set it to the value 0x02 every time which is strange too
I whish you could do the test and tell me what you get.
Best Regards
Imen