internal uint GetBoardInformationOf(BoardInformationValueId boardInformationValueId)
        {
            uint value      = 0;
            uint resultCode = EApiBoardGetValue((uint)boardInformationValueId, ref value);

            if (_eApiStatusCodes.IsUnsupported(resultCode))
            {
                throw new NotSupportedException(boardInformationValueId.ToString());
            }

            if (!_eApiStatusCodes.IsSuccess(resultCode))
            {
                throw new Exception(_eApiStatusCodes.GetStatusStringFrom(resultCode));
            }

            if (boardInformationValueId == BoardInformationValueId.EAPI_ID_HWMON_CHIPSET_TEMP ||
                boardInformationValueId == BoardInformationValueId.EAPI_ID_HWMON_CPU_TEMP ||
                boardInformationValueId == BoardInformationValueId.EAPI_ID_HWMON_SYSTEM_TEMP)
            {
                return(EAPI_DECODE_CELCIUS(value));
            }
            return(value);
        }
Exemple #2
0
        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);
            }
        }
Exemple #3
0
        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);
            }
        }