20 #ifndef __PTU_REGISTRY_H__
21 #define __PTU_REGISTRY_H__
28 #include "app_timer.h"
62 uint8_t active_p_adj_cooldown:1;
63 uint8_t adjusted_power:1;
64 uint8_t pending_dyn_read:1;
65 uint8_t pending_ctl_write:1;
67 uint8_t pending_charge_disable:1;
68 uint8_t link_encrypted:1;
69 uint8_t p_adj_disabled:1;
void ptu_reg_item_delete(ptu_reg_item_t *item)
Delete item that has previoulsy been added to registry.
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.
WPT Service Client structure. This contains various status information for the service.
uint8_t ptu_reg_registered_devices_get(ptu_reg_item_t **registered_devices)
Get handles for all registered devices.
ptu_reg_item_t * ptu_reg_item_get_from_address(ble_gap_addr_t *address)
Get registry item from GAP address.
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.
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.
ctl_adj_power_t prev_adj_power
ptu_reg_item_state_t
Registry item status.
int32_t p_rect_before_p_adj
PRU Static Parameter structure.
pru_static_t prev_pru_static
bool ptu_reg_all_charged(void)
Function returning true if all items in registry are charged or there are not items in registry...
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 ...
ptu_reg_item_t * ptu_reg_item_oldest_get(ptu_reg_item_state_t state)
Get oldest registry item having a specific state.
void ptu_reg_init(void)
Initialize registry database.
ptu_reg_item_t * ptu_reg_item_get_from_conn_handle(uint16_t conn_handle)
Get registry item from connection handle.
ctl_adj_power_t
Power adjust settings in control packet.
pru_dynamic_t prev_pru_dynamic
#define PTU_MAX_CONNECTIONS
ptu_reg_item_state_t state
PRU Dynamic Parameter structure.