protected virtual void InitDeviceInfo(InitialDeviceConfig config) { dynamic initialDevice = SampleDeviceFactory.GetSampleSimulatedDevice(config.DeviceId, config.Key); DeviceProperties = DeviceSchemaHelper.GetDeviceProperties(initialDevice); Commands = CommandSchemaHelper.GetSupportedCommands(initialDevice); HostName = config.HostName; PrimaryAuthKey = config.Key; }
/// <summary> /// Generates a DeviceInfo packet for a simulated device to send over the wire /// </summary> /// <returns></returns> public virtual dynamic GetDeviceInfo() { dynamic device = DeviceSchemaHelper.BuildDeviceStructure(DeviceID, true); device.DeviceProperties = DeviceSchemaHelper.GetDeviceProperties(this); device.Commands = CommandSchemaHelper.GetSupportedCommands(this); device.Version = SampleDeviceFactory.VERSION_1_0; device.ObjectType = SampleDeviceFactory.OBJECT_TYPE_DEVICE_INFO; return(device); }
/// <summary> /// Generates a DeviceInfo packet for a simulated device to send over the wire /// </summary> /// <returns></returns> public virtual dynamic GetDeviceInfo() { dynamic device = DeviceSchemaHelper.BuildDeviceStructure(DeviceID, true, null); device.DeviceProperties = DeviceSchemaHelper.GetDeviceProperties(this); device.Commands = CommandSchemaHelper.GetSupportedCommands(this); device.Version = SampleDeviceFactory.VERSION_1_0; device.ObjectType = SampleDeviceFactory.OBJECT_TYPE_DEVICE_INFO; // Remove the system properties from a device, to better emulate the behavior of real devices when sending device info messages. DeviceSchemaHelper.RemoveSystemPropertiesForSimulatedDeviceInfo(device); return(device); }