fix some warnings
remove beacon blocking wait for Serial connection
This commit is contained in:
1 parent
4d703b6f38
commit
3984c86902
5 files changed
+7
-5
No files matched your search
@@ -194,8 +194,7 @@ void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime )
|
||||
(void) sd_softdevice_is_enabled(&sd_en);
|
||||
if (sd_en) // (softdevice_handler_is_enabled())
|
||||
{
|
||||
uint32_t err_code = sd_app_evt_wait();
|
||||
//APP_ERROR_CHECK(err_code);
|
||||
(void) sd_app_evt_wait();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
@@ -34,7 +34,9 @@ BLEBeacon beacon(beaconUuid, 0x0000, 0x0000, -54);
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
while ( !Serial ) delay(10); // for nrf52840 with native usb
|
||||
|
||||
// Uncomment to blocking wait for Serial connection
|
||||
// while ( !Serial ) delay(10);
|
||||
|
||||
Serial.println("Bluefruit52 Beacon Example");
|
||||
Serial.println("--------------------------\n");
|
||||
|
||||
@@ -126,7 +126,7 @@ void BLEPeriph::setDisconnectCallback( ble_disconnect_callback_t fp )
|
||||
void BLEPeriph::_eventHandler(ble_evt_t* evt)
|
||||
{
|
||||
uint16_t const conn_hdl = evt->evt.common_evt.conn_handle;
|
||||
BLEConnection* conn = Bluefruit.Connection(conn_hdl);
|
||||
// BLEConnection* conn = Bluefruit.Connection(conn_hdl);
|
||||
|
||||
switch ( evt->header.evt_id )
|
||||
{
|
||||
|
||||
@@ -374,6 +374,7 @@ void BLESecurity::_eventHandler(ble_evt_t* evt)
|
||||
// - load key and return if bonded previously.
|
||||
// - Else return NULL --> Initiate key exchange
|
||||
ble_gap_evt_sec_info_request_t* sec_info = (ble_gap_evt_sec_info_request_t*) &evt->evt.gap_evt.params.sec_info_request;
|
||||
(void) sec_info;
|
||||
|
||||
LOG_LV2("PAIR", "Address: ID = %d, Type = 0x%02X, %02X:%02X:%02X:%02X:%02X:%02X",
|
||||
sec_info->peer_addr.addr_id_peer, sec_info->peer_addr.addr_type,
|
||||
@@ -395,6 +396,7 @@ void BLESecurity::_eventHandler(ble_evt_t* evt)
|
||||
case BLE_GAP_EVT_CONN_SEC_UPDATE:
|
||||
{
|
||||
const ble_gap_conn_sec_t* conn_sec = &evt->evt.gap_evt.params.conn_sec_update.conn_sec;
|
||||
(void) conn_sec;
|
||||
LOG_LV2("PAIR", "Security Mode = %d, Level = %d", conn_sec->sec_mode.sm, conn_sec->sec_mode.lv);
|
||||
|
||||
if ( _secured_cb )
|
||||
|
||||
@@ -97,7 +97,6 @@ void bond_init(void)
|
||||
*------------------------------------------------------------------*/
|
||||
static void bond_save_keys_dfr (uint8_t role, uint16_t conn_hdl, bond_keys_t const * bkeys)
|
||||
{
|
||||
uint16_t const ediv = (role == BLE_GAP_ROLE_PERIPH) ? bkeys->own_enc.master_id.ediv : bkeys->peer_enc.master_id.ediv;
|
||||
uint8_t const * mac = bkeys->peer_id.id_addr_info.addr;
|
||||
|
||||
// Bond store keys using peer mac address e.g 1a2b3c4d5e6f
|
||||
|
||||
Reference in new issue
Block a user