64 lines
1.2 KiB
C
64 lines
1.2 KiB
C
#ifndef _TCPECHO_H_
|
|
#define _TCPECHO_H_
|
|
|
|
#include "main.h"
|
|
|
|
#define TCP_PORT_HART1 1001
|
|
#define TCP_PORT_HART2 1002
|
|
#define TCP_PORT_HART3 1003
|
|
#define TCP_PORT_HART4 1004
|
|
#define TCP_PORT_HART5 1005
|
|
#define TCP_PORT_HART6 1006
|
|
#define TCP_PORT_HART7 1007
|
|
#define TCP_PORT_HART8 1008
|
|
#define TCP_PORT_HART9 1009
|
|
#define TCP_PORT_HART10 1010
|
|
#define TCP_PORT_HART11 1011
|
|
#define TCP_PORT_HART12 1012
|
|
#define TCP_PORT_HART13 1013
|
|
#define TCP_PORT_HART14 1014
|
|
#define TCP_PORT_HART15 1015
|
|
#define TCP_PORT_HART16 1016
|
|
|
|
#define TCP_PORT_CONTROL 5003
|
|
|
|
typedef enum
|
|
{
|
|
TCP_HART1 = 0,
|
|
TCP_HART2,
|
|
TCP_HART3,
|
|
TCP_HART4,
|
|
TCP_HART5,
|
|
TCP_HART6,
|
|
TCP_HART7,
|
|
TCP_HART8,
|
|
TCP_HART9,
|
|
TCP_HART10,
|
|
TCP_HART11,
|
|
TCP_HART12,
|
|
TCP_HART13,
|
|
TCP_HART14,
|
|
TCP_HART15,
|
|
TCP_HART16,
|
|
// TCP_CONTROL,
|
|
TCP_MAX,
|
|
} tcp_port_e;
|
|
|
|
extern uint8_t tcp_echo_flags[TCP_MAX];
|
|
|
|
#define TCP_TRANSMIT_MAX 128
|
|
typedef struct
|
|
{
|
|
// uint16_t rx_num;
|
|
uint8_t rx_data[TCP_TRANSMIT_MAX];
|
|
uint8_t rx_data_temp[TCP_TRANSMIT_MAX];
|
|
uint8_t tx_data[TCP_TRANSMIT_MAX];
|
|
} uart_t;
|
|
|
|
extern uart_t hart_uart[TCP_MAX];
|
|
|
|
extern void tcp_echo_init(void);
|
|
extern void user_send_data_hart(uint8_t ch, uint8_t *data, uint16_t len);
|
|
|
|
#endif
|