Added experimental functions allowing to set the BLE modem to sleep to save power. Does not work as intended (bug in the SDK probably).
This commit is contained in:
parent
580c9f4e68
commit
8745170092
@ -96,3 +96,27 @@ bool is_ble_modem_on(void)
|
|||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ble_modem_allow_sleep(bool allowSleep)
|
||||||
|
{
|
||||||
|
tls_bt_status_t ret = tls_bt_ctrl_sleep(allowSleep);
|
||||||
|
|
||||||
|
if(TLS_BT_STATUS_SUCCESS != ret)
|
||||||
|
{
|
||||||
|
TLS_BT_APPL_TRACE_ERROR("%s, tls_bt_ctrl_sleep ret:%d"NEW_LINE, __FUNCTION__, ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TLS_BT_STATUS_SUCCESS == ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ble_modem_wakeup(void)
|
||||||
|
{
|
||||||
|
tls_bt_status_t ret = tls_bt_ctrl_wakeup();
|
||||||
|
|
||||||
|
if(TLS_BT_STATUS_SUCCESS != ret)
|
||||||
|
{
|
||||||
|
TLS_BT_APPL_TRACE_ERROR("%s, tls_bt_ctrl_wakeup ret:%d"NEW_LINE, __FUNCTION__, ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TLS_BT_STATUS_SUCCESS == ret;
|
||||||
|
}
|
||||||
|
@ -29,4 +29,8 @@ bool ble_modem_off(void);
|
|||||||
*/
|
*/
|
||||||
bool is_ble_modem_on(void);
|
bool is_ble_modem_on(void);
|
||||||
|
|
||||||
|
bool ble_modem_allow_sleep(bool allowSleep);
|
||||||
|
|
||||||
|
bool ble_modem_wakeup(void);
|
||||||
|
|
||||||
#endif //BLE_MODEM_H
|
#endif //BLE_MODEM_H
|
||||||
|
Loading…
Reference in New Issue
Block a user