Class Sealed
public sealed class EmulatorConfiguration

Namespace: SharpMeter.Emulator

Configuration for the PSEM meter emulator.

Properties

NameDescription
FirmwareVersion Gets or sets the firmware version [major, minor, build, patch].
HardwareRevision Gets or sets the hardware revision number.
HardwareVersion Gets or sets the hardware version number.
Manufacturer Gets or sets the emulated manufacturer name (4 chars, per ST1).
MaxPackets Gets or sets the maximum number of packets.
MaxPacketSize Gets or sets the maximum packet size.
Mode Gets or sets the meter mode.
Model Gets or sets the meter model type.
ModelString Gets or sets the emulated model string (8 chars, per ST1).
Password Gets or sets the security password (up to 20 bytes). Empty means no authentication required.
ProcedureAccessLevel Gets or sets the minimum access level required for procedure execution.
ReadAccessLevel Gets or sets the minimum access level required for table reads.
SerialNumber Gets or sets the emulated serial number (16 chars, per ST1).
Target Gets or sets the target utility type.
Upgrades Gets or sets the active softswitch upgrades.
WriteAccessLevel Gets or sets the minimum access level required for table writes.

FirmwareVersion

byte[] EmulatorConfiguration.FirmwareVersion { get; set; }

Gets or sets the firmware version [major, minor, build, patch].

HardwareRevision

byte EmulatorConfiguration.HardwareRevision { get; set; }

Gets or sets the hardware revision number.

HardwareVersion

byte EmulatorConfiguration.HardwareVersion { get; set; }

Gets or sets the hardware version number.

Manufacturer

string EmulatorConfiguration.Manufacturer { get; set; }

Gets or sets the emulated manufacturer name (4 chars, per ST1).

MaxPackets

byte EmulatorConfiguration.MaxPackets { get; set; }

Gets or sets the maximum number of packets.

MaxPacketSize

ushort EmulatorConfiguration.MaxPacketSize { get; set; }

Gets or sets the maximum packet size.

Mode

MeterMode EmulatorConfiguration.Mode { get; set; }

Gets or sets the meter mode.

Model

MeterModel EmulatorConfiguration.Model { get; set; }

Gets or sets the meter model type.

ModelString

string EmulatorConfiguration.ModelString { get; set; }

Gets or sets the emulated model string (8 chars, per ST1).

Password

byte[] EmulatorConfiguration.Password { get; set; }

Gets or sets the security password (up to 20 bytes). Empty means no authentication required.

ProcedureAccessLevel

AccessLevel EmulatorConfiguration.ProcedureAccessLevel { get; set; }

Gets or sets the minimum access level required for procedure execution.

ReadAccessLevel

AccessLevel EmulatorConfiguration.ReadAccessLevel { get; set; }

Gets or sets the minimum access level required for table reads.

SerialNumber

string EmulatorConfiguration.SerialNumber { get; set; }

Gets or sets the emulated serial number (16 chars, per ST1).

Target

MeterTarget EmulatorConfiguration.Target { get; set; }

Gets or sets the target utility type.

Upgrades

SoftswitchUpgrade EmulatorConfiguration.Upgrades { get; set; }

Gets or sets the active softswitch upgrades.

WriteAccessLevel

AccessLevel EmulatorConfiguration.WriteAccessLevel { get; set; }

Gets or sets the minimum access level required for table writes.

View Source
/// <summary>
///     Configuration for the PSEM meter emulator.
/// </summary>
public sealed class EmulatorConfiguration
{
#region Identity
    /// <summary>Gets or sets the emulated manufacturer name (4 chars, per ST1).</summary>
    public string Manufacturer { get; set; } = "MOKA";
    /// <summary>Gets or sets the emulated model string (8 chars, per ST1).</summary>
    public string ModelString { get; set; } = "EMULATOR";
    /// <summary>Gets or sets the emulated serial number (16 chars, per ST1).</summary>
    public string SerialNumber { get; set; } = "0000000000000001";

    /// <summary>Gets or sets the firmware version [major, minor, build, patch].</summary>
    [SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "Configuration DTO used for testing; array simplifies initialization.")]
    public byte[] FirmwareVersion { get; set; } = [1, 0, 0, 0];
    /// <summary>Gets or sets the hardware version number.</summary>
    public byte HardwareVersion { get; set; } = 1;
    /// <summary>Gets or sets the hardware revision number.</summary>
    public byte HardwareRevision { get; set; }

#endregion
#region Security
    /// <summary>Gets or sets the security password (up to 20 bytes). Empty means no authentication required.</summary>
    [SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "Configuration DTO used for testing; array simplifies binary data handling.")]
    public byte[] Password { get; set; } = [];
    /// <summary>Gets or sets the minimum access level required for table reads.</summary>
    public AccessLevel ReadAccessLevel { get; set; } = AccessLevel.NoAccess;
    /// <summary>Gets or sets the minimum access level required for table writes.</summary>
    public AccessLevel WriteAccessLevel { get; set; } = AccessLevel.Reader;
    /// <summary>Gets or sets the minimum access level required for procedure execution.</summary>
    public AccessLevel ProcedureAccessLevel { get; set; } = AccessLevel.Master;
#endregion
#region Meter Configuration
    /// <summary>Gets or sets the target utility type.</summary>
    public MeterTarget Target { get; set; } = MeterTarget.Electric;
    /// <summary>Gets or sets the meter model type.</summary>
    public MeterModel Model { get; set; } = MeterModel.Generic;
    /// <summary>Gets or sets the meter mode.</summary>
    public MeterMode Mode { get; set; } = MeterMode.DemandOnly;
    /// <summary>Gets or sets the active softswitch upgrades.</summary>
    public SoftswitchUpgrade Upgrades { get; set; } = SoftswitchUpgrade.None;
    /// <summary>Gets or sets the maximum packet size.</summary>
    public ushort MaxPacketSize { get; set; } = 128;
    /// <summary>Gets or sets the maximum number of packets.</summary>
    public byte MaxPackets { get; set; } = 254;
#endregion
}
Was this page helpful?