28 lines
651 B
C
28 lines
651 B
C
#ifndef _UART_NET_H_
|
|
#define _UART_NET_H_
|
|
|
|
#ifndef u8
|
|
#define u8 unsigned char
|
|
#define u16 unsigned short
|
|
#define u32 unsigned int
|
|
#endif
|
|
|
|
typedef struct{
|
|
const u32 TransportDistance; //通讯距离 m
|
|
const u32 BandRate; //波特率 bit/s
|
|
u32 MessageLenMin; //报文段长度
|
|
const u32 (*CalMessageLen)(void*);
|
|
}NET_PHY_PROP;
|
|
u32 UartBusMessageLenCal(void *priv);
|
|
|
|
typedef enum{
|
|
MSG_LEN_TOO_SHORT, //报文段定于过短
|
|
MSG_LEN_TOO_LONG, //报文段定于过长
|
|
MSG_SEND_MAY_ERR, //报文段尝试发送失败
|
|
|
|
}NET_ERROR;
|
|
|
|
u32 NetInit();
|
|
u32 NetSendBase(u8 *data,u32 len,u8 *destAddr);
|
|
|
|
#endif |