This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

pc_ble_driver.py:TypeError: 'NoneType' object is not subscriptable

Hello,

I am reading a data from a file and sending write req in loop to transfer chunk of data using pc_ble_driver but getting following error message after transferring couple of chunks of data.

@NordicSemiErrorCheck(expected=BLEGattStatusCode.success)
def write_req(self, conn_handle, uuid, data, attr_handle=None):
if attr_handle is None:
attr_handle = self.db_conns[conn_handle].get_char_value_handle(uuid)
if attr_handle is None:
raise NordicSemiException("Characteristic value handler not found")
write_params = BLEGattcWriteParams(
BLEGattWriteOperation.write_req,
BLEGattExecWriteFlag.unused,
attr_handle,
data,
0,
)
self.driver.ble_gattc_write(conn_handle, write_params)
result = self.evt_sync[conn_handle].wait(evt=BLEEvtID.gattc_evt_write_rsp)
> return result["status"]
E TypeError: 'NoneType' object is not subscriptable

Can you please let me know why getting this issue randomly?

Related