diff options
Diffstat (limited to 'Demos/Device/ClassDriver/CCID')
| -rw-r--r-- | Demos/Device/ClassDriver/CCID/CCID.c | 28 | ||||
| -rw-r--r-- | Demos/Device/ClassDriver/CCID/CCID.h | 7 | ||||
| -rw-r--r-- | Demos/Device/ClassDriver/CCID/Descriptors.c | 4 | ||||
| -rw-r--r-- | Demos/Device/ClassDriver/CCID/Descriptors.h | 2 | 
4 files changed, 38 insertions, 3 deletions
diff --git a/Demos/Device/ClassDriver/CCID/CCID.c b/Demos/Device/ClassDriver/CCID/CCID.c index 9059ad40d..bb4c11c45 100644 --- a/Demos/Device/ClassDriver/CCID/CCID.c +++ b/Demos/Device/ClassDriver/CCID/CCID.c @@ -213,6 +213,34 @@ uint8_t CALLBACK_CCID_GetSlotStatus(USB_ClassInfo_CCID_Device_t* const CCIDInter  	}  } +/** Event handler for the CCID_PC_to_RDR_XfrBlock. This message is sent to the device + *  whenever an application at the host wants to send a block of bytes to the device + *  THe device reply back with an array of bytes + */ +uint8_t CALLBACK_CCID_XfrBlock(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo, +							   uint8_t slot, +							   uint8_t* const receivedBuffer, +							   uint8_t receivedBufferSize, +							   uint8_t* const sendBuffer, +							   uint8_t* const sentBufferSize, +							   uint8_t* const error) +{ +	if (slot < CCID_Interface.Config.TotalSlots) +	{ +		uint8_t okResponse[2] = {0x90, 0x00}; +		memcpy(sendBuffer, okResponse, sizeof(okResponse)); +		*sentBufferSize = sizeof(okResponse); + +		*error = CCID_ERROR_NO_ERROR; +		return CCID_COMMANDSTATUS_PROCESSEDWITHOUTERROR | CCID_ICCSTATUS_NOICCPRESENT; +	} +	else +	{ +		 *error = CCID_ERROR_SLOT_NOT_FOUND; +         return CCID_COMMANDSTATUS_FAILED | CCID_ICCSTATUS_NOICCPRESENT; +	} +} +  uint8_t CALLBACK_CCID_Abort(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,                              uint8_t slot,  							uint8_t seq, diff --git a/Demos/Device/ClassDriver/CCID/CCID.h b/Demos/Device/ClassDriver/CCID/CCID.h index f6dd4adf5..88c29aef1 100644 --- a/Demos/Device/ClassDriver/CCID/CCID.h +++ b/Demos/Device/ClassDriver/CCID/CCID.h @@ -86,6 +86,13 @@  		uint8_t CALLBACK_CCID_GetSlotStatus(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,  		                                    uint8_t slot,  		                                    uint8_t* const error); +		uint8_t CALLBACK_CCID_XfrBlock(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo, +									   uint8_t slot, +									   uint8_t* const receivedBuffer, +									   uint8_t receivedBufferSize, +									   uint8_t* const sendBuffer, +									   uint8_t* const sentBufferSize, +									   uint8_t* const error);  		uint8_t CALLBACK_CCID_Abort(USB_ClassInfo_CCID_Device_t* const CCIDInterfaceInfo,  		                            uint8_t slot,  		                            uint8_t seq, diff --git a/Demos/Device/ClassDriver/CCID/Descriptors.c b/Demos/Device/ClassDriver/CCID/Descriptors.c index 43a696194..886042668 100644 --- a/Demos/Device/ClassDriver/CCID/Descriptors.c +++ b/Demos/Device/ClassDriver/CCID/Descriptors.c @@ -117,8 +117,8 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =  			.MaxIFSD				= 2038,  			.SynchProtocols			= 0,  			.Mechanical				= 0, -			.Features				= 0x0400fe, -			.MaxCCIDMessageLength	= 0x0c00, +			.Features				= CCID_Features_ExchangeLevel_ShortAPDU | CCID_Features_Auto_ParameterConfiguration| CCID_Features_Auto_ICCActivation | CCID_Features_Auto_VoltageSelection, +			.MaxCCIDMessageLength	= CCID_EPSIZE,  			.ClassGetResponse		= 0xff,  			.ClassEnvelope			= 0xff,  			.LcdLayout				= 0, diff --git a/Demos/Device/ClassDriver/CCID/Descriptors.h b/Demos/Device/ClassDriver/CCID/Descriptors.h index 239d612ab..63672d1b7 100644 --- a/Demos/Device/ClassDriver/CCID/Descriptors.h +++ b/Demos/Device/ClassDriver/CCID/Descriptors.h @@ -49,7 +49,7 @@  		/** Endpoint address of the CCID data OUT endpoint, for host-to-device data transfers. */  		#define CCID_OUT_EPADDR      (ENDPOINT_DIR_OUT | 1) -		/** Endpoint size in bytes of the Audio isochronous streaming data IN and OUT endpoints. */ +		/** Endpoint size in bytes of the CCID data being sent between IN and OUT endpoints. */  		#define CCID_EPSIZE          64  | 
