Databytes len error cleared.
This commit is contained in:
+4
-2
@@ -1073,7 +1073,8 @@ eb_cyc_data_process(const unsigned char *buf, int buflen)
|
|||||||
mlen = 5 + (int) msg[4];
|
mlen = 5 + (int) msg[4];
|
||||||
|
|
||||||
if (((int) msg[4]) > EBUS_MSG_MASTER_MAX_DB_LEN) {
|
if (((int) msg[4]) > EBUS_MSG_MASTER_MAX_DB_LEN) {
|
||||||
log_print(L_WAR, "%s", "Master DB Len Error");
|
log_print(L_WAR, "%s (%d > %d)", "Master DB Len Error",
|
||||||
|
((int) msg[4]), EBUS_MSG_MASTER_MAX_DB_LEN);
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1116,7 +1117,8 @@ eb_cyc_data_process(const unsigned char *buf, int buflen)
|
|||||||
slen = 1 + (int) msg[mlen + 2];
|
slen = 1 + (int) msg[mlen + 2];
|
||||||
|
|
||||||
if (((int) msg[mlen + 2]) > EBUS_MSG_SLAVE_MAX_DB_LEN) {
|
if (((int) msg[mlen + 2]) > EBUS_MSG_SLAVE_MAX_DB_LEN) {
|
||||||
log_print(L_WAR, "%s", "Slave DB Len Error");
|
log_print(L_WAR, "%s (%d > %d)", "Slave DB Len Error",
|
||||||
|
((int) msg[mlen + 2]), EBUS_MSG_SLAVE_MAX_DB_LEN);
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,6 +168,12 @@ main(int argc, char *argv[])
|
|||||||
//~
|
//~
|
||||||
//~ char cmd[] = "cyc ms test";
|
//~ char cmd[] = "cyc ms test";
|
||||||
|
|
||||||
|
//~ const unsigned char tmp[] = {'\x03','\xe0','\xb5','\x21','\x05','\x00','\x05','\x07','\x00','\xe7',
|
||||||
|
//~ '\x64','\x80','\x42','\x40','\x10','\x11','\xd0','\x05','\x74','\x64',
|
||||||
|
//~ '\xd2','\xea','\x01','\xa9','\x10','\x08','\xb5','\x09','\x03','\x29',
|
||||||
|
//~ '\xb8','\x01','\xfd','\x00','\x03','\xb8','\x01','\x00','\x70','\x00'};
|
||||||
|
//~
|
||||||
|
//~ char cmd[] = "cyc vwl OutUnitData";
|
||||||
|
|
||||||
//~ Master Master
|
//~ Master Master
|
||||||
//~ 10 03 05 07 09 bb 06 2e 02 00 80 ff 6e ff 8f 00
|
//~ 10 03 05 07 09 bb 06 2e 02 00 80 ff 6e ff 8f 00
|
||||||
|
|||||||
Reference in New Issue
Block a user