31 lines
838 B
C
31 lines
838 B
C
|
|
|
||
|
|
#ifndef __CHARGERTASK_H
|
||
|
|
#define __CHARGERTASK_H
|
||
|
|
|
||
|
|
/* includes ----------------------------------------------------------------------------------------------*/
|
||
|
|
#include "global.h"
|
||
|
|
#include "lwip/opt.h"
|
||
|
|
#include "lwip/api.h"
|
||
|
|
#include "lwip/sys.h"
|
||
|
|
|
||
|
|
/* macro ------------------------------------------------------------------------------------------------*/
|
||
|
|
|
||
|
|
/* struct ------------------------------------------------------------------------------------------------*/
|
||
|
|
// 定义UDP消息体
|
||
|
|
typedef struct {
|
||
|
|
ip4_addr_t src_ip; // 来源IP
|
||
|
|
uint16_t src_port; // 来源端口
|
||
|
|
uint16_t len; // 数据长度
|
||
|
|
char *data; // 数据指针(动态分配)
|
||
|
|
} UdpMsg_t;
|
||
|
|
|
||
|
|
|
||
|
|
//void Charger_Task_Init(void);
|
||
|
|
void handle_udp_downlink(uint8_t id, const char *cmd, cJSON *json_pack);
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
#endif /* __CHARGERTASK_H */
|
||
|
|
|