static int32_t Protocol_T1_SendBlock (struct s_reader *reader, T1_Block * block) { int32_t ret; ret = ICC_Async_Transmit (reader, block->length, block->data); T1_Block_Delete(block); return ret; }
static int32_t T1_Block_SendRBlock(struct s_reader *reader, uint8_t *block_data, unsigned char type, unsigned char nr) { int length = 4; block_data[0] = T1_BLOCK_NAD; block_data[1] = type | ((nr << 4) & 0x10); block_data[2] = 0x00; block_data[3] = T1_Block_LRC (block_data, 3); return ICC_Async_Transmit(reader, length, block_data, 0, reader->read_timeout); }
static int32_t T1_Block_SendSBlock(struct s_reader *reader, uint8_t *block_data, unsigned char type, unsigned char len, unsigned char * inf) { int length = 4 + len; block_data[0] = T1_BLOCK_NAD; block_data[1] = type; block_data[2] = len; if (len != 0x00) memcpy (block_data + 3, inf, len); block_data[len+3] = T1_Block_LRC(block_data, len+3); return ICC_Async_Transmit(reader, length, block_data, 0, reader->read_timeout); }
static int32_t T1_Block_SendIBlock(struct s_reader *reader, uint8_t *block_data, unsigned char len, unsigned char * inf, unsigned char ns, int32_t more) { int length = len + 4; block_data[0] = T1_BLOCK_NAD; block_data[1] = T1_BLOCK_I | ((ns << 6) & 0x40); if (more) block_data[1] |= 0x20; block_data[2] = len; if (len != 0x00) memcpy (block_data + 3, inf, len); block_data[len+3] = T1_Block_LRC (block_data, len+3); return ICC_Async_Transmit(reader, length, block_data,0, reader->read_timeout); }