This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

pstorage_handle_t is lost in BLE NUS data event

why m_storageHandle_DeviceName became to 0xFFFFFFFF, its value was init by pstorage_register when app startup, but here it lost value. Can anybody help me ?

// event on receiving data from ble uart service
static void on_nus_data_evt(ble_nus_t * p_nus, uint8_t * p_data, uint16_t length)
{
    uint32_t err_code = 0;
    if (p_data != NULL && length > 0)
    {
        err = pstorage_clear( & m_storageHandle_DeviceName, 
                                       DEVICE_NAME_LENGTH*4);
	APP_ERROR_CHECK(err);
    }
}
Parents
  • Are you calling pstorage_init() yourself or are you talking about pstorage_init() inside device_manager_init()? Did you test the value of m_storageHandle_DeviceName right before calling pstorage_clear() inside on_nus_data_evt()?

Reply
  • Are you calling pstorage_init() yourself or are you talking about pstorage_init() inside device_manager_init()? Did you test the value of m_storageHandle_DeviceName right before calling pstorage_clear() inside on_nus_data_evt()?

Children
No Data
Related