Closed z8a closed 3 years ago
To manage mark or not mark condition (I've both on the same connection) and without change too much your software I've modified osdp_cp.c (v1.3.0) in this way:
if (was_empty && rec_bytes > 0) { / Start of message / pd->tstamp = osdp_millis_now(); }
if (was_empty && (buf[0] != 0xFF)) { memmove(&buf[1], &buf[0], rec_bytes); buf[0] = 0xFF; rec_bytes++; }
pd->rx_buf_len += rec_bytes;
if (IS_ENABLED(CONFIG_OSDP_PACKET_TRACE)) {
I think you could do better. I cannot use the CONFIG_OSDP_SKIP_MARK_BYTE switch because I've both the conditions.
To manage mark or not mark condition (I've both on the same connection) and without change too much your software I've modified osdp_cp.c (v1.3.0) in this way:
if (was_empty && rec_bytes > 0) { / Start of message / pd->tstamp = osdp_millis_now(); }
if (was_empty && (buf[0] != 0xFF)) { memmove(&buf[1], &buf[0], rec_bytes); buf[0] = 0xFF; rec_bytes++; }
pd->rx_buf_len += rec_bytes;
if (IS_ENABLED(CONFIG_OSDP_PACKET_TRACE)) {
I think you could do better. I cannot use the CONFIG_OSDP_SKIP_MARK_BYTE switch because I've both the conditions.