Classes | Macros | Typedefs | Enumerations | Functions
thscps.h File Reference

Throughput Control Point Service API. More...

`#include "ble_prf_types.h"`
`#include "gr_includes.h"`
`#include "custom_config.h"`
Include dependency graph for thscps.h:

Go to the source code of this file.

## Classes
struct | thscps_setting_t
| THS Setting Information value. More...
struct | thscps_test_info_t
| THS Test Information value. More...
struct | thscps_test_conn_info_t
| THS connect Information value. More...
struct | thscps_adv_param_t
| THS Control Point Advertising Parameters. More...
struct | thscps_rsp_val_t
| THS Control Point Response value. More...
struct | thscps_evt_t
| THS Control Point Service event. More...

## Macros
#define | THSCPS_CONNECTION_MAX 10
| Maximum number of THSCPS connections. More...
#define | THSCPS_CTRL_PT_VAL_LEN 20
| Length of the value of Control Point characteristic. More...
#define | THSCPS_TEST_SETTING_VAL_LEN 20
| Length of the value of Test Setting characteristic. More...
#define | THSCPS_TEST_INFO_VAL_LEN 20
| Length of the value of Test Information characteristic. More...
#define | THSCPS_CONN_INFO_VAL_LEN 20
| Length of the value of Connection Information characteristic. More...
#define | THSCPS_SERVICE_UUID
| The UUID of THS Control Point Control Point Service for setting advertising data. More...
#define | THSCPS_ACTION_ON 0x01
| Start the action. More...
#define | THSCPS_ACTION_OFF 0x00
| Stop the action. More...
#define | THSCPS_CTRL_PT_RSP_CODE 0xff
| Response code. More...

## Typedefs
typedef void(* | thscps_evt_handler_t) (thscps_evt_t *p_evt)
| THS Control Point Service event handler type. More...

## Enumerations
enum | thscps_test_role_t { THSCPS_TEST_ROLE_INVALID, THSCPS_TEST_ROLE_SLAVE, THSCPS_TEST_ROLE_MASTER }
| Local device GAP Role Type. More...
enum | thscps_adv_phy_t { THSCPS_LEGACY_ADV_PHY, THSCPS_1MBPS_PHY, THSCPS_CODED_PHY }
| Specify PHY. More...
enum | thscps_test_state_t { THSCPS_TEST_STOP, THSCPS_TEST_STARTED }
| Throughput Test State. More...
enum | thscps_ctrl_pt_id_t { THSCPS_CTRL_PT_INVALID, THSCPS_CTRL_PT_TEST_ROLE, THSCPS_CTRL_PT_ADV_PARAM, THSCPS_CTRL_PT_ADV_ACTION, THSCPS_CTRL_PT_SCAN_ACTION, THSCPS_CTRL_PT_TEST_READY, THSCPS_CTRL_PT_SETTING }
| THS Control Point Service Control Point IDs. More...
enum | thscps_settings_type_t { THSCPS_SETTINGS_TYPE_CI, THSCPS_SETTINGS_TYPE_MTU, THSCPS_SETTINGS_TYPE_PDU, THSCPS_SETTINGS_TYPE_PHY, THSCPS_SETTINGS_TYPE_TRANS_MODE, THSCPS_SETTINGS_TYPE_TX_POWER, THSCPS_SETTINGS_TYPE_TOGGLE }
| Throughput service settings types. More...
enum | thscps_status_rsp_t { THSCPS_RSP_ID_SUCCESS, THSCPS_RSP_ID_UNSUPPORT, THSCPS_RSP_ID_STATUS_ERR, THSCPS_RSP_ID_PARAM_ERR, THSCPS_RSP_ID_TEST_ROLE_ERR, THSCPS_RSP_ID_SDK_ERR }
| THS Control Point Response Types. More...
enum | thscps_evt_type_t { THSCPS_EVT_INVALID, THSCPS_EVT_CTRL_PT_IND_ENABLE, THSCPS_EVT_CTRL_PT_IND_DISABLE, THSCPS_EVT_TSET_SET_NTF_ENABLE, THSCPS_EVT_TSET_SET_NTF_DISABLE, THSCPS_EVT_TSET_INFO_NTF_ENABLE, THSCPS_EVT_TSET_INFO_NTF_DISABLE, THSCPS_EVT_CONN_INFO_NTF_ENABLE, THSCPS_EVT_CONN_INFO_NTF_DISABLE, THSCPS_EVT_TEST_ROLE_SET, THSCPS_EVT_ADV_PRAM_SET, THSCPS_EVT_ADV_ACTION, THSCPS_EVT_SCAN_ACTION, THSCPS_EVT_SETTING_SET }
| THS Control Point Service Event Type. More...

## Functions
sdk_err_t | thscps_service_init (thscps_evt_handler_t evt_handler)
| Initialize a THS Control Point Service instance and add in the DB. More...
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. More...
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. More...
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. More...
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. More...
void | thscps_test_state_set (thscps_test_state_t test_state)
| Set throughput state set. More...

## Detailed Description

Throughput Control Point Service API.

Attention

  ##### Copyright (c) 2019 GOODIX

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file thscps.h.