In the previous chapters of today's lesson, you defined a device discovery parameters object, device discovery request, and device discovery response. This chapter will tie all these classes together so that the developer driver's device manager can use them to discover the devices on your field-bus.
package com.yourCompany.yourDriver.discover; import com.tridium.ddf.identify.*; import com.tridium.ddf.discover.auto.*; import com.yourCompany.yourDriver.identify.*; import javax.baja.sys.*; public class BYourDriverDeviceDiscoveryPreferences extends BDdfAutoDiscoveryPreferences { /*- class BYourDriverDeviceDiscoveryPreferences { properties { timeout : BRelTime -- This is the amount of time to wait per field-bus request before timing out default{[BRelTime.makeSeconds(3)]} slotfacets{[BFacets.make(BFacets.make(BFacets.SHOW_MILLISECONDS,BBoolean.TRUE), BFacets.MIN,BRelTime.make(0))]} retryCount : int -- This is the number of discovery field-message retransmissions -- per request. default{[1]} slotfacets{[BFacets.make(BFacets.MIN,BInteger.make(0))]} min : BDdfIdParams -- This is the id of the lowest device for your driver to attempt to -- learn by default default{[(BDdfIdParams)new BYourDriverDeviceId().getFirst()]} max : BDdfIdParams -- This is the id of the highest device for your driver to attempt to -- learn by default default{[(BDdfIdParams)new BYourDriverDeviceId().getLast()]} } } -*/ }
import com.tridium.ddf.discover.*; import com.yourCompany.yourDriver.discover.*;
/*- class BYourDriverSerialNetwork { properties { communicator : BValue -- This plugs in an instance of yourDriver's -- communicator onto the serial network component. -- The Niagara station's platform will communicate -- over a serial port that is configured on this -- serial network. You can look at the property -- sheet of this communicator to review the exact -- settings. default{[ new BYourDriverCommunicator() ]} } discoveryPreferences : BDdfDiscoveryPreferences -- This saves the last set of discovery preferences -- that the user provides on the device manager. It -- is also used as the default for the first Time -- that the user is prompted for a discovery. default{[ new BYourDriverDeviceDiscoveryPreferences()]} } } -*/
/*- class BYourDriverGatewayNetwork { properties { communicator : BValue -- This plugs in an instance of yourDriver's -- communicator onto the gateway network component. -- The Niagara station's platform will communicate -- directly to the corresponding gateway unit on the -- field-bus. default{[ new BYourDriverCommunicator() ]} } discoveryPreferences : BDdfDiscoveryPreferences -- This saves the last set of discovery parameters -- that the user provides on the device manager. It -- is also used as the default for the first Time -- that the user is prompted for a discovery. default{[ new BYourDriverDeviceDiscoveryPreferences()]} } } -*/
SIDENOTE: If the network supports UDP Multi Cast capabilities then an auto-learn might still be possible. However, UDP Multi Cast is a subject that is beyond the scope of this tutorial.
Copyright © 2000-2014 Tridium Inc. All rights reserved.