mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Merge "Add p2 option in OpenLogicalChannel" into oc-dev
This commit is contained in:
@@ -1285,10 +1285,11 @@ interface IRadio {
|
||||
*
|
||||
* @param serial Serial number of request.
|
||||
* @param aid AID value, See ETSI 102.221 and 101.220.
|
||||
* @param p2 P2 value, described in ISO 7816-4. Ignore if equal to P2Constant:NO_P2
|
||||
*
|
||||
* Response callback is IRadioResponse.iccOpenLogicalChannelResponse()
|
||||
*/
|
||||
oneway iccOpenLogicalChannel(int32_t serial, string aid);
|
||||
oneway iccOpenLogicalChannel(int32_t serial, string aid, int32_t p2);
|
||||
|
||||
/**
|
||||
* Close a previously opened logical channel. This command reflects TS 27.007
|
||||
|
||||
@@ -1161,6 +1161,10 @@ enum DeviceStateType : int32_t {
|
||||
// this doesn't mean no data is expected.
|
||||
};
|
||||
|
||||
enum P2Constant : int32_t {
|
||||
NO_P2 = -1, // No P2 value is provided
|
||||
};
|
||||
|
||||
struct RadioResponseInfo {
|
||||
RadioResponseType type; // Response type
|
||||
int32_t serial; // Serial number of the request
|
||||
|
||||
@@ -246,12 +246,15 @@ TEST_F(RadioHidlTest, iccTransmitApduBasicChannel) {
|
||||
*/
|
||||
TEST_F(RadioHidlTest, iccOpenLogicalChannel) {
|
||||
int serial = 1;
|
||||
|
||||
int p2 = 0x04;
|
||||
// Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is
|
||||
// requested.
|
||||
for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
|
||||
radio->iccOpenLogicalChannel(++serial, cardStatus.applications[i].aidPtr);
|
||||
EXPECT_EQ(std::cv_status::no_timeout, wait());
|
||||
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
|
||||
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
|
||||
radio->iccOpenLogicalChannel(++serial, cardStatus.applications[i].aidPtr,
|
||||
p2);
|
||||
EXPECT_EQ(std::cv_status::no_timeout, wait());
|
||||
EXPECT_EQ(serial, radioRsp->rspInfo.serial);
|
||||
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp->rspInfo.type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,4 +320,4 @@ TEST_F(RadioHidlTest, supplyNetworkDepersonalization) {
|
||||
if (cardStatus.cardState == CardState::ABSENT) {
|
||||
ASSERT_TRUE(radioRsp->rspInfo.error == RadioError::PASSWORD_INCORRECT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user