Open ftab opened 1 year ago
This is helpful for storing the last known connected device for reconnecting to it on startup.
For example:
if ((msg.cmd == PERIPH_BLUETOOTH_CONNECTED)) { /* Save this as the last device that was connected */ nvs_handle_t my_handle; esp_err_t err; err = nvs_open("storage", NVS_READWRITE, &my_handle); ESP_ERROR_CHECK_WITHOUT_ABORT(err); esp_bd_addr_t connected_bd_addr; periph_bt_get_connected_bd_addr(periph_set_handle, connected_bd_addr); err = nvs_set_blob(my_handle, "last_bd_addr", connected_bd_addr, 6); ESP_ERROR_CHECK_WITHOUT_ABORT(err); err = nvs_commit(my_handle); ESP_ERROR_CHECK_WITHOUT_ABORT(err); nvs_close(my_handle); }
All committers have signed the CLA.
Hi @ftab , the commit message should inform the new function is to get the address of a2dp connected device
@JosephTang Thanks for the review, I have updated the commit message and implemented your suggestions.
This is helpful for storing the last known connected device for reconnecting to it on startup.
For example: