public override void WriteConsole(ConsoleOutputStyle style) { ConsoleOutputStyle = style; WriteConsoleHeader(false); WriteConsoleEntry("Manufacturer ID", ManufacturerId.ToString()); WriteConsoleEntry("Manufacturer Name", ManufacturerName); WriteConsoleEntry("Manufacturer Model", ManufacturerModel.ToString()); WriteConsoleEntry("Specification version", SpecificationVersion); WriteConsoleEntry("Specification level", SpecificationLevel.ToString()); WriteConsoleEntry("Specification revision", SpecificationRevision.ToString()); WriteConsoleEntry("Specification date", SpecificationDate.ToString("d")); WriteConsoleEntry("Platform-specific family", PlatformSpecificFamily); WriteConsoleEntry("Platform specification level", PlatformSpecificationLevel.ToString()); WriteConsoleEntry("Platform specification revision", PlatformSpecificationRevision.ToString()); WriteConsoleEntry("Platform specification date", PlatformSpecificationDate.ToString("d")); WriteConsoleEntry("Firmware version", FirmwareVersion.ToString()); WriteConsoleEntry("Physical presence version", PhysicalPresenceVersion); WriteConsoleEntry("Memory management", MemoryManagement); WriteConsoleEntry("Supported modes", SupportedModes); WriteConsoleEntry("Permanent attributes", PermanentAttributes); WriteConsoleEntry("Startup attributes", StartupAttributes); }
/// <summary> /// Return a JSON representation of this object. /// </summary> /// <param name="CustomEnergyMeterSerializer">A delegate to serialize custom energy meter JSON objects.</param> public JObject ToJSON(CustomJObjectSerializerDelegate <EnergyMeter> CustomEnergyMeterSerializer = null) { var JSON = JSONObject.Create( new JProperty("id", Id.ToString()), Model.IsNotNullOrEmpty() ? new JProperty("model", Model.ToString()) : null, HardwareVersion.IsNotNullOrEmpty() ? new JProperty("hardware_version", HardwareVersion.ToString()) : null, FirmwareVersion.IsNotNullOrEmpty() ? new JProperty("firmware_version", FirmwareVersion.ToString()) : null, Vendor.IsNotNullOrEmpty() ? new JProperty("vendor", Vendor.ToString()) : null, PublicKey.HasValue ? new JProperty("public_key", PublicKey.ToString()) : null, PublicKeyCertificate.IsNotNullOrEmpty() ? new JProperty("public_key_certificate", PublicKeyCertificate.ToString()) : null ); return(CustomEnergyMeterSerializer != null ? CustomEnergyMeterSerializer(this, JSON) : JSON); }