static int32_t Cool_Transmit(struct s_reader *reader, unsigned char *sent, uint32_t size, uint32_t expectedlen, uint32_t UNUSED(delay), uint32_t UNUSED(timeout)) { struct cool_data *crdr_data = reader->crdr_data; int32_t ret; memset(crdr_data->cardbuffer, 0, 512); if(reader->protocol_type == ATR_PROTOCOL_TYPE_T0) { crdr_data->cardbuflen = expectedlen; ret = cnxt_smc_read_write(crdr_data->handle, 0, sent, size, crdr_data->cardbuffer, &crdr_data->cardbuflen, 0, NULL); } else { crdr_data->cardbuflen = 512; ret = cnxt_smc_read_write(crdr_data->handle, 0, sent, size, crdr_data->cardbuffer, &crdr_data->cardbuflen, 4000, NULL); } coolapi_check_error("cnxt_smc_read_write", ret); rdr_log_dump_dbg(reader, D_DEVICE, sent, size, "COOL Transmit:"); if(ret) { return ERROR; } return OK; }
static int32_t Cool_Transmit (struct s_reader *reader, unsigned char * sent, uint32_t size, uint32_t UNUSED(delay), uint32_t timeout) { int32_t ret; specdev()->cardbuflen = 512;//it needs to know max buffer size to respond? if (specdev()->read_write_transmit_timeout == -1) ret = cnxt_smc_read_write(specdev()->handle, 0, sent, size, specdev()->cardbuffer, &specdev()->cardbuflen, timeout, NULL); else ret = cnxt_smc_read_write(specdev()->handle, 0, sent, size, specdev()->cardbuffer, &specdev()->cardbuflen, specdev()->read_write_transmit_timeout, NULL); coolapi_check_error("cnxt_smc_read_write", ret); rdr_ddump_mask(reader, D_DEVICE, sent, size, "COOL Transmit:"); return OK; }
int32_t Cool_Transmit (BYTE * sent, uint32_t size) { specdev()->cardbuflen = 256;//it needs to know max buffer size to respond? call (cnxt_smc_read_write(specdev()->handle, FALSE, sent, size, specdev()->cardbuffer, &specdev()->cardbuflen, 50, 0)); //call (cnxt_smc_read_write(specdev()->handle, FALSE, sent, size, specdev()->cardbuffer, &specdev()->cardbuflen, read_timeout, 0)); cs_ddump_mask(D_DEVICE, sent, size, "COOL IO: Transmit: "); return OK; }
int32_t Cool_Transmit (struct s_reader *reader, BYTE * sent, uint32_t size) { specdev()->cardbuflen = 256;//it needs to know max buffer size to respond? int32_t ret = cnxt_smc_read_write(specdev()->handle, FALSE, sent, size, specdev()->cardbuffer, &specdev()->cardbuflen, specdev()->read_write_transmit_timeout, 0); check_error("cnxt_smc_read_write", ret); cs_ddump_mask(D_DEVICE, sent, size, "COOL IO: Transmit: "); return OK; }