ths.h File Reference

Throughput Service API. More...

#include "gr_includes.h"
#include "custom_config.h"
#include <stdint.h>
+ Include dependency graph for ths.h:

Go to the source code of this file.

Classes

struct  ths_evt_t
 Throughput Service event. More...
 
struct  ths_init_t
 Throughput Service init stucture. More...
 

Macros

#define THS_CONNECTION_MAX   10
 Maximum number of Throughput Service connections. More...
 
#define THS_MAX_DATA_LEN   512
 Maximum length of the value of Rx or Tx characteristic. More...
 
#define THS_SERVICE_UUID
 The UUID of Throughput Service for setting advertising data. More...
 

Typedefs

typedef void(* ths_evt_handler_t) (ths_evt_t *p_evt)
 Throughput Service event handler type. More...
 

Enumerations

enum  ths_transport_mode_t { THS_SLAVE_NOTIFY_MODE, THS_MASTER_WRITE_MODE, THS_DOUBLE_MODE }
 Throughput data transport mode. More...
 
enum  ths_evt_type_t {
  THS_EVT_INVALID, THS_EVT_DATA_RECEIVED, THS_EVT_DATA_SENT, THS_EVT_SETTINGS_CHANGED,
  THS_EVT_TOGGLE_SET
}
 Throughput Service event type. More...
 
enum  ths_toggle_state_t { THS_TOGGLE_STATE_OFF, THS_TOGGLE_STATE_ON }
 Throughput toggle state of sending the data. More...
 
enum  ths_settings_type_t {
  THS_SETTINGS_TYPE_CI, THS_SETTINGS_TYPE_MTU, THS_SETTINGS_TYPE_PDU, THS_SETTINGS_TYPE_PHY,
  THS_SETTINGS_TYPE_TRANS_MODE, THS_SETTINGS_TYPE_TX_POWER, THS_SETTINGS_TYPE_RANGING_PARAM
}
 Throughput service settings types. More...
 

Functions

sdk_err_t ths_service_init (ths_init_t *p_ths_init)
 Initialize a Throughput Service instance and add in the DB. More...
 
sdk_err_t ths_data_send (uint8_t conn_idx, uint8_t *p_data, uint16_t length)
 Send data to peer device. More...
 
sdk_err_t ths_settings_notify (uint8_t conn_idx, uint8_t *p_settings, uint16_t length)
 Notify the peer device of the change of settings. More...
 
ths_transport_mode_t ths_transport_mode_get (void)
 Get current transport mode of device. More...
 

Detailed Description

Throughput 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 ths.h.