C API for BALTECH SDK

§ brp_Bat_CheckTemplate()

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.

Parameters
[in]protocolused to execute the command
[in]CondBitNdxHas to be a value between 0 and 15, that identifies the condition bit that shall be updated.
[in]TemplateThis is a Byte sequence that has to match the response of the last action command.
[in]Template_len
[in]FieldBitLensEvery 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]Invertif true , the result is inverted.