Initial commit: CCU621_M firmware project with BLE debug link support.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-08 17:28:36 +08:00
commit 9ceb218f80
1597 changed files with 724159 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
#ifndef _BS_WEBSOCKET_H_
#define _BS_WEBSOCKET_H_
#include "publicdata/type.h"
#include "publicdata/public_define.h"
#include <string.h>
#include <stdio.h>
#if BS_OCPP_EN //OCPP平台使能
#define OCPP_WEBSOCKET_EN 1
/** WebSocket HTTP 握手是否携带 Authorization: Basic(桩号:密钥);0=不携带,适用于不要求 HTTP Basic 的平台 */
#ifndef OCPP_WS_HTTP_AUTHORIZATION_EN
#define OCPP_WS_HTTP_AUTHORIZATION_EN 1
#endif
/** GET 路径是否在桩号后加尾斜杠;PLN 等为 /wsspkludev/CPID(默认 0,桩号后无 / */
#ifndef OCPP_WS_GET_PATH_TRAILING_SLASH
#define OCPP_WS_GET_PATH_TRAILING_SLASH 0
#endif
typedef enum
{
WDT_NULL = 0, // 非标准数据包
WDT_MINDATA, // 0x0:中间数据包
WDT_TXTDATA, // 0x1txt类型数据包
WDT_BINDATA, // 0x2bin类型数据包
WDT_DISCONN, // 0x8:断开连接类型数据包 收到后需手动 close(fd)
WDT_PING, // 0x8ping类型数据包 ws_recv 函数内自动回复pong
WDT_PONG, // 0xApong类型数据包
} Ws_DataType;
int websocket_build();
void ocpp_recv();
int ws_send(void* buff, int buffLen, bool mask, Ws_DataType type);
#endif
#endif