Jonathan Reichelt Gjertsen
|
249c4f3919
|
Sometimes it's useful to turn NMBS_DEBUG on, but the output is a bit of a mess if the read/write callbacks also log to the same channel. Moving the DEBUG statements in recv_msg_footer and send_msg_footer to the start of the function makes the output a bit cleaner, although it's not perfect.
Example output before this change:
```
NMBS req -> fc 16 a 12326 q 2 b 4 regs 4660 43981 transmitted[13] = { f7, 10, 30, 26, 00, 02, 04, 12, 34, ab, cd, c2, 04, }
received[1] = { 0xf7, }
received[1] = { 0x10, }
NMBS res <- fc 16 received[4] = { 0x30, 0x26, 00, 0x2, }
a 12326 q 2received[2] = { 0xbb, 0x95, }
NMBS req -> fc 3 a 12326 q 2 transmitted[8] = { f7, 03, 30, 26, 00, 02, 3e, 56, }
received[1] = { 0xf7, }
received[1] = { 0x3, }
NMBS res <- fc 3 received[1] = { 0x4, }
b 4 received[4] = { 0x12, 0x34, 0xab, 0xcd, }
regs 466043981received[2] = { 0x96, 0x2f, }
```
after:
```
NMBS req -> fc 16 a 12326 q 2 b 4 regs 4660 43981
transmitted[13] = { f7, 10, 30, 26, 00, 02, 04, 12, 34, ab, cd, c2, 04, }
received[1] = { 0xf7, }
received[1] = { 0x10, }
NMBS res <- fc 16 received[4] = { 0x30, 0x26, 00, 0x2, }
a 12326 q 2
received[2] = { 0xbb, 0x95, }
NMBS req -> fc 3 a 12326 q 2
transmitted[8] = { f7, 03, 30, 26, 00, 02, 3e, 56, }
received[1] = { 0xf7, }
received[1] = { 0x3, }
NMBS res <- fc 3 received[1] = { 0x4, }
b 4 received[4] = { 0x12, 0x34, 0xab, 0xcd, }
regs 466043981
received[2] = { 0x96, 0x2f, }
```
|
2022-06-07 19:52:40 +02:00 |
|