You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
611 B
C
26 lines
611 B
C
#ifndef _MODBUS_SERIAL_H
|
|
#define _MODBUS_SERIAL_H
|
|
|
|
#include "serial.h"
|
|
#include "common.h"
|
|
#include <stdlib.h>
|
|
|
|
#define MODBUS_TIMEOUT 1000
|
|
|
|
typedef struct
|
|
{
|
|
int m_iRevStatus; /* */
|
|
int m_iRecvLen; /* */
|
|
int m_iNeedRevLength; /* */
|
|
int iRecvTime; /* */
|
|
uint8_t m_au8RecvBuf[RECVDATA_MAXLENTH];/* */
|
|
} SJZD_SERIAL_DEF;
|
|
|
|
|
|
int32_t sjzd_serial_init(char *port,int baud,char databit,char parity);
|
|
int32_t sjzd_serial_read(uint8_t *pucBuffer,uint16_t usNBytes,uint16_t *usNBytesRead);
|
|
int32_t sjzd_serial_write(uint8_t *pucBuffer,uint16_t usNBytes);
|
|
|
|
#endif
|
|
|