Interface Programming Information and Examples
CYW920706WCDEVAL Hardware User Guide Doc. No.: 002-16535 Rev. **
42
10.6 NVRAM Programming Example
The following code sample provides an example of writing a Bluetooth device address to NVRAM and reading it back.
#define APP_VS_ID WICED_NVRAM_VSID_START
BD_ADDR bd_addr_write = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06};
BD_ADDR bd_addr_read;
void test_nvram_read_write_app( )
{
uint8_t written_bytes, read_bytes;
wiced_result_t status;
/* Write BD ADDR to NVRAM */
written_bytes = wiced_hal_write_nvram( APP_VS_ID, BD_ADDR_LEN, bd_addr_write,
&status );
WICED_BT_TRACE("status of nvram write %d, number of bytes written %d\n", status,
written_bytes);
/* Read BD ADDR from NVRAM */
read_bytes = wiced_hal_read_nvram( APP_VS_ID, BD_ADDR_LEN, bd_addr_read,
&status );
WICED_BT_TRACE( "status of nvram read %d, number of bytes read %d\n", status,
read_bytes);
wiced_bt_trace_array( "BD_ADDR read back : \n", bd_addr_read, BD_ADDR_LEN);
}