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())); }
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); } }
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 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()); }