4G_module/custom/jt808/inc/jt808_pkg_transmit.h

33 lines
795 B
C
Raw Normal View History

#ifndef _JT808_PKG_TRANSMIT_H_
#define _JT808_PKG_TRANSMIT_H_
#include "jt808_msg_pkg.h"
#include "jt808_msg_parse.h"
#include "jt808_config.h"
#include "tcp_client.h"
// #pragma pack(1)
typedef struct{
uint16_t msg_id;
uint32_t timeout; //超时时间单位ms
}pkg_msg_t;
// #pragma pack()
// 原型 int tcp_client_send(const char *buf, int len);
#ifdef __TCP_CLIENT_H__
#define PKG_SEND(__buf, __len) tcp_client_send(__buf, __len)
#else
#define PKG_SEND(__buf, __len) 0
#endif
extern PrsResult_t PrsResult;
// 触发消息发送
int jt808_pkg_send(MessageID_t Msg_ID, uint32_t timeout);
// 接收处理 (放入TCP接收回调中)
void jt808_pkg_handle(uint8_t *receive_buf, uint16_t receive_len);
// jt808协议初始化
int jt808_init(void);
#endif // _JT808_PKG_TRANSMIT_H_