Go to the documentation of this file.
63 #include "custom_config.h"
70 #define DSS_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
71 10 : CFG_MAX_CONNECTIONS)
72 #define DSS_ROLE_VALUE_LEN 1
73 #define DSS_EVT_CNT_VALUE_LEN 4
74 #define DSS_EVT_PERIOD_VALUE_LEN 2
75 #define DSS_STATUS_VALUE_LEN 1
76 #define DSS_CTRL_PT_VALUE_LEN 7
77 #define DSS_CTRL_PT_RSP_VAL_LEN 3
79 #define DSS_SYNC_DEV_MAX_NUM 5
80 #define DSS_CFG_ADV_IDX 0
81 #define DSS_SYNC_ADV_IDX 1
dss_rsp_id_t
Device Synchronize Service control point response IDs.
Definition: dss.h:120
@ DSS_RSP_ID_SCAN_START_FAIL
Scan start fail.
Definition: dss.h:130
void dss_set_sync_params(uint8_t conn_idx, bool is_auto_enter_lp, bool is_auto_calib_drift)
Set Sync params.
dss_role_t
Device Synchronize Service roles.
Definition: dss.h:90
@ DSS_RSP_ID_ADV_TIMEOUT
Advertising start timeout.
Definition: dss.h:129
@ DSS_EVT_SOURCE_ROLE_SET
Source Role set event.
Definition: dss.h:145
@ DSS_OP_ID_CANCEL_SYNC
Cancel Synchronization op id.
Definition: dss.h:112
@ DSS_ROLE_SYNC_SOURCE
Device synchronize source role (Create synchronize source and distribute).
Definition: dss.h:92
@ DSS_RSP_ID_ROLE_ERR
Role error.
Definition: dss.h:126
@ DSS_EVT_SYNC_SRC_CREATE
Sync source create event.
Definition: dss.h:147
@ DSS_ROLE_SYNC_DEVICE
Device synchronize deivce role.
Definition: dss.h:93
dss_evt_type_t evt_type
Event type.
Definition: dss.h:163
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.
@ DSS_RSP_ID_DISALLOWED
Disallowed op.
Definition: dss.h:123
@ DSS_RSP_ID_STATUS_ERR
Status error.
Definition: dss.h:124
void(* dss_evt_handler_t)(dss_evt_t *p_evt)
Device Synchronize Service event handler type.
Definition: dss.h:176
@ DSS_EVT_SYNC_CANCEL
Cancel Synchronization event.
Definition: dss.h:151
bool is_enter_lp_mode
In Low Power Mode flag.
Definition: dss.h:167
@ DSS_RSP_ID_ENTER_LP_FAIL
Enter Low Power Mode fail.
Definition: dss.h:136
@ DSS_STATUS_IN_INITIATING
Device is in initiating.
Definition: dss.h:102
@ DSS_EVT_SYNC_DESTROY
Destroy sync event.
Definition: dss.h:148
@ DSS_OP_ID_SYNC_DESTROY
Destroy sync.
Definition: dss.h:114
uint8_t conn_idx
Connect index.
Definition: dss.h:164
dss_op_id_t
Device Synchronize Service control point OP IDs.
Definition: dss.h:107
Device Synchronize Service Synchronize event.
Definition: dss.h:162
@ DSS_RSP_ID_ADV_START_FAIL
Advertising start fail.
Definition: dss.h:128
@ DSS_OP_ID_RSP
Response op id.
Definition: dss.h:115
dss_staus_t
Device Synchronize Service status.
Definition: dss.h:98
sdk_err_t dss_service_init(dss_evt_handler_t evt_handler)
Initialize a Device Synchronize Service instance and add in the database.
uint8_t sync_dev_num
Synchronize Device num.
Definition: dss.h:166
@ DSS_RSP_ID_NO_HANDLER
No handler for op.
Definition: dss.h:127
@ DSS_STATUS_IN_SCAN
Device is in scanning.
Definition: dss.h:101
@ DSS_EVT_LP_ENTER
Enter low power event.
Definition: dss.h:152
@ DSS_EVT_DEVICE_ROLE_SET
Device Role set event.
Definition: dss.h:146
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:243
@ DSS_OP_ID_ROLE_SET
Set role op id.
Definition: dss.h:109
@ DSS_ROLE_SYNC_INVALID
Device synchronize invalid role.
Definition: dss.h:91
void dss_set_lp_mode(uint8_t conn_idx, bool is_in_lp_mode)
Set Device whether in low power mode.
@ DSS_RSP_ID_PARAM_ERR
Parameter error.
Definition: dss.h:125
@ DSS_RSP_ID_SCAN_TIMEOUT
Scan start timeout.
Definition: dss.h:131
void dss_set_status(uint8_t conn_idx, dss_staus_t status)
Set dss status.
@ DSS_STATUS_IN_ADV
Device is in advertising.
Definition: dss.h:100
@ DSS_RSP_ID_CONN_EST_FAIL
Connection establish fail.
Definition: dss.h:132
@ DSS_OP_ID_SYNC_SRC_CREATE
Create synchronize source op id.
Definition: dss.h:110
@ DSS_EVT_INVALID
Invalid event.
Definition: dss.h:144
@ DSS_RSP_ID_CREATE_SRC_FAIL
Create source fail.
Definition: dss.h:133
@ DSS_STATUS_CFG_READY
Device is ready for config,.
Definition: dss.h:99
@ DSS_OP_ID_LP_ENTER
Enter low power mode(Stop all ble activity).
Definition: dss.h:113
@ DSS_EVT_SYNC_SELF_OR_PEER
Synchronize self or peer event.
Definition: dss.h:150
void dss_sync_src_distribute(uint8_t conn_idx)
Distribute sync source to peer.
@ DSS_EVT_SYNC_OCCUR
Sync occur event.
Definition: dss.h:149
dss_evt_type_t
Device Synchronize Service event types.
Definition: dss.h:143
@ DSS_OP_ID_SYNC
Synchronize self or peer op id.
Definition: dss.h:111
@ DSS_RSP_ID_SUCCESS
Success.
Definition: dss.h:121
@ DSS_RSP_ID_DESTROY_SRC_FAIL
Destroy source fail.
Definition: dss.h:135
@ DSS_RSP_ID_DISTR_SRC_FAIL
Distribute source fail.
Definition: dss.h:134
@ DSS_OP_ID_INVALID
Invalid op id.
Definition: dss.h:108
@ DSS_RSP_ID_UNSUPPORT
Unsupport op.
Definition: dss.h:122
uint32_t sync_cnt
Synchronize count.
Definition: dss.h:165
@ DSS_RSP_ID_CANCEL_SYNC_FAIL
Cancel Synchronization fail.
Definition: dss.h:137