Infineon Logo AIROC BTSDK v4.8 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions

Functions

uint16_t wiced_hal_write_nvram (uint16_t vs_id, uint16_t data_length, uint8_t *p_data, wiced_result_t *p_status)
 Write data to NVRAM. More...
 
uint16_t wiced_hal_read_nvram (uint16_t vs_id, uint16_t data_length, uint8_t *p_data, wiced_result_t *p_status)
 Reads data from NVRAM, which was previously written by the application to a specific VS_ID using wiced_hal_write_nvram. More...
 
void wiced_hal_delete_nvram (uint16_t vs_id, wiced_result_t *p_status)
 Deletes data that exists at a specific, previously written vs_id. More...
 

Detailed Description

Function Documentation

void wiced_hal_delete_nvram ( uint16_t  vs_id,
wiced_result_t p_status 
)

Deletes data that exists at a specific, previously written vs_id.

It's not necessary to call this function in order to overwrite new data to a vs_id. The p_status parameter is used to indicate additional information about type of failure if return code is zero. Possible values for p_status:

  • WICED_BADARG indicates vs_id out of range
  • WICED_SUCCESS indicates success and return code indicates num written
  • WICED_ERROR indicates failure, returned zero bytes written
Parameters
[in]vs_idvolatile section ID
[out]p_statusresult code returned
Returns
void
Note
This function can only be called from the application thread.
uint16_t wiced_hal_read_nvram ( uint16_t  vs_id,
uint16_t  data_length,
uint8_t *  p_data,
wiced_result_t p_status 
)

Reads data from NVRAM, which was previously written by the application to a specific VS_ID using wiced_hal_write_nvram.

Use the same VS_ID to restore the data to the input memory buffer. The p_status parameter is used to indicate additional information about type of failure if return code is zero. Possible values for p_status:

  • WICED_BADARG indicates vs_id out of range
  • WICED_SUCCESS indicates success and return code indicates num written
  • WICED_ERROR indicates failure, returned zero bytes written
Parameters
[in]vs_idvolatile section ID
[in]data_lengthnum bytes to read from NVRAM (max 500)
[out]p_dataallocated buffer into which data can be memcpy'd
[out]p_statusresult code returned
Returns
  • non-zero value indicates number of bytes read
  • 0 indicates failure
Note
This function can only be called from the application thread.
uint16_t wiced_hal_write_nvram ( uint16_t  vs_id,
uint16_t  data_length,
uint8_t *  p_data,
wiced_result_t p_status 
)

Write data to NVRAM.

Each VS_ID can store 500 bytes. The range of VS_IDs available to write to is enumerated above as the range of WICED_NVRAM_VSID_START to WICED_NVRAM_VSID_END. The p_status parameter is used to indicate additional information about type of failure if return code is zero. Possible values for p_status:

  • WICED_BADARG indicates vs_id out of range
  • WICED_SUCCESS indicates success and return code indicates num written
  • WICED_ERROR indicates failure, returned zero bytes written
Parameters
[in]vs_idvolatile section ID
[in]data_lengthnum bytes to write to NVRAM (max 500)
[in]p_datapointer to the data to be written to NVRAM
[out]p_statusresult code returned
Returns
  • non-zero value indicates number of bytes written
  • 0 indicates failure
Note
This function can only be called from the application thread.