document APDU

This commit is contained in:
Thomas Kunze 2019-06-24 23:39:43 +02:00
parent da05a1d51b
commit 1975d8ac55

View File

@ -5,16 +5,43 @@
class CemiFrame; class CemiFrame;
/**
* This class represents an Application Protocol Data Unit. It is part of a CemiFrame.
*/
class APDU class APDU
{ {
friend class CemiFrame; friend class CemiFrame;
public: public:
/**
* The constructor.
* @param data The data of the APDU. Encoding depends on the ::ApduType. The class doesn't
* take possession of this pointer.
* @param frame The CemiFrame this APDU is part of.
*/
APDU(uint8_t* data, CemiFrame& frame); APDU(uint8_t* data, CemiFrame& frame);
/**
* Get the type of the APDU.
*/
ApduType type(); ApduType type();
/**
* Set the type of the APDU.
*/
void type(ApduType atype); void type(ApduType atype);
/**
* Get a pointer to the data.
*/
uint8_t* data(); uint8_t* data();
/**
* Get the CemiFrame this APDU is part of.
*/
CemiFrame& frame(); CemiFrame& frame();
/**
* Get the length of the APDU. (This is actually the octet count of the NPDU.)
*/
uint8_t length() const; uint8_t length() const;
/**
* Print the contents of the APDU to console.
*/
void printPDU(); void printPDU();
private: private:
uint8_t* _data; uint8_t* _data;