Support for BiDiB-Distributed (Distributed control)

What is BiDiB-Distributed

BiDiB-Distributed is an extension of the BiDiB protocol to integrate devices such as hand controllers or control panels into an existing BiDiB system. Message flows are described below, which are intended to clarify the application in some situations.

Target-Mode BIDIB_TARGET_MODE_BOOSTER

A guest node wants to make a subscription to all booster nodes in the system. The target mode BIDIB_TARGET_MODE_BOOSTER can be used for this. The MSG_GUEST_REQ_SUBSCRIBE is responded to by the host with one MSG_GUEST_RESP_SUBSCRIPTION per booster node in the system. The response includes the node ID of the booster node, which the guest can use for further addressing. The number of responses to be expected is communicated by MSG_GUEST_RESP_SUBSCRIPTION_COUNT.


>> MSG_GUEST_REQ_SUBSCRIBE MODE_BOOST Bit 11 = 1

<< MSG_GUEST_RESP_SUBSCRIPTION_COUNT MODE_BOOST 3
<< MSG_GUEST_RESP_SUBSCRIPTION MODE_BOOST IdNode1 Result = 0 SUB = 0 8
<< MSG_GUEST_RESP_SUBSCRIPTION MODE_BOOST IdNode2 Result = 0 SUB = 0 8
<< MSG_GUEST_RESP_SUBSCRIPTION MODE_BOOST IdNode3 Result = 0 SUB = 0 8

If no booster was found in the system, the MSG_GUEST_RESP_SUBSCRIPTION_COUNT is sent with the Count parameter.


>> MSG_GUEST_REQ_SUBSCRIBE MODE_BOOST Bit 11 = 1

<< MSG_GUEST_RESP_SUBSCRIPTION_COUNT MODE_BOOST 0

To turn on all booster nodes, the MSG_BOOST_ON message can be used with the broadcast flag set. If this message is sent to the __Interface__ node is sent, all boosters will be turned on. In the example below, the __Interface__ node has the IdNode3. The status messages of all 3 boosters in the system are reported to the guest via MSG_GUEST_RESP_NOTIFY.


>> MSG_GUEST_REQ_SEND MODE_UID IdNode3 BOOST_ON (with Broadcast)

<< MSG_GUEST_RESP_NOTIFY MODE_UID IdNode1 BOOST_ON STATE_ON
<< MSG_GUEST_RESP_NOTIFY MODE_UID IdNode2 BOOST_ON STATE_ON
<< MSG_GUEST_RESP_NOTIFY MODE_UID IdNode3 BOOST_ON STATE_ON

Target-Mode BIDIB_TARGET_MODE_TOP

If the OpenDCC IF2 is used as an interface node, a subscription to the interface node must be made before sending the MSG_BOOST_ON. This is possible using target mode BIDIB_TARGET_MODE_TOP. The MSG_BOOST_ON message can then be sent to the interface node.

Subject "Additive Subscription"

Originally no additive subscriptions were supposed to be possible, i.e. every MSG_GUEST_REQ_SUBSCRIBE would have overwritten the existing subscription (bits that were still set would of course have been adopted). As a result, the initial situation described below would not have been easily resolved.

Initial situation:
As a host, I have a UID list for each guest, which stores UIDs on the bus with bit fields of sub_down and sub_up. 3 x knots with accessories. Of these, is also a booster. Then a subscription comes from guest 1:


>> MSG_GUEST_REQ_SUBSCRIBE BIDIB_TARGET_MODE_ACCESSORY 0x00 0x80 (Accessory Upstream)

<< MSG_GUEST_RESP_SUBSCRIPTION_COUNT BIDIB_TARGET_MODE_ACCESSORY 3
<< MSG_GUEST_RESP_SUBSCRIPTION BIDIB_TARGET_MODE_ACCESSORY  0x01 0x00 0x80
<< MSG_GUEST_RESP_SUBSCRIPTION BIDIB_TARGET_MODE_ACCESSORY  0x01 0x00 0x80
<< MSG_GUEST_RESP_SUBSCRIPTION BIDIB_TARGET_MODE_ACCESSORY  0x00 0x00 0x80

This leads to three entries in the node list:


  0x00 0x80
  0x00 0x80
  0x00 0x80

Since the guest doesn't know the node tree, but also wants the booster upstream messages, it sends:


>> MSG_GUEST_REQ_SUBSCRIBE BIDIB_TARGET_MODE_BOOSTER 0x00 0x08 (Booster Upstream)

Antwort:


<< MSG_GUEST_RESP_SUBSCRIPTION_COUNT BIDIB_TARGET_MODE_BOOSTER 1
<< MSG_GUEST_RESP_SUBSCRIPTION BIDIB_TARGET_MODE_BOOSTER  0x01 0x00 0x08

But the entry in the table would have lost the accessory subscription.


  0x00 0x80
  0x00 0x08
  0x00 0x80

Subject "Preconfigured Subscription"

The term Preconfigured Subscription defines the persistent storage of subscriptions in the guest node. After launch, the guest node registers a subscription with the host for each preconfigured subscription. The subscription must then be created with the BIDIB_TARGET_MODE_UID so that the host can "reserve" nodes that do not exist.