While following the examples in this chapter, please replace the text jarFileName, yourDriver and yourCompany as previously described in the Preparation section):
NOTE: The Dev in BDdfDeviceId, and in many other locations throughout the developer driver, stands for Developer.
To do this, create a text file named BYourDriverDeviceId.java in the jarFileName/src/com/yourCompany/yourDriver/identify folder. Inside the text file, start with the text that follows. The multi-line comment that immediately follows the Java class declaration is the Niagara slotomatic declaration. In the properties section, declare any properties that you needed for the toByteArray method in the previous chapter.
package com.yourCompany.yourDriver.identify; import javax.baja.sys.*; import com.tridium.ddf.identify.*; import com.yourCompany.yourDriver.comm.req.*; public class BYourDriverDeviceId extends BDdfDeviceId { /*- class BYourDriverDeviceId { properties { unitNumber : int -- This is the unitNumber in our hypothetical protocol. default{[0]} slotfacets{[MGR_INCLUDE]} } } -*/ }
public Type getPingRequestType( ) { return BYourDriverPingRequest.TYPE; }
To do this, open a Niagara Console and do the following, replacing directoryAboveYourCompanyYourDriverFolder with the path to the folder that contains the outer-most yourCompanyYourDriver folder, as created in the Preparation section.
d:\Niagara-3.2.x> cd d:/directoryAboveYourCompanyYourDriverFolder d:\directoryAboveYourCompnayYourDriverFolder> slot -mi yourCompanyYourDriver
The slotomatic utility parses the slotomatic comment that you added to the top of the BYourDriverPingRequest and BYourDriverDeviceId classes and generates the boiler-plate code necessary to add frozen properties to those classes. The -mi option works in Niagara AX versions 3.2 and later. It causes the slotomatic utility to also add an entry to your driver's module-include.xml file that is necessary for each Niagara AX type in your driver.
To do this, open a Niagara Console from a Niagara 3.2.x release (or later) and do the following, replacing directoryAboveYourCompanyYourDriverFolder with the path to the folder that contains the outer-most yourCompanyYourDriver folder, as created in the Preparation section.
d:\Niagara-3.2.x> cd d:/directoryAboveYourCompanyYourDriverFolder d:\directoryAboveYourCompnayYourDriverFolder> build yourCompanyYourDriver full
Copyright © 2000-2016 Tridium Inc. All rights reserved.