demo.js
function DemoDevice(){
  var _device = {};
  _device[DEVICE.ModelManufacturer] = "Internet of Protocols Alliance";
  _device[DEVICE.ModelManufacturerUrl] = "http://iopa.io";
  _device[DEVICE.ModelName] = "npm install iopa-devices";
  _device[DEVICE.ModelNumber] = "iopa-devices";
  _device[DEVICE.ModelUrl] = "http://github.com/iopa-io/iopa-devices";

  _device[DEVICE.PlatformId] = "LOCALHOST";
  _device[DEVICE.PlatformName] = "Iopa Device Stick";
  _device[DEVICE.PlatformFirmware] = packageVersion;
  _device[DEVICE.PlatformOS] = require('os').type() + "/" + require('os').release();

  _device[DEVICE.Id] = "12345-67890";
  _device[DEVICE.Type] = "urn:io.iopa:demo:devices";
  _device[DEVICE.Version] = packageVersion;
  _device[DEVICE.Location] = [37.7833, 122.4167];
  _device[DEVICE.LocationName] = "San Francisco, USA";
  _device[DEVICE.Currency] = "USD";
  _device[DEVICE.Region] = "Home";
  _device[DEVICE.Policy] = null;
  _device[DEVICE.Url] = "coap://localhost";
  
  _device[DEVICE.Resources] = [];
  var _res = {};
  _res[RESOURCE.TypeName] = "IOPA Demo Projector";
  _res[RESOURCE.Type] = "urn:io.iopa:resource:projector";
  _res[RESOURCE.Interface] = "if.switch.binary";
  _res[RESOURCE.Path] = "/media/projector";
  _res[RESOURCE.Name] = "Projector 1";
  _res[RESOURCE.Value] = false;
  _device[DEVICE.Resources].push(_res);
  
  this._device = _device;
}
function DemoDevice(){
  var _device = {};
  _device[DEVICE.ModelManufacturer] = "Internet of Protocols Alliance";
  _device[DEVICE.ModelManufacturerUrl] = "http://iopa.io";
  _device[DEVICE.ModelName] = "npm install iopa-devices";
  _device[DEVICE.ModelNumber] = "iopa-devices";
  _device[DEVICE.ModelUrl] = "http://github.com/iopa-io/iopa-devices";

  _device[DEVICE.PlatformId] = "LOCALHOST";
  _device[DEVICE.PlatformName] = "Iopa Device Stick";
  _device[DEVICE.PlatformFirmware] = packageVersion;
  _device[DEVICE.PlatformOS] = require('os').type() + "/" + require('os').release();

  _device[DEVICE.Id] = "12345-67890";
  _device[DEVICE.Type] = "urn:io.iopa:demo:devices";
  _device[DEVICE.Version] = packageVersion;
  _device[DEVICE.Location] = [37.7833, 122.4167];
  _device[DEVICE.LocationName] = "San Francisco, USA";
  _device[DEVICE.Currency] = "USD";
  _device[DEVICE.Region] = "Home";
  _device[DEVICE.Policy] = null;
  _device[DEVICE.Url] = "coap://localhost";
  
  _device[DEVICE.Resources] = [];
  var _res = {};
  _res[RESOURCE.TypeName] = "IOPA Demo Projector";
  _res[RESOURCE.Type] = "urn:io.iopa:resource:projector";
  _res[RESOURCE.Interface] = "if.switch.binary";
  _res[RESOURCE.Path] = "/media/projector";
  _res[RESOURCE.Name] = "Projector 1";
  _res[RESOURCE.Value] = false;
  _device[DEVICE.Resources].push(_res);
  
  this._device = _device;
}
function DemoDevice ( ) { var _device = { } ; _device [ DEVICE . ModelManufacturer ] = "Internet of Protocols Alliance" ; _device [ DEVICE . ModelManufacturerUrl ] = "http://iopa.io" ; _device [ DEVICE . ModelName ] = "npm install iopa-devices" ; _device [ DEVICE . ModelNumber ] = "iopa-devices" ; _device [ DEVICE . ModelUrl ] = "http://github.com/iopa-io/iopa-devices" ; _device [ DEVICE . PlatformId ] = "LOCALHOST" ; _device [ DEVICE . PlatformName ] = "Iopa Device Stick" ; _device [ DEVICE . PlatformFirmware ] = packageVersion ; _device [ DEVICE . PlatformOS ] = require ( 'os' ) . type ( ) + "/" + require ( 'os' ) . release ( ) ; _device [ DEVICE . Id ] = "12345-67890" ; _device [ DEVICE . Type ] = "urn:io.iopa:demo:devices" ; _device [ DEVICE . Version ] = packageVersion ; _device [ DEVICE . Location ] = [ 37.7833 , 122.4167 ] ; _device [ DEVICE . LocationName ] = "San Francisco, USA" ; _device [ DEVICE . Currency ] = "USD" ; _device [ DEVICE . Region ] = "Home" ; _device [ DEVICE . Policy ] = null ; _device [ DEVICE . Url ] = "coap://localhost" ; _device [ DEVICE . Resources ] = [ ] ; var _res = { } ; _res [ RESOURCE . TypeName ] = "IOPA Demo Projector" ; _res [ RESOURCE . Type ] = "urn:io.iopa:resource:projector" ; _res [ RESOURCE . Interface ] = "if.switch.binary" ; _res [ RESOURCE . Path ] = "/media/projector" ; _res [ RESOURCE . Name ] = "Projector 1" ; _res [ RESOURCE . Value ] = false ; _device [ DEVICE . Resources ] . push ( _res ) ; this . _device = _device ; }
Demo Device Class
Demo Device Class