Now updating the last byte of the bluetooth address if it does not follow the random address specification and updated a few log messages

This commit is contained in:
anschrammh 2023-03-26 22:57:43 +02:00
parent 3faa1162e2
commit 5387213c06

View File

@ -134,7 +134,7 @@ bool ble_service_start(void)
// 1 We first check if the BLE service is stopped
if(_ble_service_state != BLE_SERVICE_MODE_STOPPED)
{
TLS_BT_APPL_TRACE_WARNING("%s, ble service already running"NEW_LINE, __FUNCTION__);
TLS_BT_APPL_TRACE_WARNING("%s, ble service already running (%s)"NEW_LINE, __FUNCTION__, ble_service_state_2_str(_ble_service_state));
return true;
}
@ -327,7 +327,7 @@ bool ble_service_request_mtu_exchange(void)
bool ble_service_nus_send_data(const uint8_t *data, uint16_t length)
{
// The NUS is TX is using notification
// The NUS TX is using notifications
if(notification_data.transfer_in_progress)
{
TLS_BT_APPL_TRACE_WARNING("%s, a transfer is already in progress"NEW_LINE, __FUNCTION__);
@ -487,9 +487,12 @@ static bool ble_service_advertise(bool enable)
extern int tls_get_bt_mac_addr(u8 *mac);
tls_get_bt_mac_addr(device_addr);
// Make sure the the device address is compliant with the random address specification :
device_addr[5] |= 0xC0;
if((status = ble_hs_id_set_rnd(device_addr)) != BLE_HS_ENOERR)
{
TLS_BT_APPL_TRACE_ERROR("%s, ble_hs_id_infer_auto failed : %s"NEW_LINE, __FUNCTION__, tls_bt_rc_2_str(status));
TLS_BT_APPL_TRACE_ERROR("%s, ble_hs_id_set_rnd failed : %s"NEW_LINE, __FUNCTION__, tls_bt_rc_2_str(status));
return false;
}
else