Files

54 lines
1.6 KiB
C

#ifndef BS_CONNECT_IMPL_H
#define BS_CONNECT_IMPL_H
#ifdef __cplusplus /*C++编译环境下兼容C语言*/
extern "C" {
#endif
/*------ Exported includes(头文件) ----------------------*/
#include "main.h"
#include "publicdata/publicdata.h"
#include "plat_comm/plat_comm_task.h"
#if EC200A_4G_EN
#include "plat_comm/4g_module/ec200a_4g.h"
#endif
#if WH_GM5_EN
#include "plat_comm/4g_module/bs_wh_gm5.h"
#endif
/*------ Exported macro(宏定义) -------------------------*/
/** 4G 套接字分发接收回调:id=平台序号,buf/len=有效载荷 */
typedef void (*RecvUnpackHandler)(U8_T id, U8_T *buf, U16_T len);
/*------ Exported struct(结构体定义) --------------------*/
typedef struct {
char host[NUM_64];
int port;
char path[NUM_64];
char apn_str[NUM_32];
int is_secure; /* 0=ws, 1=wss */
} ws_url_t;
/*------ Exported variables(变量定义) -------------------*/
/*------ Exported function prototypes (函数声明) -------*/
void v_bs_4G_data_init(void);
U8_T u8_tcp_connect(U8_T u8_id);
/** 网口:关闭指定通道 socket 并清零 fd/u8_TCP_connect_flag,重连前必须调用,避免 socket 泄漏导致“再连也连不上” */
void v_bs_eth_close_socket(U8_T u8_id);
void v_bs_send(U8_T u8_id,U8_T *u8_sendBuf,U16_T u16_len);
U16_T u16_bs_recv(U8_T u8_id,U8_T *u8_recvBuf,U16_T u16_len);
void v_4g_wh5_data_divide_recv(RecvUnpackHandler socketA_unPack, RecvUnpackHandler socketB_unPack);
int parse_websocket_url_simple(const char* url, ws_url_t* result) ;
#ifdef __cplusplus
}
#endif
#endif /* BS_CONNECT_IMPL_H */