The state of a Kehrschleifenmodul (reversing loop) is stored on the GBMboost board that it is connected to. We can read the state via the Configuration Value (CV) 51 that is local of the GBM16T it is connected to.
Define the CV of each Kehrschleifenmodule as part of the track configuration file.
Result of `bidib_send_vendor_get(0.0.0, 5, "20051")`, which asks the for the value of CV 20051 (current state of the Kehrschleifenmodul) from node address 0.0.0 (GBMboost master):
The value of CV 20051 is "1" (ASCII value 0x31).
Thus, `bidib_transmission_receive.c` needs to look for `MSG_VENDOR` and to check whether the CV matches a reverser. If so, the value is saved into the state.
4. Define high-level functions for querying the state of a reverser. The state should be marked as stale (-1) to indicate that an update is necessary before it can be queried again.
The state of a Kehrschleifenmodul (reversing loop) is stored on the GBMboost board that it is connected to. We can read the state via the Configuration Value (CV) 51 that is local of the GBM16T it is connected to.
Define the CV of each Kehrschleifenmodule as part of the track configuration file.
Update the track parser to create a new state object for
reversers
.Define high-level functions for updating the state of a reverser from a GBM16T into the library.
// Possible libbidib API: void bidib_update_reverser_state(char reverser_name) { uint8_t reverser = bidib_get_reverser(reverser_name); bidib_send_vendor_get(reverser->nodeaddr, reverser->cv_length, reverser->cv, 0); }
libbidib: Send to: 0x00 0x00 0x00 0x00 seq: 38 type: MSG_VENDOR_GET (0x17) action id: 0 libbidib: Message bytes: 0x09 0x00 0x26 0x17 0x05 0x32 0x30 0x30 0x35 0x31
libbidib: Received from: 0x00 0x00 0x00 0x00 seq: 38 type: MSG_VENDOR (0x93) action id: 0 libbidib: Message bytes: 0x0b 0x00 0x26 0x93 0x05 0x32 0x30 0x30 0x35 0x31 0x01 0x31