Keyple C++  0.9.0
Keyple, an Open Source SDK for Ticketing
Public Member Functions | Friends | List of all members
keyple::core::seproxy::message::ApduResponse Class Reference

#include <ApduResponse.h>

Public Member Functions

 ApduResponse (const std::vector< uint8_t > &buffer, std::shared_ptr< std::set< int >> successfulStatusCodes)
 
bool isSuccessful () const
 
uint16_t getStatusCode () const
 
const std::vector< uint8_t > & getBytes () const
 
std::vector< uint8_t > getDataOut () const
 
bool operator== (const ApduResponse &o) const
 
bool operator!= (const ApduResponse &o) const
 

Friends

KEYPLECORE_API std::ostream & operator<< (std::ostream &os, const ApduResponse &r)
 
KEYPLECORE_API std::ostream & operator<< (std::ostream &os, const std::shared_ptr< ApduResponse > &r)
 
KEYPLECORE_API std::ostream & operator<< (std::ostream &os, const std::vector< std::shared_ptr< ApduResponse >> &v)
 

Detailed Description

Single APDU response wrapper

Constructor & Destructor Documentation

◆ ApduResponse()

keyple::core::seproxy::message::ApduResponse::ApduResponse ( const std::vector< uint8_t > &  buffer,
std::shared_ptr< std::set< int >>  successfulStatusCodes 
)

Create a new ApduResponse from the provided byte array

The internal successful status is determined by the current status code and the optional successful status codes list.

The list of additional successful status codes is used to set the successful flag if not equal to 0x9000

Parameters
bufferapdu response data buffer (including sw1sw2)
successfulStatusCodesoptional list of successful status codes other than 0x9000

Member Function Documentation

◆ getBytes()

const std::vector< uint8_t > & keyple::core::seproxy::message::ApduResponse::getBytes ( ) const

◆ getDataOut()

std::vector< uint8_t > keyple::core::seproxy::message::ApduResponse::getDataOut ( ) const

Get the data before the statusCode

Returns
slice of the buffer before the status code

◆ getStatusCode()

uint16_t keyple::core::seproxy::message::ApduResponse::getStatusCode ( ) const

◆ isSuccessful()

bool keyple::core::seproxy::message::ApduResponse::isSuccessful ( ) const

Checks if is successful.

Returns
the status of the command transmission.

◆ operator!=()

bool keyple::core::seproxy::message::ApduResponse::operator!= ( const ApduResponse o) const

◆ operator==()

bool keyple::core::seproxy::message::ApduResponse::operator== ( const ApduResponse o) const

Friends And Related Function Documentation

◆ operator<< [1/3]

KEYPLECORE_API std::ostream& operator<< ( std::ostream &  os,
const ApduResponse r 
)
friend

◆ operator<< [2/3]

KEYPLECORE_API std::ostream& operator<< ( std::ostream &  os,
const std::shared_ptr< ApduResponse > &  r 
)
friend

◆ operator<< [3/3]

KEYPLECORE_API std::ostream& operator<< ( std::ostream &  os,
const std::vector< std::shared_ptr< ApduResponse >> &  v 
)
friend

The documentation for this class was generated from the following files: