43 for (
int i = 0; i < num; i++) { ret_data[i] = rx_data[i + 4]; }
56 unsigned char *send_data =
new unsigned char[num + 4];
60 send_data[2] = num + 1;
61 send_data[3] = funcode;
62 for (i = 0; i < num; i++) { send_data[4 + i] = datas[i]; }
65 send_data[4 + num] = (
unsigned char)(crc & 0xFF);
66 send_data[5 + num] = (
unsigned char)((crc >> 8) & 0xFF);
void sleep_milliseconds(unsigned long milliseconds)
int read_frame(unsigned char *data)
int send_xbus(int funcode, unsigned char *datas, int num)
int write_frame(unsigned char *data, int len)
static const int SLAVE_ID
int check_xbus_prot(unsigned char *datas, int funcode)
int modbus_crc(unsigned char *data, int len)
static const int MASTER_ID
long long get_system_time()
static const int ERR_TOUT
static const int ERR_CODE
static const int WAR_CODE
int send_pend(int funcode, int num, int timeout, unsigned char *ret_data)
UxbusCmdSer(SerialPort *arm_port)