BLE API
Provisioning API
-
Upon a user action, such as a button press on the Sentroller device, a flag in the advertisement is set. This indicates that to the mobile app that provisioning mode is entered.
-
The mobile app scans for device advertisments with the provisioning field enabled.
- The mobile app establishes a connection with the device in provisioning mode
- The mobile app discovers the Sentroller BLE services, plus a read and write characteristic.
The mobile app writes the WiFi credentials and a call back address into the BLE using the following JSON.
{ "SSID":"<users_wifi_ssid>", "pphrase":"<wifi_password>", "cbapi":"<http://www.callbacklocation.com>" }
- Upon successful provision the Sentroller will invoke the callback API, signalling to the backend that the Provisioning was successful (or failure code). The callback API must be specified by the mobile app developer.
- It is also possible to get a provisioning result response directly via BLE by doing a read on the read charactertics's buffer. The result will be:
{"Provisioning result":"<status>"}
where status could be
- Pending : Provisioning still in process
- Success : Device successfully provisioned
- fail_no_wifi: Failed due to WiFi connectivity issue
- fail_other : Failed due to any other issue