dotstack API Reference
1.10.37
|
Functions | |
bt_uint | bt_oem_storage_get_capacity (void) |
Get non-volatile storage capacity. More... | |
void | bt_oem_storage_start (void) |
Begin a sequence of non-volatile storage operations. More... | |
void | bt_oem_storage_stop (void) |
End a sequence of non-volatile storage operations. More... | |
void | bt_oem_storage_write (bt_int addr, const bt_byte *data, bt_int len, bt_storage_callback_fp callback) |
Write to non-volatile storage. More... | |
void | bt_oem_storage_read (bt_int addr, bt_byte *buffer, bt_int len, bt_storage_callback_fp callback) |
Read from the non-volatile storage. More... | |
DotStack requires a non-volatile storage for storing link keys. This module declares an interface for accessing such storage. The application must provide implementations of all functions of this interface.
bt_uint bt_oem_storage_get_capacity | ( | void | ) |
Get non-volatile storage capacity.
Implementation of this function must return the capacity of its non-volatile storage.
void bt_oem_storage_read | ( | bt_int | addr, |
bt_byte * | buffer, | ||
bt_int | len, | ||
bt_storage_callback_fp | callback | ||
) |
Read from the non-volatile storage.
This function is called by the stack to read from the non-volatile storage. This function must be implemented by the application. When this function is called the application must start a read operation. When the number of bytes specified by the len
parameter is read, the application must call the callback function specified by the callback
parameter. The application does not have to read the whole number of bytes during the call to this function. It may complete reading later and then call the completion callback. The stack guarantees that the destination data buffer will be available until the application calls the completion callback.
addr | The non-volatile storage address where to read data from. |
buffer | The receiving buffer. |
len | The number of bytes to read. |
callback | The completion callback function. |
void bt_oem_storage_start | ( | void | ) |
Begin a sequence of non-volatile storage operations.
DotStack calls this function when it starts a sequence of non-volatile storage operations. When the sequence is finished, DotStack will call bt_oem_storage_stop().
void bt_oem_storage_stop | ( | void | ) |
End a sequence of non-volatile storage operations.
DotStack calls this function when it finishes executing a sequence of non-volatile storage operations.
void bt_oem_storage_write | ( | bt_int | addr, |
const bt_byte * | data, | ||
bt_int | len, | ||
bt_storage_callback_fp | callback | ||
) |
Write to non-volatile storage.
This function is called by the stack to write data to the non-volatile storage. This function must be implemented by the application. When this function is called, the application must start writing specified data to the non-volatile storage. When all data has been written, the application must call the callback function passed in the callback
parameter. The application does not have to complete the write operation during the call to this function. It may complete the operation later and then call the callback function. In this case, the application does not have to store the data in an internal buffer. The stack guarantees that the passed data will be present until the completion callback is called by the application.
addr | The persitent storage address where to write data to. |
data | Pointer to data. |
len | Data length. |
callback | The completion callback function. |