Check Payload Byte
- Verifies that the bytes with specified indexes in the received values of
a message has specific values using a byte mask.
Arguments Description
message_path (str): The message path should be in the format:
BusName::MsgId
.byte_indexes (FramePayload): The payload bytes indexes. ${0,1}
bytes_values (FramePayload): The payload bytes expected values. ${0x1,0x2}
bytes_mask (FramePayload): The applied mask on every byte to check. ${0xFF,0xFF}
- operation (LogicalOperation, optional): if LogicalOperation.ALL(0), then the condition needs to be satisfied by all the received PAYLOADS
of the message since the start of the message observer.
If LogicalOperation.ONLY_ONE(1), then the condition needs to be satisfied by at least one received PAYLOAD since the start of the message observer. Defaults to LogicalOperation.ALL .
Returns
bool: True if receivedValues[byte_indexes] == (bytes_values) & (bytes_mask) for one or all recieved messages depending on the
operation
argument value choice.
Examples
# In example 1, the keyword will check that all the received values in the buffer satisfy the conditions.# which means they have a payload of ${0,0x1,0x2,0x3,0x4,0xF4,0x05,0x01}.${byte_indexes}= Create List ${0} ${1} ${2} ${3} ${4} ${5} ${6} ${7}${bytes_values}= Create List ${0} ${0x1} ${0x2} ${0x3} ${0x4} ${0xF4} ${0x5} ${0x1}${bytes_mask}= Create List ${0xFF} ${0xFF} ${0xFF} ${0xFF} ${0xFF} ${0xFF} ${0xFF} ${0xFF}Check Payload Byte ${BusName}::${MsgId} ${byte_indexes} {bytes_values} {bytes_mask} ${0}# In example 2, the keyword will check that all the received values in the buffer satisfy the conditions.# But in this case, the byte with index 1 will be ignored because the index is not in the list of indexes.# which means they have a payload of ${0,0x2,0x3,0x4,0xF4,0x05,0x01}.${byte_indexes} = Create List ${0} ${2} ${3} ${4} ${5} ${6} ${7}${bytes_values} = Create List ${0} ${0x2} ${0x3} ${0x4} ${0xF4} ${0x5} ${0x1}${bytes_mask} = Create List ${0xFF} ${0xFF} ${0xFF} ${0xFF} ${0xFF} ${0xFF} ${0xFF}Check Payload Byte ${BusName}::${MsgId} {byte_indexes} {bytes_values} {bytes_mask} ${0}# In example 3, the keyword will check that only one received value in the buffer satisfies the conditions.# which means they have a payload of ${0,0x2,0x3,0x4,0xF4,0x05,0x01}.# N.B.: The byte with index 1 will be ignored because the index is not in the list of indexes. The check on the Byte with index 0 is ignored since the mask is null. The bytes mask enables the selective exclusion of specific bits from the comparison (the bits corresponding to a null mask).${byte_indexes} = Create List ${0} ${2} ${3} ${4} ${5} ${6} ${7}${bytes_values} = Create List ${0} ${0x2} ${0x3} ${0x4} ${0xF4} ${0x5} ${0x1}${bytes_mask} = Create List ${0x00} ${0xFF} ${0xFF} ${0xFF} ${0xFF} ${0xFF} ${0xFF}Check Payload Byte ${BusName}::${MsgId} ${byte_indexes} ${bytes_values} ${bytes_mask} ${1}
Note
An observer should be started on the target message beforehand.
The length of
byte_indexes
,bytes_values
andbytes_mask
arguments should be the same.