Files
T
2024-10-14 15:02:21 +02:00

250 lines
7.0 KiB
C#

namespace Common.Hardware.WaterMeter.eRegister.Features
{
using System;
public abstract class Pam
{
protected Byte[] bytes;
public Pam(Int32 length, Byte cmd)
{
this.bytes = new Byte[length];
this.bytes[0] = cmd;
}
public Pam Append(Pam pam)
{
var appendBytes = pam.ToByteArray();
var appendLength = appendBytes.Length;
var currentLength = this.bytes.Length;
var newLength = currentLength + appendLength;
Array.Resize(ref this.bytes, newLength);
Array.Copy(appendBytes, 0, this.bytes, currentLength, appendLength);
return this;
}
public virtual Byte[] ToByteArray()
=> this.bytes;
public static implicit operator Byte[] (Pam pam)
=> pam.ToByteArray();
/// <summary>
/// 0 Change Wake Up 1 no 2
/// </summary>
public const Byte ChangeWakeUpMode = 0;
/// <summary>
/// 1 Set power level 1 no (Production Mode for SensusRF Power Level) 3 (For setting FlexNet Power Level)
/// </summary>
public const Byte SetPowerLevel = 1;
/// <summary>
/// 2* Change number of LAT Windows N 1 no 2
/// </summary>
public const Byte ChangeLATWindowsN = 2;
/// <summary>
/// 3 Reset Alarms 1 no 1
/// </summary>
public const Byte ResetAlarms = 3;
/// <summary>
/// 4 Deactivate Transmitter 1 yes 2
/// </summary>
public const Byte DeactivateTransmitter = 4;
/// <summary>
/// 5* Wireless MBus Mode 1 no 2
/// </summary>
public const Byte ChangeWirelessMBusMode = 5;
/// <summary>
/// 6* Deactivate Alarms 1 no 0
/// </summary>
public const Byte DeactivateAlarms = 6;
/// <summary>
/// 7* Change Number of Dials 1 no 0
/// </summary>
public const Byte ChangeNimberOfDeals = 7;
/// <summary>
/// 10 Parameterize LeakageDetection 1 no 0
/// </summary>
public const Byte ParameterizeLeakageDetection = 10;
/// <summary>
/// 11 Parameterize BrokenPipe-Detection 1 no 0
/// </summary>
public const Byte ParameterizeBrokenPipeDetection = 11;
/// <summary>
/// 12* Set historical error limit (alarm persistence) 1 no 1
/// </summary>
public const Byte SetHistoricalErrorLimit = 12;
/// <summary>
/// 14 Reset 1 yes 3
/// </summary>
public const Byte Reset = 14;
/// <summary>
/// 16* Change Transmission Interval 2 no 2
/// </summary>
public const Byte ChangeTransmitionInterval = 16;
/// <summary>
/// 17* Open Metering Transmission Interval (Wireless MBus) 2 no 2
/// </summary>
public const Byte WMBusTransmisionInterval = 17;
/// <summary>
/// 19 Send Bubble Up Burst 2 yes 3
/// </summary>
public const Byte SendBubbleUpBurst = 19;
/// <summary>
/// 20 Set frequency offset 2 yes 3
/// </summary>
public const Byte SetFrequencyOffset = 20;
/// <summary>
/// 21 Activate Metrology Test Mode 2 no 1
/// </summary>
public const Byte ActivateMetrologyTestMode = 21;
/// <summary>
/// 22 Set Reboot Count 2 no? (Production Mode) 3
/// </summary>
public const Byte SetRebootCount = 22;
/// <summary>
/// 31 Get debug 2 yes 3
/// </summary>
public const Byte GetDebug = 31;
/// <summary>
/// 32 Change Fixed Date Reading Settings 3 no 0
/// </summary>
public const Byte ChangeFixedDateReadingSettings = 32;
/// <summary>
/// 33 Get Customer Debug 2 yes 2
/// </summary>
public const Byte GetCustomerDebug = 33;
/// <summary>
/// 48 Change Meter Reading 4 no(Production Mode) 3
/// </summary>
public const Byte ChangeMeterReading = 48;
/// <summary>
/// 49 Change Meter-ID 4 no(Production Mode) 3
/// </summary>
public const Byte ChangeMeterId = 49;
/// <summary>
/// 50 Set date and time 4 no 1
/// </summary>
public const Byte SetDateAndTime = 50;
/// <summary>
/// 51 Change settings for data logger 4 no 0
/// </summary>
public const Byte ChangeDataLoggerSettings = 51;
/// <summary>
/// 52 Set Battery Seconds (Time Alive) 4 no 3
/// </summary>
public const Byte SetBatterySeconds = 52;
/// <summary>
/// 53 Change Radio ID 4 no 3
/// </summary>
public const Byte ChangeRadioId = 53;
/// <summary>
/// 54 Set PCB ID 4 no? (Serial Only, Production Mode) 3
/// </summary>
public const Byte SetPCB = 54;
/// <summary>
/// 64 Request Fixed Date Reading 5 yes 0
/// </summary>
public const Byte RequestFixedDateReading = 64;
/// <summary>
/// 65 Request Logging Data 5 yes 0
/// </summary>
public const Byte RequestLoggingData = 65;
/// <summary>
/// 66 Change PIN 5 yes 1, 2, 3
/// </summary>
public const Byte ChangePin = 66;
/// <summary>
/// 67* Provide PIN 5 no 0
/// </summary>
public const Byte ProvidePin = 67;
/// <summary>
/// 68 Send Test Pattern 6 yes 3
/// </summary>
public const Byte SendTestPattern = 68;
/// <summary>
/// 69 Request Memory Dump 6 yes 3
/// </summary>
public const Byte MemoryDump = 69;
/// <summary>
/// 72 Send Sequence of Test-Telegrams 7 yes 3
/// </summary>
public const Byte SendSequenceOfTestTelegrams = 72;
/// <summary>
/// 73 Receive Sequence of Test-Telegrams 7 yes 3
/// </summary>
public const Byte ReceiveSequenceOfTestTelegrams = 73;
/// <summary>
/// 80 Change Customer Text 9 no 2
/// </summary>
public const Byte ChangeCustomerText = 80;
/// <summary>
/// 108 Change SensusRF Encryption Key 16 no 2
/// </summary>
public const Byte ChangeSensusRFEncryptionKey = 108;
/// <summary>
/// 144 Encapsulated FlexNet variable yes 0
/// </summary>
public const Byte EncapsulatedFlexNet = 144;
/// <summary>
/// 145 Set TFX Parameters TBD no 0 Yes
/// </summary>
public const Byte TFXParameters = 145;
/// <summary>
/// 146 Set Metrology Parameters 16 yes(Production Mode) 3
/// </summary>
public const Byte MetrologyParameters = 146;
/// <summary>
/// 147 Ping variable yes 0 Yes
/// </summary>
public const Byte Ping = 147;
/// <summary>
/// 148 Set Variable PCB ID variable no 3
/// </summary>
public const Byte SetVariablePcbId = 148;
}
}