125 lines
5.4 KiB
C#
125 lines
5.4 KiB
C#
using System;
|
||
|
||
namespace Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol.Consts
|
||
{
|
||
|
||
/// <summary>
|
||
/// Commands that the genesis meter support over the request protocol.
|
||
/// Functional Specification Breeze Core and Applications Revision:3.03(12748DOC11 - functional spec ICOE472.pdf)
|
||
/// </summary>
|
||
public static class Commands
|
||
{
|
||
/// <summary>
|
||
/// 9.2.5
|
||
///Command 0x00 (NOP)
|
||
///This command will do nothing, and will have no response.
|
||
/// </summary>
|
||
public const Byte Nop = 0x00;
|
||
/// <summary>
|
||
/// 9.2.6
|
||
/// Command 0x01 (Query capabilities)
|
||
/// This command will be used by the external computer to discover the protocol parameters that may be varied.
|
||
/// These can then be compared with the external computer’s capabilities and the best match selected.
|
||
/// </summary>
|
||
public const Byte QueryCaps = 0x01;
|
||
/// <summary>
|
||
/// response on <see cref="QueryCaps"/>
|
||
/// </summary>
|
||
public const Byte QueryCapsReply = 0x02;
|
||
/// <summary>
|
||
/// 9.2.7
|
||
/// Command 0x03 (Set capabilities)
|
||
/// Used to finalize the baud rate and packet settings after negotiation.
|
||
/// The reply will be sent at the currently selected baud rate and packet length,
|
||
/// after which the settings will take effect
|
||
/// </summary>
|
||
public const Byte SetCaps = 0x03;
|
||
/// <summary>
|
||
/// response on <see cref="SetCaps"/>
|
||
/// </summary>
|
||
public const Byte SetCapsReply = 0x04;
|
||
/// <summary>
|
||
/// 9.2.8
|
||
/// Command 0x05 (Train)
|
||
///This command will perform target driven data training, that is, where the target is in control of the data flow.
|
||
///See also command 0x11.
|
||
/// </summary>
|
||
public const Byte Train = 0x05;
|
||
/// <summary>
|
||
/// response on <see cref="Train"/>
|
||
/// </summary>
|
||
public const Byte TrainReply = 0x06;
|
||
/// <summary>
|
||
/// 9.2.9
|
||
/// Command 0x07 (Repeat last)
|
||
/// Used by the external computer to request the last response to be resent, for example if it was found to be corrupted.
|
||
/// Note that the response 0x08 will never be sent, the reply to command 0x07 will be a verbatim resend of the last response.
|
||
/// </summary>
|
||
public const Byte RepeatLast = 0x07;
|
||
/// <summary>
|
||
/// response on <see cref="RepeatLast"/>
|
||
/// </summary>
|
||
public const Byte RepeatLastReply = 0x08;
|
||
/// <summary>
|
||
/// 9.2.10
|
||
///Command 0x09 (Read data)
|
||
///This command makes reads of any random selection of configuration registers, up to the maximum packet size negotiated.
|
||
/// </summary>
|
||
public const Byte ReadData = 0x09;
|
||
/// <summary>
|
||
/// response on <see cref="ReadData"/>
|
||
/// </summary>
|
||
public const Byte ReadDataReply = 0x0A;
|
||
/// <summary>
|
||
/// 9.2.11
|
||
/// Command 0x0B (Write data)
|
||
/// This command makes writes to any random selection of configuration registers, up to the maximum packet size negotiated.
|
||
/// </summary>
|
||
public const Byte WriteData = 0x0B;
|
||
/// <summary>
|
||
/// response on <see cref="WriteData"/>
|
||
/// </summary>
|
||
public const Byte WriteDataReply = 0x0C;
|
||
/// <summary>
|
||
/// 9.2.12
|
||
///Command 0x0D (Multiple read data)
|
||
///This command makes reads of one register multiple times, which will be more efficient than performing successive reads using command 0x09.
|
||
///This command will be available from protocol version 0.40, for earlier protocol versions command 0x09 should be used.
|
||
/// </summary>
|
||
public const Byte MultipleReadData = 0x0D;
|
||
/// <summary>
|
||
/// response on <see cref="MultipleReadData"/>
|
||
/// </summary>
|
||
public const Byte MultipleReadDataReply = 0x0E;
|
||
/// <summary>
|
||
/// 9.2.13
|
||
/// Command 0x0F (Multiple write data)
|
||
/// This command makes writes to one register multiple times, which will be more efficient than performing successive reads using command 0x0B.
|
||
/// This command will be available from protocol version 0.40, for earlier protocol versions command 0x0B should be used.
|
||
/// </summary>
|
||
public const Byte MultipleWriteData = 0x0F;
|
||
/// <summary>
|
||
/// response on <see cref="MultipleWriteData"/>
|
||
/// </summary>
|
||
public const Byte MultipleWriteDataReply = 0x10;
|
||
/// <summary>
|
||
/// 9.2.14
|
||
/// Command 0x11 (Set level)
|
||
/// This command will perform external driven data training, that is, where the external computer is in control of the data flow.
|
||
/// This command will be available from protocol version 0.42, for earlier protocol versions command 0x05 should be used.
|
||
/// </summary>
|
||
public const Byte SetLevel = 0x11;
|
||
/// <summary>
|
||
/// response on <see cref="SetLevel"/>
|
||
/// </summary>
|
||
public const Byte SetLevelReply = 0x12;
|
||
|
||
//todo remove?
|
||
//public const byte SetBitrateLsb = 0x03;
|
||
//public const byte SetBitrateMsb = 0x05;
|
||
//public const byte SetPacketSizesLsb = 0x04;
|
||
//public const byte SetPacketSizesMsb = 0x05;
|
||
//public const byte SetProtocolLsb = 0x02;
|
||
//public const byte SetProtocolMsb = 0x05;
|
||
}
|
||
} |