62 #include "ble_srv_common.h"
63 #include "app_util_platform.h"
67 #define BLE_UUID_TCS_SERVICE 0x0100
68 #define BLE_TCS_MAX_DATA_LEN (GATT_MTU_SIZE_DEFAULT - 3)
70 #define BLE_TCS_DEVICE_NAME_LEN_MAX 10
71 #define BLE_TCS_BEACON_LEN_MAX 17
72 #define BLE_TCS_BEACON_LEN_MIN 3
73 #define BLE_TCS_CLOUD_LEN_MAX 250
74 #define BLE_TCS_CLOUD_LEN_MIN 0
81 #define PACKED(TYPE) TYPE __attribute__ ((packed))
84 typedef PACKED(
struct
86 uint8_t name[BLE_TCS_DEVICE_NAME_LEN_MAX+1];
88 }) ble_tcs_dev_name_t;
90 typedef PACKED(
struct
94 }) ble_tcs_adv_params_t;
96 #define TCS_ADV_PARAMS_INTERVAL_MIN 32UL
97 #define TCS_ADV_PARAMS_INTERVAL_MAX 8000UL
98 #define TCS_ADV_PARAMS_TIMEOUT_MIN 0UL
99 #define TCS_ADV_PARAMS_TIMEOUT_MAX 180UL
101 typedef uint16_t ble_tcs_appear_t;
103 typedef PACKED(
struct
105 uint16_t min_conn_int;
106 uint16_t max_conn_int;
107 uint16_t slave_latency;
108 uint16_t sup_timeout;
109 }) ble_tcs_conn_params_t;
111 typedef PACKED(
struct
113 uint8_t data[BLE_TCS_BEACON_LEN_MAX];
115 }) ble_tcs_eddystone_url_t;
117 typedef PACKED(
struct
119 uint8_t token[BLE_TCS_CLOUD_LEN_MAX];
121 }) ble_tcs_cloud_token_t;
123 typedef PACKED(
struct
128 }) ble_tcs_fw_version_t;
130 typedef PACKED(
struct
136 #define TCS_MTU_REQ_EXCHANGE 0x01
137 #define TCS_MTU_REQ_MIN 0UL
138 #define TCS_MTU_REQ_MAX 1UL
139 #define TCS_MTU_SIZE_MIN 23UL
140 #define TCS_MTU_SIZE_MAX 276UL
144 ble_tcs_dev_name_t dev_name;
145 ble_tcs_adv_params_t adv_params;
146 ble_tcs_conn_params_t conn_params;
147 ble_tcs_eddystone_url_t eddystone_url;
148 ble_tcs_cloud_token_t cloud_token;
149 ble_tcs_fw_version_t fw_version;
155 BLE_TCS_EVT_DEV_NAME,
156 BLE_TCS_EVT_ADV_PARAM,
157 BLE_TCS_EVT_CONN_PARAM,
159 BLE_TCS_EVT_CLOUD_TOKEN,
168 ble_tcs_evt_type_t evt_type,
179 ble_tcs_params_t * p_init_vals;
194 ble_gatts_char_handles_t beacon_handles;
195 ble_gatts_char_handles_t cloud_handles;
196 ble_gatts_char_handles_t fwv_handles;
197 ble_gatts_char_handles_t mtu_handles;
237 #endif // BLE_TCS_H__