Specifications
AVIDdirector-M2M™ Technical Reference Guide
February 5, 2009 ©AVIDwireless 2004-2009 All Rights Reserved Page 18 of 55
be set via either the M2MApp.ini file or over the air using M2MXML SetConfiguration portal
commands are:
§ KeyName.SERIAL_PORT = serial2
§ TempTrack. This device has two Analog to Digital converter inputs that are accessed by
sending an ASCII ‘G’ character to the serial port and it returns a two character strings with the
values from 0.0 to 999.9 This is best used as a sample of a user written IODriver class. This
implements the Parameters that may be set via either the M2MApp.ini file or over the air using
M2MXML SetConfiguration portal commands are:
§ KeyName.SERIAL_PORT = serial1
§ KeyName.SERIAL_PORT_BAUD_RATE = 9800
§ KeyName.SERIAL_PORT_TIMEOUT = serial1
User written I/O device driver classes subclass IODevices and must implement
start(AVIDdirectorMain adApp) and any of the IODevice methods the device needs to
implement or override. All M2MXML messages addressed to this particular transducer are directed
towards the instance of IODevice with the KeyName or M2MXMLAddress corresponding to the
M2MXML address. IODevice has a default method implementation for each M2MXML message
appropriate for transducers/sensors. The method corresponding to each M2MXML message is
called depending on the M2MXML message received. The user IODevice class can override each
of these methods if they wish to. The methods are:
§ processControlCommand(ControlCommand message). The default action is to return a
Response.UNRECOGNIZED_COMMAND_RESULT_CODE message to the portal. Any digital
transducers should implement this method.
§ processPerceptRequest(PerceptRequest message). The default action is to return a
Response.UNRECOGNIZED_COMMAND_RESULT_CODE message to the portal. Almost every
IODevice will implement this method to return the current sensor reading to the M2MXML portal
on demand.
If the sensor or transducer takes a significant amount of time to perform a reading (more than
200 ms) then it is recommended that the sensor call startPerceptRequestThread
(PerceptRequest perceptRequest) to start a background thread to perform this
PerceptRequest. This requires the IODevice to implement
processPerceptRequestThread(PerceptRequest message) method that will perform the
actual reading.
§ processConfigurationQuery(ConfigurationQuery message). This will return the value of
any property in the configuration file M2MApp.ini for this transducer. For example, a query of
“SIRIT_OEM200_RFID_READER.TAGTYPE” will return which RFID tag type (ISO, Tag-IT,
Epic class 0, 1 or 2) this sensor is set to receive. By default, IODevice’s implementation will
prefix the property name with the keyname and return that value (if set) or
Response.BAD_ARGUEMENT_RESULT_CODE if this is not set. Most IODevice implementation do
not need to implement this method.
§ processSetConfiguration(SetConfiguration message). If not overridden this will prefix
the property with the IODevice’s keyname, set the specified property in the M2MApp.ini file and
invoke the method processSetConfigurationItem (String propertyName, String
oldValue, String newValue, String seqNum). The user IODevice will typically implement
the processSetConfigurationItem method to respond to specific property settings and
update any operation because of the property changes.
M2M_IODevice
The standard AVIDdirector-M2M devices are implemented by the
com.avidwireless.AVIDdirector.iodevice.M2M_IODevices class. This handles all the portal
messages to the devices, configuration settings and implements the on-device behaviors.