I have made a python script based on this github in order to use ble scanning/advertising.
This script will run a long time and the Bluetooth thread might have a problem which caused them to stop. I wanted to know if there is any way to know if there are still running. (So I can restart them if not)
There might be a hci_command which returns the states of the Wi-Fi chip but I am unable to find it. Do you have any idea on how I can do that ?
To start the le scan, I execute this command on my python script:
hci_send_cmd(sock, OGF_LE_CTL, OCF_LE_SET_SCAN_ENABLE, 0X01)
To start the advertising, I execute this one:
hci_send_cmd(sock, OGF_LE_CTL, OCF_LE_SET_ADVERTISE_ENABLE, 0X01)
Now, I want to regularly check if Bluetooth scanning/advertising are still running.
EDIT: I talked about thread but it doesn't work like this, when you start scanning/advertising it doesn't create thread. I just need to find a way to ask to the Bluetooth chip if it scan and advertise.