Specifications

AVIDdirector-M2M Technical Reference Guide
February 5, 2009 ©AVIDwireless 2004-2009 All Rights Reserved Page 41 of 55
getDeviceAddress(),
value,PerceptRequest.PERCEPT_TYPE_BIT, null );
app.sendMessageToPortal(perceptMessage);
}
}
catch (InvalidHardwareOperationException ihoe) {
Logger.log(NAME,sensors[device].getDeviceName()+
" InvalidHardwareOperationException:"+ihoe.getMessage());
}
catch (IllegalHardwareAddressException ihae) {
Logger.log(NAME,sensors[device].getDeviceName()+
" IllegalHardwareAddressException:"+ihae.getMessage());
}
catch (NullPointerException npe) {
Logger.log(NAME,sensors[device].getDeviceName()+
" NullPointerException:"+npe.getMessage());
}
catch (Exception ex) {
Logger.log(NAME,sensors[device].getDeviceName()+"
Exception:"+ex.getMessage());
}
} else {
// null sensor
if (Logger.isDebugLevel2()) Logger.debugln(NAME,
"Device#"+device+" is null. Probably an invalid name");
}
} // sensor loop
// update every 100 ms
if (threadRunning) AvidUtil.waitHereMs(100); // update every 1/10 of a second
} // while thread running
thread = null; // release ourselves
Logger.log(NAME,"Exiting thread");
} else {
Logger.log(NAME,"Not started so cannot run thread. Exiting");
}
} // run
/**
* When a SetConfiguration command is received, for each configuration item
* this method is called.
* Each M2MLet can override this method to handle processing the configiruation command
changes.
* <p>
* We are looking for the M2MLET.DEMO_ENABLED item changing, and setting the demonstration
* parameter to this value
*
* @param propertyName The Configuration file property name
* @param oldValue The old value of this item. This is null if there is no old value
* @param newValue The new value of this item.
* @param seqNum The sequence number of this command
* @return boolean true if this was processed successfully, false if an error occureed
*/
public boolean processSetConfigurationItem(String propertyName, String oldValue,
String newValue, String seqNum)
{
final String NAME = "Demo_M2Mlet.processSetConfigurationItem";
boolean returnStatus = false;
// The M2MLet must override this to mean anything. The default is to return true
if (propertyName.equals(CONFIG_FILE_DEMO_MODE)) {
demoM2mletEnabled = AvidUtil.parseBoolean(newValue);
Logger.log(NAME,"DemoM2MletEnable = "+demoM2mletEnabled+" starting Demo mode");
// start the Demo if we didn't when initialized
if (demoM2mletEnabled && !started) start(app);
returnStatus = true;
} else {
if (Logger.isDebug()) Logger.debugln(NAME,"Unknown Property "+propertyName);
// other parameter, return true for now