Xylem.Common.Hardware.WaterMeter.Genesis.Protocols.RequestProtocol
Commands that the genesis meter support over the request protocol.
Functional Specification Breeze Core and Applications Revision:3.03(12748DOC11 - functional spec ICOE472.pdf)
9.2.5
Command 0x00 (NOP)
This command will do nothing, and will have no response.
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.
response on
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
response on
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.
response on
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.
response on
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.
response on
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.
response on
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.
response on
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.
response on
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.
response on
Config Exchange error codes.
Transport errors for request protocol
List of constance for error codes from genesis meter
everything is fine
Port is not open
fails to write to serial port
fails to read from serial port
Command is to long
deeper exception, check out log if this happen
wrong CRC
something strange
Timeout occur
Acknowledge feedback from meter after communication
Acknowledge code for unassigned command
Will be used initially as the record is not sent
Response missing
Response command not match the required command
Lost connection (logged out from meter), a re-authorization is required
to access this command and/or register
Meter error received, a retry may be useful
The response record couldn't be decoded
The meter sent a wakeup message instead of the required data
Valid meter response record
Holds all errors can occur on the request protocol
Exception occurred on this command
Exception occurred while receiving this data
Error is interpreted and has a define error code
if its not null is Genesis.Protocols.Request.Const.ConfigExErrors
Error is interpreted and has a define error code
if its not null is Genesis.Protocols.Request.Const.HighLevelError
Ctor with only message
error message
Ctor with message and
error message
Ctor with message, and
error message
Holds request commands with detail parameters to see processing state
Indicates the base command
the register the command refers to.
needed to set Register dictionary to link response with dictionary key
Command acknowledged
Retry counter
Wakeup-message retry counter
indicates error base on
indicates error reason on
Combined error code of base and reason
Chunk position of error on multiple read/write access
Data containing the request protocol
Encoded with transmit protocol, ready to stream to port as is
Extracted payload of response
Extracted payload of response
avoid logging for e.g. password
error mask to skip retries for functional errors
Ctor for an base command
as an byte
Request protocol data for logging
Ready to send data encoded with transmit protocol retries
Timeout for response
to do command with
hiding data in log file to avoid spying of passwords
error mask to skip retries
if session is gone and a re authorization is necessary
Ctor
this command will be resend after authorization
Command to resend
a bidirectional protocol support read and write genesis meter registers
needed for
FIFO of records to be send next
This is the actual record in the send loop
Last communication time for session refresh
Occurs when a meter Response for write password is good
Event after a register entries changed
User adjustable additional retry timeout. This is 0 ms for standard operation.
Process all records needed to be sent, this routine has to be called
to kick-off the communication of all RequestRecords saved to the send
FIFO
- Initial
- Logging of raw RequestProtocol at time of sending,
- Logging of retries.
- Added timeout from transmit protocol.
- Added reorder FIFO to bring login at first position
- Hide data in logging for e.g. passwords
- Retry counter reset if authorization required and this record will be put back into FIFO,
- Retry delay corrected for all errors.
- Dynamic retry delay: ResponseTimeoutMs * Retry counter.
- Skip retries on specific error mask to speed up communication on functional errors
or informational feed backs (e.g FW not installed 0x0004)
- User adjustable additional retry timeout.
- Response timeout message output,
- Initialize acknowledge code before communication to NoResponse.
- Response timeout deviated from system time.
- Avoid enqueue of _recordInProcess if retry counter is 0.
- Additional DEBUG information included about FIFO and loops.
- Command not assigned response for recordInProcess == null.
- Initial request acknowledge state changed from NotDecoded to NoResponse.
Assemble record with transmit protocol and put it to record-send-FIFO,
backup the ready-to-send, which is the dataEncodedWithTransmitProtocol,
to the RequestRecord object for sending including the retry capability.
Data package with all details like CRC, etc
Command identifier
which is intend
hiding data in log file to avoid spying of passwords
error mask to skip retries
the assembled record for the send FIFO
- Initial
- Logging of raw data (RequestProtocol) moved to ProcessRecordList.
- Added timeout from transmit protocol.
- Hide data in logging for e.g. passwords
- Skip retries on specific error mask to speed up communication on functional errors
or informational feed backs (e.g FW not installed 0x0004)
- Initial skip retry error code set to 0x0004 (e.g FW not installed 0x0004).
- Hide data in log forwarded to DecodeDateForPhysicalLayer to hide passwords in log files.
Record dispatcher to send FIFO of UI1236 command
- Initial
string for logging of slot
Data package with all details like CRC, etc
which is intend
hiding data in log file to avoid spying of passwords
error mask to skip retries
the assembled record for the send FIFO
Called after successful response.
Decode and check record, handle Errors and dispatch result.
Invokes if somebody is listening
- Initial
- First part reworked to extract the response protocol information
- Hide data in logging for e.g. passwords
- Error code extraction changed for
- Wakeup-message will avoid further timeout (during FW update this is in the range
of 15000ms).
- Allow one additional retry on decoding error, which is often the wakeup-message.
- Send time reminder for timeout time calculation as output in log-file,
- OnRecordIsDecoded?.Invoke moved before return to assure that the Acknowledge status is set.
- Avoid activation of wakeup retry if record is meanwhile acknowledged.
- Wakeup message handling changed,
- Multiple replies on wakeup message allowed.
- On wakeup message 5 retires are allowed to avoid an infinite loop.
- On wakeup message exit this routine.
- Early exit on _recordInProcess == null,
- Wakeup message retries from 5 to 2,
- Removed error base from error code decision as error base is only the AppId
- HideDataInLog.
- Ignore wakeup if message already acknowledged (avoid to set
"_recordInProcess.Acknowledge = RequestAcknowledgeState.NotDecoded"),
- Avoid to overwrite "_recordInProcess.Acknowledge = RequestAcknowledgeState.Acknowledge" with
"RequestAcknowledgeState.WakeupMessage".
Method to send basic Commands to Meter. Creates an integer of 4 bytes for the payload.
Supported Commands are: ,,
, and .
Calculate CRCs and Command length and check if command is valid.
Use to push data to Port/Meter.
Supported ,,
, and .
Register to Read or Write, null for
Data to push into the .
must be null on Read Commands ( ,)
and not null on WriteData ( and )
hiding data in log file to avoid spying of passwords
mask to skip reties on error
an new command just send to port/meter
- Initial
- Reworked to zero pad payload with chunks of 4 bytes, the caller needn't take care of the size
- Corrected payload content in request protocol
- Hide data in logging for e.g. passwords
- Skip retries on specific error mask to speed up communication on functional errors
or informational feed backs (e.g FW not installed 0x0004)
- Multiple read for string split to simple reads.
- Default set.
- MultipleReadData based on data size.
- Exit multiple read date if retries exceeded.
- Exit multiple read date if retries exceeded increased to .
- Rewound to version from 06.09.2023 14:44:33 before Commit 8c9d7704.
- Removed useless too short comments as every string is going to be delimited by a 0 and usually won't match
to a 4 byte chunk.
- Removed redundant 'return cRecord'.
Analyzes the error code
Reorders the record list so that first entry is the defined topRegister
Checks the active register to access