23 lines
448 B
C
23 lines
448 B
C
|
#ifndef __TCP_SERVER_H
|
||
|
#define __TCP_SERVER_H
|
||
|
|
||
|
#include <stdint.h>
|
||
|
|
||
|
#define TCP_SERVER_PORT 6000
|
||
|
|
||
|
|
||
|
|
||
|
// 链表,记录连接的客户端
|
||
|
struct clientNode
|
||
|
{
|
||
|
struct tcp_pcb *pcb;
|
||
|
int enable_notify; // 是否使能数据上报
|
||
|
struct clientNode *next;
|
||
|
};
|
||
|
|
||
|
void tcp_server_init(void);
|
||
|
void ble_write_data(int id, uint8_t *data, int len);
|
||
|
void ble_read_data(uint8_t *data, int len);
|
||
|
void tcp_server_notify(uint8_t *data, int len);
|
||
|
|
||
|
#endif
|