Exemplo n.º 1
0
int32_t ICC_Async_Receive (struct s_reader *reader, uint32_t size, BYTE * data)
{

	if (reader->crdr.active==1) {
		call(reader->crdr.receive(reader, data, size));

		if (reader->convention == ATR_CONVENTION_INVERSE && reader->crdr.need_inverse==1)
			ICC_Async_InvertBuffer (size, data);

		cs_ddump_mask(D_IFD, data, size, "IFD Received: ");
		return OK;
	}

	switch(reader->typ) {
		case R_MP35:
		case R_DB2COM1:
		case R_DB2COM2:
		case R_SC8in1:
		case R_MOUSE:
			call (Phoenix_Receive (reader, data, size, reader->read_timeout));
			break;
#if defined(LIBUSB)
		case R_SMART:
			call (SR_Receive(reader, data, size));
			break;
#endif
		case R_INTERNAL:
#if defined(COOL)
			call (Cool_Receive(data, size));
#elif defined(AZBOX)
			call (Azbox_Receive(reader, data, size));
#elif defined(SCI_DEV)
			call (Phoenix_Receive (reader, data, size, reader->read_timeout));
#elif defined(WITH_STAPI)
			call (STReader_Receive(reader->stsmart_handle, data, size));
#endif
			break;
		default:
			cs_log("ERROR ICC_Async_Receive: unknow reader type %i",reader->typ);
			return ERROR;
	}

	if (reader->convention == ATR_CONVENTION_INVERSE && reader->typ <= R_MOUSE)
		ICC_Async_InvertBuffer (size, data);

	cs_ddump_mask(D_IFD, data, size, "IFD Received: ");
	return OK;
}
Exemplo n.º 2
0
static int32_t stapi_receive(struct s_reader *reader, unsigned char *data, uint32_t size) {
    return STReader_Receive(reader->stsmart_handle, data, size);
}