Go to the documentation of this file.
62 #include "custom_config.h"
68 #define THSCPS_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
69 10 : CFG_MAX_CONNECTIONS)
70 #define THSCPS_CTRL_PT_VAL_LEN 20
71 #define THSCPS_TEST_SETTING_VAL_LEN 20
72 #define THSCPS_TEST_INFO_VAL_LEN 20
73 #define THSCPS_CONN_INFO_VAL_LEN 20
74 #define THSCPS_SERVICE_UUID 0x1B, 0xD7, 0x90, 0xEC, 0xE8, 0xB9, 0x75, 0x80,\
75 0x0A, 0x46, 0x44, 0xD3, 0x01, 0x07, 0xED, 0xA6
76 #define THSCPS_ACTION_ON 0x01
77 #define THSCPS_ACTION_OFF 0x00
78 #define THSCPS_CTRL_PT_RSP_CODE 0xff
118 THSCPS_CTRL_PT_SETTING,
@ THSCPS_EVT_CTRL_PT_IND_ENABLE
THS Control Point indicaiton is enabled.
Definition: thscps.h:148
thscps_setting_t setting_info
Setting infomation.
Definition: thscps.h:224
sdk_err_t thscps_conn_info_send(uint8_t conn_idx, thscps_test_conn_info_t *p_conn_info)
Send Throughput Test Connect Information if its notification has been enabled.
int8_t tx_power
Advertising tx power.
Definition: thscps.h:203
uint16_t duration
Advertising duration.
Definition: thscps.h:202
@ THSCPS_TEST_ROLE_MASTER
Test role: Master.
Definition: thscps.h:90
sdk_err_t thscps_service_init(thscps_evt_handler_t evt_handler)
Initialize a THS Control Point Service instance and add in the DB.
@ THSCPS_LEGACY_ADV_PHY
Undefined LE PHY.
Definition: thscps.h:97
thscps_adv_phy_t
Specify PHY.
Definition: thscps.h:96
const uint8_t * p_data
THS Setting Information data.
Definition: thscps.h:172
@ THSCPS_EVT_TSET_INFO_NTF_ENABLE
THS Test Information notification is enabled.
Definition: thscps.h:152
uint8_t right_rate
RX right rate.
Definition: thscps.h:179
uint16_t interval
Advertising interval.
Definition: thscps.h:201
THS Control Point Service event.
Definition: thscps.h:216
@ THSCPS_SETTINGS_TYPE_PHY
Radio Phy mode, 1M, 2M, Encoded.
Definition: thscps.h:127
@ THSCPS_CTRL_PT_SCAN_ACTION
Scan action.
Definition: thscps.h:116
thscps_test_state_t
Throughput Test State.
Definition: thscps.h:104
sdk_err_t thscps_test_setting_rsp_send(uint8_t conn_idx, thscps_rsp_val_t *p_rsp_val)
Send Settings Response if its notification has been enabled.
uint16_t ci
Connect Interval.
Definition: thscps.h:188
@ THSCPS_EVT_TSET_SET_NTF_DISABLE
THS Test Information notification is disabled.
Definition: thscps.h:151
thscps_test_role_t test_role
GAP role type.
Definition: thscps.h:222
THS connect Information value.
Definition: thscps.h:187
thscps_adv_param_t adv_param
Advertising parameters.
Definition: thscps.h:223
sdk_err_t thscps_ctrl_pt_rsp_send(uint8_t conn_idx, thscps_rsp_val_t *p_rsp_val)
Send Control Point Response if its indicaiton has been enabled.
@ THSCPS_1MBPS_PHY
LE 1M PHY.
Definition: thscps.h:98
void thscps_test_state_set(thscps_test_state_t test_state)
Set throughput state set.
int8_t rssi
RX rssi.
Definition: thscps.h:178
@ THSCPS_EVT_TEST_ROLE_SET
Set Test role.
Definition: thscps.h:156
thscps_status_rsp_t status
Status.
Definition: thscps.h:210
@ THSCPS_EVT_ADV_PRAM_SET
Set advertising parameters.
Definition: thscps.h:157
@ THSCPS_RSP_ID_SDK_ERR
Failed becaude of SDK error Size.
Definition: thscps.h:141
thscps_status_rsp_t
THS Control Point Response Types.
Definition: thscps.h:135
@ THSCPS_SETTINGS_TYPE_PDU
PDU Size.
Definition: thscps.h:126
THS Control Point Advertising Parameters.
Definition: thscps.h:199
@ THSCPS_SETTINGS_TYPE_TX_POWER
Connect Tx power.
Definition: thscps.h:129
sdk_err_t thscps_test_info_send(uint8_t conn_idx, thscps_test_info_t *p_test_info)
Send Throughput Test Information if its notification has been enabled.
THS Test Information value.
Definition: thscps.h:177
uint16_t length
THS Setting Information length.
Definition: thscps.h:171
uint16_t average_val
Average throughput value.
Definition: thscps.h:181
@ THSCPS_RSP_ID_STATUS_ERR
Failed because of disallowed status.
Definition: thscps.h:138
@ THSCPS_RSP_ID_PARAM_ERR
Failed because of parameter error.
Definition: thscps.h:139
uint8_t action_set
Set action.
Definition: thscps.h:221
@ THSCPS_SETTINGS_TYPE_CI
BLE Connection Interval parameter.
Definition: thscps.h:124
uint16_t instant_val
Instant throughput value.
Definition: thscps.h:180
@ THSCPS_CTRL_PT_TEST_READY
Ready for test.
Definition: thscps.h:117
@ THSCPS_RSP_ID_SUCCESS
Success.
Definition: thscps.h:136
@ THSCPS_EVT_SCAN_ACTION
Set scan action.
Definition: thscps.h:159
uint16_t mtu
MTU.
Definition: thscps.h:190
THS Setting Information value.
Definition: thscps.h:170
Profile/Service Common Types.
@ THSCPS_CTRL_PT_TEST_ROLE
Test role set.
Definition: thscps.h:113
@ THSCPS_EVT_TSET_INFO_NTF_DISABLE
THS Test Information notification is disabled.
Definition: thscps.h:153
thscps_settings_type_t
Throughput service settings types.
Definition: thscps.h:123
@ THSCPS_EVT_CONN_INFO_NTF_ENABLE
THS Connection Information notification is enabled.
Definition: thscps.h:154
@ THSCPS_CODED_PHY
LE Coded PHY.
Definition: thscps.h:99
thscps_evt_type_t
THS Control Point Service Event Type.
Definition: thscps.h:146
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:243
thscps_test_role_t
Local device GAP Role Type.
Definition: thscps.h:87
@ THSCPS_EVT_SETTING_SET
Throughput setting.
Definition: thscps.h:160
@ THSCPS_RSP_ID_UNSUPPORT
Failed because of unsupport command.
Definition: thscps.h:137
uint8_t ths_mode
THS Mode.
Definition: thscps.h:194
thscps_adv_phy_t phy
Specify what PHY the Controller has changed for TX/RX.
Definition: thscps.h:200
uint8_t rx_phy
RX PHY.
Definition: thscps.h:192
@ THSCPS_EVT_CTRL_PT_IND_DISABLE
THS Control Point indicaiton is disabled.
Definition: thscps.h:149
@ THSCPS_RSP_ID_TEST_ROLE_ERR
Failed becaude of Test role error.
Definition: thscps.h:140
@ THSCPS_CTRL_PT_ADV_PARAM
Advertising parameters set.
Definition: thscps.h:114
@ THSCPS_SETTINGS_TYPE_TRANS_MODE
Data transmission mode.
Definition: thscps.h:128
uint8_t tx_phy
TX PHY.
Definition: thscps.h:191
int8_t tx_power
TX Power.
Definition: thscps.h:193
uint8_t conn_idx
Connection of cmd set.
Definition: thscps.h:211
thscps_ctrl_pt_id_t
THS Control Point Service Control Point IDs.
Definition: thscps.h:111
@ THSCPS_EVT_TSET_SET_NTF_ENABLE
THS Test Information notification is enabled.
Definition: thscps.h:150
@ THSCPS_CTRL_PT_INVALID
Invalid cmd id.
Definition: thscps.h:112
thscps_evt_type_t evt_type
THS client event type.
Definition: thscps.h:218
@ THSCPS_TEST_STOP
Throughput Test is not ongoing.
Definition: thscps.h:105
void(* thscps_evt_handler_t)(thscps_evt_t *p_evt)
THS Control Point Service event handler type.
Definition: thscps.h:234
uint8_t conn_idx
The connection index.
Definition: thscps.h:217
@ THSCPS_SETTINGS_TYPE_TOGGLE
Throughput toggle state of sending the data.
Definition: thscps.h:130
@ THSCPS_SETTINGS_TYPE_MTU
MTU Size.
Definition: thscps.h:125
@ THSCPS_TEST_ROLE_SLAVE
Test role: Slave.
Definition: thscps.h:89
uint16_t pdu
PDU.
Definition: thscps.h:189
@ THSCPS_EVT_CONN_INFO_NTF_DISABLE
THS Connection Information notification is disabled.
Definition: thscps.h:155
@ THSCPS_CTRL_PT_ADV_ACTION
Advertiding action.
Definition: thscps.h:115
THS Control Point Response value.
Definition: thscps.h:208
uint16_t packets_val
Recieved Packects value.
Definition: thscps.h:182
@ THSCPS_EVT_INVALID
Throughput Control Point Service invalid event.
Definition: thscps.h:147
uint8_t cmd_id
Commander ID.
Definition: thscps.h:209
@ THSCPS_EVT_ADV_ACTION
Set advertising action.
Definition: thscps.h:158
@ THSCPS_TEST_ROLE_INVALID
Test role: Invalid.
Definition: thscps.h:88
@ THSCPS_TEST_STARTED
Throughput Test is ongoing.
Definition: thscps.h:106