思澈科技软件开发工具包  2.20

Data Service messages and types. More...

Data Structures

struct  data_callback_arg_tag
 
struct  data_subscribe_req_t
 Parameter for MSG_SERVICE_SUBSCRIBE_REQ. More...
 
struct  data_subscribe_rsp_t
 MSG_SERVICE_SUBSCRIBE_RSP body structure. More...
 
struct  data_req_t
 Parameter for other request messages. More...
 
struct  data_rsp_t
 Parameter for response messages. More...
 
struct  data_rdy_ind_t
 Parameter for MSG_SERVICE_DATA_RDY_IND. More...
 
struct  data_msg_t
 data service message structure type More...
 
struct  data_service_init_param_t
 

Functions

int datas_start (data_service_init_param_t *init_param)
 Start data service framework. More...
 
uint8_t * data_service_init_msg (data_msg_t *msg, uint16_t msg_id, uint16_t body_len)
 Initialize data service message. More...
 
uint8_t * data_service_get_msg_body (data_msg_t *msg)
 Get message body. More...
 
void data_service_entry (void *queue)
 service data process entry More...
 
void * data_service_get_thread (uint8_t ds_id)
 Get data service thread object. More...
 
enum  {
  MSG_SERVICE_SUBSCRIBE_REQ = 0x0,
  MSG_SERVICE_SUBSCRIBE_RSP = (0x8000) | MSG_SERVICE_SUBSCRIBE_REQ,
  MSG_SERVICE_UNSUBSCRIBE_REQ = 0x01,
  MSG_SERVICE_UNSUBSCRIBE_RSP = (0x8000) | MSG_SERVICE_UNSUBSCRIBE_REQ,
  MSG_SERVICE_CONFIG_REQ = 0x02,
  MSG_SERVICE_CONFIG_RSP = (0x8000) | MSG_SERVICE_CONFIG_REQ,
  MSG_SERVICE_TX_REQ = 0x03,
  MSG_SERVICE_TX_RSP = (0x8000) | MSG_SERVICE_TX_REQ,
  MSG_SERVICE_RX_REQ = 0x04,
  MSG_SERVICE_RX_RSP = (0x8000) | MSG_SERVICE_RX_REQ,
  MSG_SERVICE_PROXY_IND = 0x05,
  MSG_SERVICE_START_REQ = 0x06,
  MSG_SERVICE_START_RSP = (0x8000) | MSG_SERVICE_START_REQ,
  MSG_SERVICE_STOP_REQ = 0x07,
  MSG_SERVICE_STOP_RSP = (0x8000) | MSG_SERVICE_STOP_REQ,
  MSG_SERVICE_DATA_RDY_IND = 0x08,
  MSG_SERVICE_DATA_NTF_IND = (0x8000) | 0x09,
  MSG_SERVICE_PING_REQ = 0x0A,
  MSG_SERVICE_PING_RSP = (0x8000) | MSG_SERVICE_PING_REQ,
  MSG_SERVICE_SLEEP_REQ = 0x0B,
  MSG_SERVICE_SLEEP_RSP = (0x8000) | MSG_SERVICE_SLEEP_REQ,
  MSG_SERVICE_SYS_ID_END = 0x2F,
  MSG_SERVICE_CUSTOM_ID_BEGIN = MSG_SERVICE_SYS_ID_END + 1
}
 
typedef uint8_t datac_handle_t
 
typedef struct data_callback_arg_tag data_callback_arg_t
 
typedef int(* data_callback_t) (data_callback_arg_t *arg)
 
#define DATA_CLIENT_INVALID_HANDLE   (0)
 
#define GET_MSG_ID(msg_id)   ((~RSP_MSG_TYPE)&(msg_id))
 
#define IS_RSP_MSG(msg_id)   ((msg_id) & RSP_MSG_TYPE)
 
#define RSP_MSG_TYPE   (0x8000)
 
#define DATA_SVC_THREAD_MB   1
 
#define DATA_SVC_THREAD_PROC   2
 
#define SHORT_DATA_MSG_BODY_THRESHOLD   (12)
 

Detailed Description

Data Service messages and types.

Macro Definition Documentation

◆ DATA_CLIENT_INVALID_HANDLE

#define DATA_CLIENT_INVALID_HANDLE   (0)

Invalid data client handle

◆ DATA_SVC_THREAD_MB

#define DATA_SVC_THREAD_MB   1

Data service mailbox thread ID

◆ DATA_SVC_THREAD_PROC

#define DATA_SVC_THREAD_PROC   2

Data service internal process thread ID

Function Documentation

◆ data_service_entry()

void data_service_entry ( void *  queue)

service data process entry

Parameters
[in]queuequeue

◆ data_service_get_msg_body()

uint8_t* data_service_get_msg_body ( data_msg_t msg)

Get message body.

Parameters
[in]msgMessage pointer
Return values
Pointerto message body.

◆ data_service_get_thread()

void* data_service_get_thread ( uint8_t  ds_id)

Get data service thread object.

Parameters
[in]ds_idservice id, see DATA_SVC_THREAD_XXX
Return values
RTOSThread object, currently type of rt_thread_t.

◆ data_service_init_msg()

uint8_t* data_service_init_msg ( data_msg_t msg,
uint16_t  msg_id,
uint16_t  body_len 
)

Initialize data service message.

Parameters
[in,out]msgMessage pointer to be initialized
[in]msg_idMessage id
[in]body_lenSize of message body
Return values
Pointerto message body.

◆ datas_start()

int datas_start ( data_service_init_param_t init_param)

Start data service framework.

Return values
success0. failure: other value