Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

how to keep connecting after reset or power-up cycle nrf52840?

Good morning nordic team,

I use BLE app HID Keyboard with softdevice 7.2.0, nRF5 SDK 17.1.0 and for the hardware I use nrf52840's SoC. The connecting and disconnecting well works. My issue rises when I reset the SoC with reset pin or a power-up cycle because battery depleted. The master (smartphone or computer) is connected always and in my application i lauch advertising_start() with the parameter "erase_bonds"! I think that I make the wrong things !

Maybe before deleting the links using the advertising_start(erase_bond) function, I need to know if I'm paired with a master and if there's a connection attempt ?

1) I would like to know how to reconnect me because the smartphone try to reconnect ?


2) Do you have a tutorial for best understand the process of adverting, pairing, connecting, reconnnecting, unpair for BLE because it's a misunderstanding of the BLE software stack !

below the main() function:

/**@brief Function for application main entry.
*/
int main(void)
{
bool erase_bonds;

// Initialize.
#ifdef AT_DBG
uart_init();
#endif
gestion_cmd_init();

log_init();
timers_init();
buttons_leds_init(&erase_bonds);
power_management_init();
ble_stack_init();
scheduler_init();
gap_params_init();
gatt_init();
advertising_init();
services_init();
sensor_simulator_init();
conn_params_init();
buffer_init();
peer_manager_init();

// Start execution.
send_trame_asyn(ASYN_MODULE_STATUS, LEN_STRING_STATUS_RADIO_MODULE, str_event_RST_RADIO_MODULE);
strncpy((char *)&value_status_ble, RST_RADIO_MODULE, 1);
transmission_send_trame_asyn();

NRF_LOG_INFO("HID Keyboard example started.");
timers_start();
advertising_start(erase_bonds);

// Enter main loop.
for (;;)
{
idle_state_handle();
}
}

Thanks for help

alexandre

Parents Reply
  • Dear Sigurd,

    I find how to used the pin1.01, I have just to change in the skd_config.h 

    #define NRF_LOG_BACKEND_UART_TX_PIN 33

    UART pins are configured in the "nrfx_uarte.c" function, which uses the "apply_config(p_instance, p_config)" function.

    but I couldn't find how to connected only 8 masters and especially forbid the ninth master ?

    I repeat idea: My application HID Keyboard BLE connecte to 8 masters (computer or smartphone) the peer_id increase to 0 to 7 and if a ninth master want to pair then I erase bond. But before erase bond I want to forbid ninth's pairing!

    thanks for help

    Alexandre

Children
No Data
Related