tps_c.h
Go to the documentation of this file.
1
56 #ifndef __TPS_C_H__
57 #define __TPS_C_H__
58
59 #include "gr55xx_sys.h"
60 #include "ble_prf_types.h"
61 #include "custom_config.h"
62 #include <stdint.h>
63 #include <stdbool.h>
64
69 #define TPS_C_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
70 10 : CFG_MAX_CONNECTIONS)
78 typedef enum
79 {
80 TPS_C_EVT_INVALID,
81 TPS_C_EVT_DISCOVERY_COMPLETE,
82 TPS_C_EVT_DISCOVERY_FAIL,
83 TPS_C_EVT_TX_POWER_LEVEL_RECEIVE,
84 } tps_c_evt_type_t;
92 typedef struct
93 {
94 uint16_t tps_srvc_start_handle;
95 uint16_t tps_srvc_end_handle;
96 uint16_t tps_tx_power_level_handle;
97 } tps_c_handles_t;
98
100 typedef struct
101 {
102 uint8_t conn_idx;
103 tps_c_evt_type_t evt_type;
104 int8_t tx_power_level;
105 } tps_c_evt_t;
113 typedef void (*tps_c_evt_handler_t)(tps_c_evt_t *p_evt);
129 sdk_err_t tps_client_init(tps_c_evt_handler_t evt_handler);
130
140 sdk_err_t tps_c_disc_srvc_start(uint8_t conn_idx);
141
151 sdk_err_t tps_c_tx_power_level_read(uint8_t conn_idx);
154 #endif
155
tps_c_handles_t::tps_srvc_end_handle
uint16_t tps_srvc_end_handle
Definition: tps_c.h:95
tps_c_evt_handler_t
void(* tps_c_evt_handler_t)(tps_c_evt_t *p_evt)
Tx Power Service Client event handler type.
Definition: tps_c.h:113
tps_c_handles_t::tps_srvc_start_handle
uint16_t tps_srvc_start_handle
Definition: tps_c.h:94
gr55xx_sys.h
GR55XX System API.
tps_c_evt_type_t
tps_c_evt_type_t
Tx Power Service Client event type.
Definition: tps_c.h:79
TPS_C_EVT_TX_POWER_LEVEL_RECEIVE
@ TPS_C_EVT_TX_POWER_LEVEL_RECEIVE
Definition: tps_c.h:83
tps_client_init
sdk_err_t tps_client_init(tps_c_evt_handler_t evt_handler)
Register TPS Client event handler.
tps_c_evt_t
Tx Power Service Client event.
Definition: tps_c.h:101
tps_c_tx_power_level_read
sdk_err_t tps_c_tx_power_level_read(uint8_t conn_idx)
Read Tx Power Level characteristic value.
ble_prf_types.h
Profile/Service Common Types.
sdk_err_t
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:243
tps_c_evt_t::conn_idx
uint8_t conn_idx
Definition: tps_c.h:102
TPS_C_EVT_DISCOVERY_COMPLETE
@ TPS_C_EVT_DISCOVERY_COMPLETE
Definition: tps_c.h:81
tps_c_handles_t
Handles on the connected peer device needed to interact with it.
Definition: tps_c.h:93
tps_c_handles_t::tps_tx_power_level_handle
uint16_t tps_tx_power_level_handle
Definition: tps_c.h:96
tps_c_evt_t::tx_power_level
int8_t tx_power_level
Definition: tps_c.h:104
tps_c_evt_t::evt_type
tps_c_evt_type_t evt_type
Definition: tps_c.h:103
tps_c_disc_srvc_start
sdk_err_t tps_c_disc_srvc_start(uint8_t conn_idx)
Discovery Tx Power Service on peer.
TPS_C_EVT_INVALID
@ TPS_C_EVT_INVALID
Definition: tps_c.h:80
TPS_C_EVT_DISCOVERY_FAIL
@ TPS_C_EVT_DISCOVERY_FAIL
Definition: tps_c.h:82