aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/LowLevel/CCID
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Device/LowLevel/CCID')
-rw-r--r--Demos/Device/LowLevel/CCID/CCID.c57
-rw-r--r--Demos/Device/LowLevel/CCID/HostTestApp/test_generic_ccid_libusb.js6
-rw-r--r--Demos/Device/LowLevel/CCID/Lib/Iso7816.c10
-rw-r--r--Demos/Device/LowLevel/CCID/Lib/Iso7816.h2
4 files changed, 9 insertions, 66 deletions
diff --git a/Demos/Device/LowLevel/CCID/CCID.c b/Demos/Device/LowLevel/CCID/CCID.c
index b80507659..8b46e89be 100644
--- a/Demos/Device/LowLevel/CCID/CCID.c
+++ b/Demos/Device/LowLevel/CCID/CCID.c
@@ -197,13 +197,13 @@ void EVENT_USB_Device_ControlRequest(void)
* THe slot must reply back with a recognizable ATR (answer to reset)
*/
uint8_t CCID_IccPowerOn(uint8_t slot,
- uint8_t* attr,
- uint8_t* attrLength,
+ uint8_t* atr,
+ uint8_t* atrLength,
uint8_t* error)
{
if (slot == 0)
{
- Iso7816_CreateSimpleAttr(attr, attrLength);
+ Iso7816_CreateSimpleAtr(atr, atrLength);
*error = CCID_ERROR_NO_ERROR;
return CCID_COMMANDSTATUS_PROCESSEDWITHOUTERROR | CCID_ICCSTATUS_PRESENTANDACTIVE;
@@ -394,57 +394,6 @@ void CCID_Task(void)
break;
}
- case CCID_PC_to_RDR_XfrBlock:
- {
- uint8_t Bwi = Endpoint_Read_8();
- uint16_t LevelParameter = Endpoint_Read_16_LE();
- uint8_t ReceivedBuffer[0x4];
-
- (void)Bwi;
- (void)LevelParameter;
-
- Endpoint_Read_Stream_LE(ReceivedBuffer, sizeof(ReceivedBuffer), NULL);
-
- uint8_t SendBuffer[0x2] = {0x90, 0x00};
- uint8_t SendLength = sizeof(SendBuffer);
-
- USB_CCID_RDR_to_PC_DataBlock_t* ResponseBlock = (USB_CCID_RDR_to_PC_DataBlock_t*)&BlockBuffer;
- ResponseBlock->CCIDHeader.MessageType = CCID_RDR_to_PC_DataBlock;
- ResponseBlock->CCIDHeader.Slot = CCIDHeader.Slot;
- ResponseBlock->CCIDHeader.Seq = CCIDHeader.Seq;
-
- ResponseBlock->ChainParam = 0;
-
- // TODO: Callback
- Status = CCID_COMMANDSTATUS_PROCESSEDWITHOUTERROR | CCID_ICCSTATUS_PRESENTANDACTIVE;
-
- if (CCID_CheckStatusNoError(Status) && !Aborted)
- {
- ResponseBlock->CCIDHeader.Length = SendLength;
- memcpy(&ResponseBlock->Data, SendBuffer, SendLength);
- }
- else if (Aborted)
- {
- Status = CCID_COMMANDSTATUS_FAILED | CCID_ICCSTATUS_PRESENTANDACTIVE;
- Error = CCID_ERROR_CMD_ABORTED;
- SendLength = 0;
- }
- else
- {
- SendLength = 0;
- }
-
- ResponseBlock->Status = Status;
- ResponseBlock->Error = Error;
-
- Endpoint_ClearOUT();
-
- Endpoint_SelectEndpoint(CCID_IN_EPADDR);
- Endpoint_Write_Stream_LE(ResponseBlock, sizeof(USB_CCID_RDR_to_PC_DataBlock_t) + SendLength, NULL);
- Endpoint_ClearIN();
- break;
- }
-
case CCID_PC_to_RDR_Abort:
{
USB_CCID_RDR_to_PC_SlotStatus_t* ResponseAbort = (USB_CCID_RDR_to_PC_SlotStatus_t*)&BlockBuffer;
diff --git a/Demos/Device/LowLevel/CCID/HostTestApp/test_generic_ccid_libusb.js b/Demos/Device/LowLevel/CCID/HostTestApp/test_generic_ccid_libusb.js
index b53f1a49c..993c0e550 100644
--- a/Demos/Device/LowLevel/CCID/HostTestApp/test_generic_ccid_libusb.js
+++ b/Demos/Device/LowLevel/CCID/HostTestApp/test_generic_ccid_libusb.js
@@ -140,12 +140,6 @@ function startTest()
},
function(callback) {
read(ccidInterface, 10, callback);
- },
- function(callback) {
- write(ccidInterface, new Buffer(XfrBlockMessage(0, 4)), callback);
- },
- function(callback) {
- read(ccidInterface, 10 + 2, callback);
}
]);
}
diff --git a/Demos/Device/LowLevel/CCID/Lib/Iso7816.c b/Demos/Device/LowLevel/CCID/Lib/Iso7816.c
index eaa96e544..0c2e5e8b0 100644
--- a/Demos/Device/LowLevel/CCID/Lib/Iso7816.c
+++ b/Demos/Device/LowLevel/CCID/Lib/Iso7816.c
@@ -31,17 +31,17 @@
#include "Iso7816.h"
-void Iso7816_CreateSimpleAttr(uint8_t* attr, uint8_t* attrLength)
+void Iso7816_CreateSimpleAtr(uint8_t* atr, uint8_t* atrLength)
{
- attr[0] = 0x3B; // TS: direct convention
+ atr[0] = 0x3B; // TS: direct convention
uint8_t interfaceBytesPresence = 0;
uint8_t historycalBytes[14] = "Lufa CCID Demo"; // Must be equal or less than 15
uint8_t historicalBytesLength = sizeof(historycalBytes);
- attr[1] = (interfaceBytesPresence << 4) + historicalBytesLength; //TO
- memcpy(attr + 2, historycalBytes, historicalBytesLength);
+ atr[1] = (interfaceBytesPresence << 4) + historicalBytesLength; //TO
+ memcpy(atr + 2, historycalBytes, historicalBytesLength);
- *attrLength = historicalBytesLength + 2;
+ *atrLength = historicalBytesLength + 2;
}
diff --git a/Demos/Device/LowLevel/CCID/Lib/Iso7816.h b/Demos/Device/LowLevel/CCID/Lib/Iso7816.h
index d07485823..aa5f4ba83 100644
--- a/Demos/Device/LowLevel/CCID/Lib/Iso7816.h
+++ b/Demos/Device/LowLevel/CCID/Lib/Iso7816.h
@@ -40,6 +40,6 @@
#include <stdlib.h>
/* Function Prototypes: */
- void Iso7816_CreateSimpleAttr(uint8_t* attr, uint8_t* attrLength);
+ void Iso7816_CreateSimpleAtr(uint8_t* atr, uint8_t* atrLength);
#endif