Nordic Semiconductor nRF5 AirFuel SDK
version 2.2.0
|
Data Structures | |
struct | ptu_reg_item_t |
Registry item. More... | |
struct | ptu_reg_t |
Registry. More... | |
General API functions | |
void | ptu_reg_init (void) |
Initialize registry database. | |
uint8_t | ptu_reg_registered_devices_get (ptu_reg_item_t **registered_devices) |
Get handles for all registered devices. More... | |
uint8_t | ptu_reg_n_entries_get (void) |
Get the number of devices currently in registry. This will include all connected devices, as well as all devices which is currently being registered. More... | |
uint32_t | ptu_reg_item_get_from_index (uint8_t index, ptu_reg_item_t **item_p) |
Get registry item from index in database. Index must be < PTU_MAX_CONNECTIONS. More... | |
ptu_reg_item_t * | ptu_reg_item_get_from_conn_handle (uint16_t conn_handle) |
Get registry item from connection handle. More... | |
ptu_reg_item_t * | ptu_reg_item_get_from_address (ble_gap_addr_t *address) |
Get registry item from GAP address. More... | |
ptu_reg_item_t * | ptu_reg_item_oldest_get (ptu_reg_item_state_t state) |
Get oldest registry item having a specific state. More... | |
ptu_reg_item_t * | ptu_reg_item_add (ble_gap_evt_adv_report_t *p_adv_report, ptu_reg_item_state_t init_state) |
Initiate registration of new device. More... | |
uint32_t | ptu_reg_set_device_waiting_to_connect (ptu_reg_item_t *reg_item_p, uint8_t *address) |
Set the state of registry item to "ready to connect" state. Associates the address with the registry item. Should only be called with non-zero address values. More... | |
void | ptu_reg_item_delete (ptu_reg_item_t *item) |
Delete item that has previoulsy been added to registry. More... | |
bool | ptu_reg_all_charged (void) |
Function returning true if all items in registry are charged or there are not items in registry. More... | |
enum ptu_reg_item_state_t |
Registry item status.
Definition at line 31 of file ptu_registry.h.
uint8_t ptu_reg_registered_devices_get | ( | ptu_reg_item_t ** | registered_devices | ) |
Get handles for all registered devices.
[out] | registered_devices | Placeholder to write the registry item pointers of all registered devices to. |
Definition at line 254 of file ptu_registry.c.
uint8_t ptu_reg_n_entries_get | ( | void | ) |
Get the number of devices currently in registry. This will include all connected devices, as well as all devices which is currently being registered.
Definition at line 268 of file ptu_registry.c.
uint32_t ptu_reg_item_get_from_index | ( | uint8_t | index, |
ptu_reg_item_t ** | item_p | ||
) |
Get registry item from index in database. Index must be < PTU_MAX_CONNECTIONS.
[in] | index | |
[out] | item_p | pointer to where pointer to registry item will be written. |
Definition at line 126 of file ptu_registry.c.
ptu_reg_item_t* ptu_reg_item_get_from_conn_handle | ( | uint16_t | conn_handle | ) |
Get registry item from connection handle.
[in] | conn_handle |
Definition at line 137 of file ptu_registry.c.
ptu_reg_item_t* ptu_reg_item_get_from_address | ( | ble_gap_addr_t * | address | ) |
Get registry item from GAP address.
[in] | address |
Definition at line 153 of file ptu_registry.c.
ptu_reg_item_t* ptu_reg_item_oldest_get | ( | ptu_reg_item_state_t | state | ) |
Get oldest registry item having a specific state.
[in] | state | state of registry item. Note: REG_ITEM_STATE_UNUSED is not a legal value. |
Definition at line 169 of file ptu_registry.c.
ptu_reg_item_t* ptu_reg_item_add | ( | ble_gap_evt_adv_report_t * | p_adv_report, |
ptu_reg_item_state_t | init_state | ||
) |
Initiate registration of new device.
p_adv_report | pointer to adv report from device from which to register. |
init_state | initial state for the added registry item. |
Definition at line 187 of file ptu_registry.c.
uint32_t ptu_reg_set_device_waiting_to_connect | ( | ptu_reg_item_t * | reg_item_p, |
uint8_t * | address | ||
) |
Set the state of registry item to "ready to connect" state. Associates the address with the registry item. Should only be called with non-zero address values.
reg_item_p | The registry item to update. |
address | The non-zero BLE address. |
Definition at line 287 of file ptu_registry.c.
void ptu_reg_item_delete | ( | ptu_reg_item_t * | item | ) |
Delete item that has previoulsy been added to registry.
item | is the index in registry of the item to be deleted. |
Definition at line 220 of file ptu_registry.c.
bool ptu_reg_all_charged | ( | void | ) |
Function returning true if all items in registry are charged or there are not items in registry.
Definition at line 273 of file ptu_registry.c.