25 lines
553 B
C
25 lines
553 B
C
#ifndef __TCP_CLIENT_H__
|
|
#define __TCP_CLIENT_H__
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
#include <stdio.h>
|
|
#include "string.h"
|
|
#include "cm_os.h"
|
|
|
|
#define TCP_HOST "36.137.226.30" //TCP地址 例"192.168.0.1"
|
|
#define TCP_PORT 38840 //TCP端口
|
|
|
|
// 连接TCP服务器
|
|
int tcp_client_connect(const char *host, int port);
|
|
|
|
// 发送数据到TCP服务器
|
|
int tcp_client_send(const uint8_t *buf, uint16_t len);
|
|
|
|
// 关闭TCP连接
|
|
void tcp_client_close(void);
|
|
|
|
// 初始化TCP客户端
|
|
void tcp_client_init(void);
|
|
|
|
|
|
#endif /* __TCP_CLIENT_H__ */ |