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

Device Synchronize Service API. More...

`#include "gr_includes.h"`
`#include "custom_config.h"`
`#include <stdint.h>`
Include dependency graph for dss.h:

Go to the source code of this file.

## Classes
struct | dss_evt_t
| Device Synchronize Service Synchronize event. More...

## Macros
#define | DSS_SERVICE_UUID
| DSS service UUID. More...
#define | DSS_CONNECTION_MAX 10
| Maximum number of DSS connections. More...
#define | DSS_ROLE_VALUE_LEN 1
| Length of Role characteristic value. More...
#define | DSS_EVT_CNT_VALUE_LEN 4
| Length of Event Count characteristic value. More...
#define | DSS_EVT_PERIOD_VALUE_LEN 2
| Length of Event Period characteristic value. More...
#define | DSS_STATUS_VALUE_LEN 1
| Length of Status characteristic value. More...
#define | DSS_CTRL_PT_VALUE_LEN 7
| Length of Control Point characteristic value. More...
#define | DSS_CTRL_PT_RSP_VAL_LEN 3
| Length of Control Point Response characteristic value. More...
#define | DSS_SYNC_DEV_MAX_NUM 5
| Maximun num of Source Sync Device. More...
#define | DSS_CFG_ADV_IDX 0
| DSS Config Advertising Index. More...
#define | DSS_SYNC_ADV_IDX 1
| DSS Sync Advertising Index. More...

## Typedefs
typedef void(* | dss_evt_handler_t) (dss_evt_t *p_evt)
| Device Synchronize Service event handler type. More...

## Enumerations
enum | dss_role_t { DSS_ROLE_SYNC_INVALID, DSS_ROLE_SYNC_SOURCE, DSS_ROLE_SYNC_DEVICE }
| Device Synchronize Service roles. More...
enum | dss_staus_t { DSS_STATUS_CFG_READY, DSS_STATUS_IN_ADV, DSS_STATUS_IN_SCAN, DSS_STATUS_IN_INITIATING }
| Device Synchronize Service status. More...
enum | dss_op_id_t { DSS_OP_ID_INVALID, DSS_OP_ID_ROLE_SET, DSS_OP_ID_SYNC_SRC_CREATE, DSS_OP_ID_SYNC, DSS_OP_ID_CANCEL_SYNC, DSS_OP_ID_LP_ENTER, DSS_OP_ID_SYNC_DESTROY, DSS_OP_ID_RSP = 0xff }
| Device Synchronize Service control point OP IDs. More...
enum | dss_rsp_id_t { DSS_RSP_ID_SUCCESS, DSS_RSP_ID_UNSUPPORT, DSS_RSP_ID_DISALLOWED, DSS_RSP_ID_STATUS_ERR, DSS_RSP_ID_PARAM_ERR, DSS_RSP_ID_ROLE_ERR, DSS_RSP_ID_NO_HANDLER, DSS_RSP_ID_ADV_START_FAIL, DSS_RSP_ID_ADV_TIMEOUT, DSS_RSP_ID_SCAN_START_FAIL, DSS_RSP_ID_SCAN_TIMEOUT, DSS_RSP_ID_CONN_EST_FAIL, DSS_RSP_ID_CREATE_SRC_FAIL, DSS_RSP_ID_DISTR_SRC_FAIL, DSS_RSP_ID_DESTROY_SRC_FAIL, DSS_RSP_ID_ENTER_LP_FAIL, DSS_RSP_ID_CANCEL_SYNC_FAIL }
| Device Synchronize Service control point response IDs. More...
enum | dss_evt_type_t { DSS_EVT_INVALID, DSS_EVT_SOURCE_ROLE_SET, DSS_EVT_DEVICE_ROLE_SET, DSS_EVT_SYNC_SRC_CREATE, DSS_EVT_SYNC_DESTROY, DSS_EVT_SYNC_OCCUR, DSS_EVT_SYNC_SELF_OR_PEER, DSS_EVT_SYNC_CANCEL, DSS_EVT_LP_ENTER }
| Device Synchronize Service event types. More...

## Functions
sdk_err_t | dss_service_init (dss_evt_handler_t evt_handler)
| Initialize a Device Synchronize Service instance and add in the database. More...
sdk_err_t | dss_sync_op_result_send (uint8_t conn_idx, dss_evt_type_t evt_type, dss_rsp_id_t rsp_id)
| Send Control Point Response. More...
void | dss_sync_src_distribute (uint8_t conn_idx)
| Distribute sync source to peer. More...
void | dss_set_status (uint8_t conn_idx, dss_staus_t status)
| Set dss status. More...
void | dss_set_sync_params (uint8_t conn_idx, bool is_auto_enter_lp, bool is_auto_calib_drift)
| Set Sync params. More...
void | dss_set_lp_mode (uint8_t conn_idx, bool is_in_lp_mode)
| Set Device whether in low power mode. More...

## Detailed Description

Device Synchronize 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 dss.h.