private CommandDefinition[] ConstructCommandsForBoolDatapoint(DatapointDefinition boDatapointDefinition) { var commands = new List <CommandDefinition>(); commands.Add(new SgetCommandDefinition(CommandOnId, UicUriBuilder.CommandFrom(this, "SWITCH_ON"), "Switch On", "1", UicDataType.Bool, string.Empty, boDatapointDefinition, new [] { "On" })); commands.Add(new SgetCommandDefinition(CommandOffId, UicUriBuilder.CommandFrom(this, "SWITCH_OFF"), "Switch Off", "0", UicDataType.Bool, string.Empty, boDatapointDefinition, new [] { "Off" })); return(commands.ToArray()); }
private EdmCapability CreateEdmCapability() { List <AttributeDefinition> attribtueDefinitions = new List <AttributeDefinition>(); attribtueDefinitions.Add( new SgetAttributDefinition( _maxblockLengthAttributeId, UicUriBuilder.DatapointFrom(this, "MaxBlockLength"), "I2C MaxBlockLength", UicDataType.Integer, string.Empty)); return(new EapI2cEdmCapability(Identifier, new CommandDefinition[0], attribtueDefinitions.ToArray(), new DatapointDefinition[0])); }
private EdmCapability CreateEdmCapability() { var dataPoints = new List <DatapointDefinition>(); var commands = new List <CommandDefinition>(); foreach (EapiGpioId pin in Enum.GetValues(typeof(EapiGpioId))) { string pinname = "Pin" + (int)pin; string uri = UicUriBuilder.DatapointFrom(this, pinname); _gpioIdMap[uri] = pin; var pinDef = new SgetDatapointDefinition(pin.ToGuid(), uri, UicDataType.Bool, pinname, string.Empty); dataPoints.Add(pinDef); if ((int)pin > (int)EapiGpioId.EAPI_ID_GPIO_GPIO07) { var onCommand = new SgetCommandDefinition( pin.ToOnCommandGuid(), UicUriBuilder.CommandFrom(this, pinname + ".on"), "Set " + pinname, pinname + "@set", UicDataType.Bool, string.Empty, pinDef , new[] { "On" }); commands.Add(onCommand); _onCommandMap.Add(onCommand.Uri, pin); var offCommand = new SgetCommandDefinition( pin.ToOffCommandGuid(), UicUriBuilder.CommandFrom(this, pinname + ".off"), "Reset " + pinname, pinname + "@reset", UicDataType.Bool, string.Empty, pinDef , new[] { "Off" }); commands.Add(offCommand); _offCommandMap.Add(offCommand.Uri, pin); } } return(new GpioEdmCapability(Identifier, dataPoints.ToArray(), new AttributeDefinition[0], commands.ToArray())); }
public RebootEdm(ILoggerFactory loggerFactory) { _logger = loggerFactory.GetLoggerFor(GetType()); Identifier = new RebootEdmIdentifier(GetType().FullName); _rebootCommnand = new SgetCommandDefinition(new Guid("{f54b990d-25f5-430d-8428-44ab74ed8509}"), UicUriBuilder.CommandFrom(this, "reboot"), "Reboot System", "reboot", UicDataType.String, "Reboots the system", null, null); CommandDefinition[] commandDefinitios = { _rebootCommnand }; AttributeDefinition[] attribtueDefinitions = new AttributeDefinition[0]; DatapointDefinition[] datapointDefinitions = new DatapointDefinition[0]; _edmCapability = new RebootEdmEdmCapability(Identifier, commandDefinitios, attribtueDefinitions, datapointDefinitions); }
private SgetDatapointDefinition GetDatapointDefinitionOf(BoardInformationValueId item) { switch (item) { case BoardInformationValueId.EAPI_ID_GET_EAPI_SPEC_VERSION: return(null); case BoardInformationValueId.EAPI_ID_BOARD_BOOT_COUNTER_VAL: return(new SgetDatapointDefinition(new Guid("0D516431-537D-49E4-88F7-6FD0ED39A142"), UicUriBuilder.DatapointFrom(_edm, item.ToString()), UicDataType.Integer, "Boot Cpunter", string.Empty)); case BoardInformationValueId.EAPI_ID_BOARD_RUNNING_TIME_METER_VAL: return(new SgetDatapointDefinition(new Guid("A7464FB7-1BDD-45AB-9F57-5E591EBC829E"), UicUriBuilder.DatapointFrom(_edm, item.ToString()) , UicDataType.Integer, "Running Time", string.Empty)); case BoardInformationValueId.EAPI_ID_BOARD_PNPID_VAL: return(null); case BoardInformationValueId.EAPI_ID_BOARD_PLATFORM_REV_VAL: return(null); case BoardInformationValueId.EAPI_ID_BOARD_DRIVER_VERSION_VAL: return(null); case BoardInformationValueId.EAPI_ID_BOARD_LIB_VERSION_VAL: return(null); case BoardInformationValueId.EAPI_ID_HWMON_CPU_TEMP: return(new SgetDatapointDefinition(new Guid("2C77712B-792E-4525-BF32-43B98ADDB358"), UicUriBuilder.DatapointFrom(_edm, item.ToString()), UicDataType.Double, "CPU Temperature", string.Empty)); case BoardInformationValueId.EAPI_ID_HWMON_CHIPSET_TEMP: return(new SgetDatapointDefinition(new Guid("32B9D71C-FAE4-459A-B55C-F90043B36FD5"), UicUriBuilder.DatapointFrom(_edm, item.ToString()), UicDataType.Double, "Chipset Temperature", string.Empty)); case BoardInformationValueId.EAPI_ID_HWMON_SYSTEM_TEMP: return(new SgetDatapointDefinition(new Guid("2B82E7FC-5CF9-47D7-8628-165E41A4D270"), UicUriBuilder.DatapointFrom(_edm, item.ToString()), UicDataType.Double, "System Temperature", string.Empty)); case BoardInformationValueId.EAPI_ID_HWMON_VOLTAGE_VCORE: return(new SgetDatapointDefinition(new Guid("EA36D432-D3AA-4FE6-BF1A-5F426391AF29"), UicUriBuilder.DatapointFrom(_edm, item.ToString()), UicDataType.Integer, "VCore Voltage", string.Empty)); case BoardInformationValueId.EAPI_ID_HWMON_VOLTAGE_2V5: return(new SgetDatapointDefinition(new Guid("86AF29CE-1B16-4389-BE3E-B16177AEE8E0"), UicUriBuilder.DatapointFrom(_edm, item.ToString()), UicDataType.Integer, "2V5 Voltage", string.Empty)); case BoardInformationValueId.EAPI_ID_HWMON_VOLTAGE_3V3: return(new SgetDatapointDefinition(new Guid("2C4BCA30-D414-44E2-8175-4D8EA4FD9AD9"), UicUriBuilder.DatapointFrom(_edm, item.ToString()), UicDataType.Integer, "3V3 Voltage", string.Empty)); case BoardInformationValueId.EAPI_ID_HWMON_VOLTAGE_VBAT: return(new SgetDatapointDefinition(new Guid("1F2B7CFA-4B49-438A-AE0D-D1FC05619C8A"), UicUriBuilder.DatapointFrom(_edm, item.ToString()), UicDataType.Integer, "VBat Voltage", string.Empty)); case BoardInformationValueId.EAPI_ID_HWMON_VOLTAGE_5V: return(new SgetDatapointDefinition(new Guid("306D9B8C-47B9-471E-BFCE-46D91379495A"), UicUriBuilder.DatapointFrom(_edm, item.ToString()), UicDataType.Integer, "5mV Voltage", string.Empty)); case BoardInformationValueId.EAPI_ID_HWMON_VOLTAGE_5VSB: return(new SgetDatapointDefinition(new Guid("9BDDE406-2A79-49FC-A00E-0125855BD7E9"), UicUriBuilder.DatapointFrom(_edm, item.ToString()), UicDataType.Integer, "5VSB Voltage", string.Empty)); case BoardInformationValueId.EAPI_ID_HWMON_VOLTAGE_12V: return(new SgetDatapointDefinition(new Guid("442911D3-BE9B-4128-80CF-002AEAAD1D61"), UicUriBuilder.DatapointFrom(_edm, item.ToString()), UicDataType.Integer, "12V Voltage", string.Empty)); case BoardInformationValueId.EAPI_ID_HWMON_FAN_CPU: return(new SgetDatapointDefinition(new Guid("1DB26A04-AE5A-4802-9755-9E411D4B7081"), UicUriBuilder.DatapointFrom(_edm, item.ToString()), UicDataType.Integer, "CPU Fan", string.Empty)); case BoardInformationValueId.EAPI_ID_HWMON_FAN_SYSTEM: return(new SgetDatapointDefinition(new Guid("04AEECAC-C183-4910-9C2F-7C1E9C4643B8"), UicUriBuilder.DatapointFrom(_edm, item.ToString()), UicDataType.Integer, "System Fan", string.Empty)); default: throw new ArgumentOutOfRangeException(nameof(item), item, null); } }
private List <CommandDefinition> GetCommands() { var cmd = "read"; return(new List <CommandDefinition> { new SgetCommandDefinition(new Guid("{4601d9f3-eb49-45a3-9b46-ef6faf2ebf7d}"), UicUriBuilder.CommandFrom(_edm, cmd), "Read Board Information", cmd, UicDataType.String, String.Empty, null, new string[0]) }); }
private AttributeDefinition GetAttributeDefinitionOf(BoardInformationStringId item) { switch (item) { case BoardInformationStringId.EAPI_ID_BOARD_MANUFACTURER_STR: return(new SgetAttributDefinition(new Guid("{6beb6a88-8061-4bdf-a900-1efd70a6686d}"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "MANUFACTURER", UicDataType.String, String.Empty)); case BoardInformationStringId.EAPI_ID_BOARD_NAME_STR: return(new SgetAttributDefinition(new Guid("{22e6f4fe-03e7-4c6d-b6f5-5cbf0ab9f9c6}"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "NAME", UicDataType.String, String.Empty)); case BoardInformationStringId.EAPI_ID_BOARD_REVISION_STR: return(new SgetAttributDefinition(new Guid("{c0adb64c-5a8a-4653-b42f-580b19a60d1c}"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "REVISION", UicDataType.String, String.Empty)); case BoardInformationStringId.EAPI_ID_BOARD_SERIAL_STR: return(new SgetAttributDefinition(new Guid("{a65a6538-96d1-4525-b0f2-5059dfa38e0e}"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "SERIAL", UicDataType.String, String.Empty)); case BoardInformationStringId.EAPI_ID_BOARD_BIOS_REVISION_STR: return(new SgetAttributDefinition(new Guid("{ffd2c0a2-c3be-43b6-8fbf-3a3bd962356c}"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "BIOS_REVISION", UicDataType.String, String.Empty)); case BoardInformationStringId.EAPI_ID_BOARD_HW_REVISION_STR: return(new SgetAttributDefinition(new Guid("{edb7802a-5e66-4b24-8e6e-4e2876b772f1}"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "HW_REVISION", UicDataType.String, String.Empty)); case BoardInformationStringId.EAPI_ID_BOARD_PLATFORM_TYPE_STR: return(new SgetAttributDefinition(new Guid("{ec7a1668-353f-471b-a3fe-32ce072701c8}"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "PLATFORM_TYPE", UicDataType.String, String.Empty)); default: throw new ArgumentOutOfRangeException(nameof(item), item, null); } }
private AttributeDefinition GetAttributeDefinitionOf(BoardInformationValueId item) { switch (item) { case BoardInformationValueId.EAPI_ID_GET_EAPI_SPEC_VERSION: return(new SgetAttributDefinition(new Guid("577FEDB1-9D53-421B-9821-104E04D97343"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "EAPI_SPEC_VERSION", UicDataType.Integer, string.Empty)); case BoardInformationValueId.EAPI_ID_BOARD_PNPID_VAL: return(new SgetAttributDefinition(new Guid("61C8382D-CF27-4F53-B06C-40BC458DBE2A"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "BOARD_PNPID", UicDataType.Integer, string.Empty)); case BoardInformationValueId.EAPI_ID_BOARD_PLATFORM_REV_VAL: return(new SgetAttributDefinition(new Guid("EE24F7B9-46AA-41E7-902D-A20AB316172D"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "PLATFORM_REV", UicDataType.Integer, string.Empty)); case BoardInformationValueId.EAPI_ID_BOARD_DRIVER_VERSION_VAL: return(new SgetAttributDefinition(new Guid("D257CEFB-BA12-4637-988F-78BB8FE79BB9"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "DRIVER_VERSION", UicDataType.Integer, string.Empty)); case BoardInformationValueId.EAPI_ID_BOARD_LIB_VERSION_VAL: return(new SgetAttributDefinition(new Guid("B2BAC5B4-48B7-4F85-BC25-3384B2B9C415"), UicUriBuilder.AttributeFrom(_edm, item.ToString()), "LIB_VERSION", UicDataType.Integer, string.Empty)); case BoardInformationValueId.EAPI_ID_BOARD_BOOT_COUNTER_VAL: case BoardInformationValueId.EAPI_ID_BOARD_RUNNING_TIME_METER_VAL: case BoardInformationValueId.EAPI_ID_HWMON_CPU_TEMP: case BoardInformationValueId.EAPI_ID_HWMON_CHIPSET_TEMP: case BoardInformationValueId.EAPI_ID_HWMON_SYSTEM_TEMP: case BoardInformationValueId.EAPI_ID_HWMON_VOLTAGE_VCORE: case BoardInformationValueId.EAPI_ID_HWMON_VOLTAGE_2V5: case BoardInformationValueId.EAPI_ID_HWMON_VOLTAGE_3V3: case BoardInformationValueId.EAPI_ID_HWMON_VOLTAGE_VBAT: case BoardInformationValueId.EAPI_ID_HWMON_VOLTAGE_5V: case BoardInformationValueId.EAPI_ID_HWMON_VOLTAGE_5VSB: case BoardInformationValueId.EAPI_ID_HWMON_VOLTAGE_12V: case BoardInformationValueId.EAPI_ID_HWMON_FAN_CPU: case BoardInformationValueId.EAPI_ID_HWMON_FAN_SYSTEM: return(null); default: throw new ArgumentOutOfRangeException(nameof(item), item, null); } }
public PstUicProject(ILoggerFactory loggerFactory) : base( "26895846c960465ebd89f28d10e6460c", "JU Test", "Main JU Test Project", "SGeT", Guid.NewGuid(), new List <SgetAttributDefinition>(), new List <SgetProjectDatapointTask>()) { EapiBoardInformationEdm eapiBoardInformation = new EapiBoardInformationEdm(); foreach (var attr in eapiBoardInformation.GetCapability().AttributeDefinitions) { Attributes.Add(attr); } // TODO: commands from EapiGPIO MockupEdm mockupEdm = new MockupEdm(loggerFactory); DatapointTasks.Add(new SgetProjectDatapointTask( new SgetDatapointDefinition(new Guid("{83f02bea-c22b-46aa-b1c2-4ab8102d8a80}"), UicUriBuilder.DatapointFrom(mockupEdm, "Bool_mock"), UicDataType.Bool, "Random Bool", "Digital input mockup"), new SgetDatapointTaskReportingCondition(50, -1, 50000), 10, new SgetDatapointTaskMetadata(0, 0, 0, 0, false, "SwitchButton"), "Random Bool")); DatapointTasks.Add(new SgetProjectDatapointTask( new SgetDatapointDefinition(new Guid("{4087d40d-d4e2-42b1-89a4-9b9d18499a04}"), UicUriBuilder.DatapointFrom(mockupEdm, "Integer_mock"), UicDataType.Integer, "Random Integer", "Integer measurement mockup"), new SgetDatapointTaskReportingCondition(50, 0, 30000), 5, new SgetDatapointTaskMetadata(0, 0, 0, 0, false, "SimpleValue"), "Random Integer")); }
private AttributeDefinition[] ConstructAttributes() { var attributes = new List <AttributeDefinition>(); attributes.Add(new SgetAttributDefinition(new Guid("(b68df3f9-4748-4c9d-9bda-567c87fab855)"), UicUriBuilder.AttributeFrom(this, "timestamp"), "Timestamp", UicDataType.String, "Simple DateTime string")); return(attributes.ToArray()); }
private DatapointDefinition[] ConstructDatapoints(out DatapointDefinition boolDatapoint) { var datapoints = new List <DatapointDefinition>(); boolDatapoint = new SgetDatapointDefinition(new Guid("{83f02bea-c22b-46aa-b1c2-4ab8102d8a80}"), UicUriBuilder.DatapointFrom(this, "Bool_mock"), UicDataType.Bool, "Random Bool", "Digital input mockup"); datapoints.Add(boolDatapoint); datapoints.Add(new SgetDatapointDefinition(new Guid("{4087d40d-d4e2-42b1-89a4-9b9d18499a04}"), UicUriBuilder.DatapointFrom(this, "Integer_mock"), UicDataType.Integer, "Random Integer", "Integer measurement mockup")); datapoints.Add(new SgetDatapointDefinition(new Guid("{a41fc3af-4f73-42bf-8290-43ed883edd8f}"), UicUriBuilder.DatapointFrom(this, "Double_mock"), UicDataType.Double, "Random Double", "Double measurement mockup")); datapoints.Add(new SgetDatapointDefinition(new Guid("{3b20829f-cc30-4923-a2d6-30502ccb9acd}"), UicUriBuilder.DatapointFrom(this, "Gps_mock"), UicDataType.Gps, "Random GPS", "geo location mockup")); datapoints.Add(new SgetDatapointDefinition(new Guid("{fbd3e390-ffb7-455b-b0dc-695b13329eb6}"), UicUriBuilder.DatapointFrom(this, "String_mock"), UicDataType.String, "Random String", "messaging mockup")); return(datapoints.ToArray()); }