laatzen/Common/Hardware/WaterMeter/eRegister/Common.Hardware.WaterMeter.eRegister/Features/DebugCmd.cs
2025-01-24 12:10:40 +01:00

99 lines
3.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace Common.Hardware.WaterMeter.eRegister.Features
{
public class DebugCmd : Pam
{
protected DebugCmd(byte code) : base(3, GetDebug)
=> this.bytes[2] = code;
public override string CmdHex => $"{base.CmdHex}-{this.bytes[2]:X2}";
public static implicit operator byte[](DebugCmd cmd) => cmd.bytes;
/// <summary>
/// No action accept sending Debug Telegram
/// </summary>
protected const byte RequestDebugTelegram = 0;
/// <summary>
/// Change from Production Mode to Shipment Mode. 1 = Shipment
/// </summary>
protected const byte State = 1;
/// <summary>
/// Resets the activity and authentication credits
/// </summary>
protected const byte ResetCredits = 3;
/// <summary>
/// Disables the activity and authentication credits.
/// Does not persist throug power cycles.
/// </summary>
protected const byte DisableCredits = 4;
/// <summary>
/// Toggles routing received packets out the serial port
/// </summary>
protected const byte SerialOutput = 5;
/// <summary>
/// Bit field following the Alarm byte definition. 1 indicates setting the alarm.
/// Only currently enabled Alarms can be set.
/// </summary>
internal const byte SetAlarms = 6;
/// <summary>
/// Turns on the indicated Specific Error Flag
/// </summary>
protected const byte SetSpecificError = 7;
/// <summary>
/// Number of minutes to send LED data 0 will shut down the optical data.
/// </summary>
internal const byte OpticalTelegram = 8;
/// <summary>
/// Restores most NV to default except radio ID, PCB ID, calibrations and metrology data Beta FW only
/// </summary>
protected const byte FactoryComplete = 9;
/// <summary>
/// Restores counter settings controlled changed by the Deactivate Counter command.
/// </summary>
internal const byte EnableCredits = 10;
/// <summary>
/// Used to offset the present battery consumption level to allow simulation of Low Battery,
/// Very Low Battery and End of Life testing.Not intended to be used except in a test environment.
/// </summary>
protected const byte SetBatteryUsageTestOffset = 11;
/// <summary>
/// Used for testing OTA software updates. Not intended to be used except in a test environment.
/// </summary>
protected const byte SetTestFastActivityBupTiming = 12;
/// <summary>
/// Used to change the number of activity credits allowed in a 24 hour period for each mode of operation.
/// </summary>
protected const byte SetActivityCreditLimits = 13;
/// <summary>
/// 0 Set to Default Rotations value of 8 (8*10) Rotations
/// 1 - 255 Increments of 10 * setting which translates to(10 to 2550) Rotations.
/// </summary>
internal const byte SetActivationByThreshold = 15;
/// <summary>
/// 1 Disables Firmware Update.
/// 2 Enable Firmware Update (Only available in Beta Firmware and when the unit is not Sealed (Production Mode)).
/// </summary>
internal const byte DisableOTA = 16;
/// <summary>
/// 0 Residential Meter: Meter Type reported in SEMI is set to 10 and Flow Reporting is limited to +/-32767.
/// 1 C & I Meter: Meter Type in SEMI is set to 12 and Flow Reporting is exponentially compressed to fit into a 16 bit report value.
/// </summary>
internal const byte MeterType = 17;
}
}