BALTECH Docs |
C API for BALTECH SDK
|
brp_errcode brp_Bat_CheckTemplate | ( | brp_protocol | protocol, |
unsigned | CondBitNdx, | ||
brp_buf | Template, | ||
size_t | Template_len, | ||
unsigned * | FieldBitLens, | ||
size_t | FieldBitLens_len, | ||
bool | Invert | ||
) |
This command checks if the result of the last action-sub-command (i.e.
sub- command that did not start with "Check...") matches a template. Depending on the result it sets (or clears, if Invert is true) a condition bit.
[in] | protocol | used to execute the command |
[in] | CondBitNdx | Has to be a value between 0 and 15, that identifies the condition bit that shall be updated. |
[in] | Template | This is a Byte sequence that has to match the response of the last action command. |
[in] | Template_len | |
[in] | FieldBitLens | Every even entry specifies an amount of bits, that are relevant and have to match to Template. Every odd entry specifies an amount of bits that may be ignored. For instance, 8, 16, 8, 16 means that out of a 6 Byte response, only Bytes 0 and 3 are relevant and have to match Template. If the amount of entries is even, the rest has to match exactly to the rest of the template. If the amount of entries is odd, the rest is irrelevant. The bits within a single Byte are interpreted MSB (i.e. bit 0 of 0x80 is 1, bits 1-7 of 0x80 are 0). |
[in] | FieldBitLens_len | |
[in] | Invert | if true , the result is inverted. |