The BDdfReceiver features a computeTag method. Although this method might not be overridden for every driver, overriding it can be very helpful. The computeTag method is used to optimize the algorithm that matches incoming data frames with previously transmitted requests.
Requests (that extend BDdfRequest or implement BIDdfRequest) also feature a getTag method that can be overridden. Any incoming data frame whose tag, as computed by the computeTag method "equals" the tag that is returned from an outstanding request will be passed to the outstanding request's processReceive method.
By default, the getTag method of BDdfRequest returns BString.DEFAULT. Likewise, the default computeTag method from BDdfReceiver also returns BString.DEFAULT. This naturally causes all incoming data frames to be passed to the processReceive method of all outstanding requests.
By overriding these two methods and defining tags, the developer driver framework will automatically pass the appropriate incoming data frames to the appropriate outstanding requests.
If the tag for an incoming data frame does not match up with the tag of a recently transmitted request, then the incoming data frame will be routed to the driver's unsolicited receive handler. This is described further in the next appendix.
Copyright © 2000-2016 Tridium Inc. All rights reserved.