Nordic Semiconductor nRF5 AirFuel SDK  version 2.2.0
ble_wpts_c.h
Go to the documentation of this file.
1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
2  *
3  * The information contained herein is property of Nordic Semiconductor ASA.
4  * Terms and conditions of usage are described in detail in NORDIC
5  * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
6  *
7  * Licensees are granted free, non-transferable use of the information. NO
8  * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
9  * the file.
10  *
11  */
12 
20 #ifndef BLE_WPTS_C_H__
21 #define BLE_WPTS_C_H__
22 
23 #include <stdint.h>
24 
25 #include "ble.h"
26 #include "ble_wpts_common.h"
27 #include "wpt.h"
28 
29 
31 typedef enum
32 {
42 
44 typedef struct
45 {
47  uint16_t gatt_status;
48  union
49  {
53  } data;
55 
57 typedef struct
58 {
59  ble_gattc_handle_range_t service_handle_range;
60  uint16_t pruc_handle;
61  uint16_t ptusp_handle;
62  uint16_t prua_handle;
63  uint16_t prua_cccd_handle;
64  uint16_t prusp_handle;
65  uint16_t prudp_handle;
66  uint16_t conn_handle;
67 } ble_wpts_c_t;
68 
70 typedef void (*ble_wpts_c_evt_handler_t) (ble_wpts_c_t * p_wpts_c, ble_wpts_c_evt_t * p_evt);
71 
74 typedef struct
75 {
78 
85 uint32_t ble_wpts_c_init(const ble_wpts_c_init_t * p_wpts_c_init);
86 
94 void ble_wpts_c_on_ble_evt(ble_wpts_c_t * p_wpts_c, ble_evt_t * p_ble_evt);
95 
106 uint32_t ble_wpts_c_send_pru_control(ble_wpts_c_t * p_wpts_c, pru_control_t * p_wpts_pru_control);
107 
115 
125 uint32_t ble_wpts_c_read_pru_static(ble_wpts_c_t * p_wpts_c);
126 
136 uint32_t ble_wpts_c_read_pru_dynamic(ble_wpts_c_t * p_wpts_c);
137 
148 uint32_t ble_wpts_c_write_ptu_static(ble_wpts_c_t * p_wpts_c, ptu_static_t * p_wpts_ptu_static);
149 
158 uint32_t ble_wpts_service_data_read(ble_gap_evt_adv_report_t * p_adv_report, ble_wpts_service_data_t * p_service_data);
159 
166 void ble_wpts_char_handles_update(uint16_t prim_service_handle, ble_wpts_c_t * p_wpts_c);
167 
168 #endif // BLE_WPTS_C_H__
169 
ble_wpts_c_evt_handler_t evt_handler
Definition: ble_wpts_c.h:76
PTU Static Parameter structure.
Definition: wpt.h:110
uint32_t ble_wpts_service_data_read(ble_gap_evt_adv_report_t *p_adv_report, ble_wpts_service_data_t *p_service_data)
Definition: ble_wpts_c.c:483
ble_wpts_c_evt_type_t
WPT Service Client event type.
Definition: ble_wpts_c.h:31
uint16_t conn_handle
Definition: ble_wpts_c.h:66
WPT Service Client structure. This contains various status information for the service.
Definition: ble_wpts_c.h:57
PRU Control structure.
Definition: wpt.h:79
uint16_t gatt_status
Definition: ble_wpts_c.h:47
uint32_t ble_wpts_c_enable_pru_alert_notification(ble_wpts_c_t *p_wpts_c)
Enable alert notifications to be sent from PRU.
Definition: ble_wpts_c.c:465
uint32_t ble_wpts_c_read_pru_static(ble_wpts_c_t *p_wpts_c)
Read the PRU Static Parameter characterisic value from the PRU server.
Definition: ble_wpts_c.c:403
uint32_t ble_wpts_c_write_ptu_static(ble_wpts_c_t *p_wpts_c, ptu_static_t *p_wpts_ptu_static)
Write the PTU Static characteristic to the PRU server.
Definition: ble_wpts_c.c:413
uint32_t ble_wpts_c_init(const ble_wpts_c_init_t *p_wpts_c_init)
Initialize the WPT Service Client.
Definition: ble_wpts_c.c:354
ble_gattc_handle_range_t service_handle_range
Definition: ble_wpts_c.h:59
pru_alert_t pru_alert
Definition: ble_wpts_c.h:52
PRU Alert Parameter structure.
Definition: wpt.h:145
void ble_wpts_char_handles_update(uint16_t prim_service_handle, ble_wpts_c_t *p_wpts_c)
Definition: ble_wpts_c.c:529
uint16_t pruc_handle
Definition: ble_wpts_c.h:60
void(* ble_wpts_c_evt_handler_t)(ble_wpts_c_t *p_wpts_c, ble_wpts_c_evt_t *p_evt)
WPT Service Client event handler type.
Definition: ble_wpts_c.h:70
Struct holding contents of "Service data AD type".
uint32_t ble_wpts_c_read_pru_dynamic(ble_wpts_c_t *p_wpts_c)
Read the PRU Dynamic characterisic value from the PRU server.
Definition: ble_wpts_c.c:408
uint16_t prua_cccd_handle
Definition: ble_wpts_c.h:63
pru_static_t pru_static
Definition: ble_wpts_c.h:50
ble_wpts_c_evt_type_t type
Definition: ble_wpts_c.h:46
PRU Static Parameter structure.
Definition: wpt.h:89
uint16_t prua_handle
Definition: ble_wpts_c.h:62
WPT Service Client init structure. This contains all options and data needed for initialization of th...
Definition: ble_wpts_c.h:74
WPT Service Client event.
Definition: ble_wpts_c.h:44
void ble_wpts_c_on_ble_evt(ble_wpts_c_t *p_wpts_c, ble_evt_t *p_ble_evt)
WPT Service Client BLE stack event handler.
Definition: ble_wpts_c.c:311
uint16_t ptusp_handle
Definition: ble_wpts_c.h:61
uint16_t prusp_handle
Definition: ble_wpts_c.h:64
pru_dynamic_t pru_dynamic
Definition: ble_wpts_c.h:51
uint16_t prudp_handle
Definition: ble_wpts_c.h:65
uint32_t ble_wpts_c_send_pru_control(ble_wpts_c_t *p_wpts_c, pru_control_t *p_wpts_pru_control)
Send a PRU Control message to the PRU server.
Definition: ble_wpts_c.c:366
PRU Dynamic Parameter structure.
Definition: wpt.h:164