public DeviceDataRecord CreateDeviceRepresentation(ModelDevice device) { if (device == null) { return(null); } DeviceDataRecord raw = new DeviceDataRecord(device.ParentId); if (device is ModelDevice) { AddCommonDevicePropertiesAsNVPairs(device, raw); raw.AddProperty(AgentKeys.AgentName, AgentId); // mark it as mine var specificDevice = device as ModelDeviceSample; if (specificDevice != null) { AddInfoToDevice(raw, specificDevice); } } return(raw); }
private static void AddInfoToDevice(DeviceDataRecord raw, ModelDeviceSample specificDevice) { raw.AddProperty(Consts.IPADDRESS_KEY, specificDevice.IPAddress); raw.AddProperty(Consts.DEVICENAME_KEY, specificDevice.DeviceName); }
public DeviceDataRecord CreateDeviceRepresentation(ModelDevice device) { if (device == null) return null; DeviceDataRecord raw = new DeviceDataRecord(device.ParentId); if (device is ModelDevice) { AddCommonDevicePropertiesAsNVPairs(device, raw); raw.AddProperty(AgentKeys.AgentName, AgentId); // mark it as mine var specificDevice = device as ModelDeviceSample; if (specificDevice != null) { AddInfoToDevice(raw, specificDevice); } } return raw; }