pax_global_header 0000666 0000000 0000000 00000000064 14066310775 0014523 g ustar 00root root 0000000 0000000 52 comment=3b77a048cb3102933ad40fc8c3c8ef1021bf548b
ts-103-115-hci-api-testspec-REL-9.4.0/ 0000775 0000000 0000000 00000000000 14066310775 0016550 5 ustar 00root root 0000000 0000000 ts-103-115-hci-api-testspec-REL-9.4.0/LICENSE 0000664 0000000 0000000 00000002704 14066310775 0017560 0 ustar 00root root 0000000 0000000 Copyright 2021 ETSI
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
ts-103-115-hci-api-testspec-REL-9.4.0/README.md 0000664 0000000 0000000 00000000115 14066310775 0020024 0 ustar 00root root 0000000 0000000 # Draft TS 103 115 HCI API Test spec
## Licensing information
See LICENSE.
ts-103-115-hci-api-testspec-REL-9.4.0/source/ 0000775 0000000 0000000 00000000000 14066310775 0020050 5 ustar 00root root 0000000 0000000 ts-103-115-hci-api-testspec-REL-9.4.0/source/Annex_D_TestAppletsSourceCode/ 0000775 0000000 0000000 00000000000 14066310775 0025670 5 ustar 00root root 0000000 0000000 ts-103-115-hci-api-testspec-REL-9.4.0/source/Annex_D_TestAppletsSourceCode/uicc/ 0000775 0000000 0000000 00000000000 14066310775 0026613 5 ustar 00root root 0000000 0000000 ts-103-115-hci-api-testspec-REL-9.4.0/source/Annex_D_TestAppletsSourceCode/uicc/hci/ 0000775 0000000 0000000 00000000000 14066310775 0027356 5 ustar 00root root 0000000 0000000 ts-103-115-hci-api-testspec-REL-9.4.0/source/Annex_D_TestAppletsSourceCode/uicc/hci/test/ 0000775 0000000 0000000 00000000000 14066310775 0030335 5 ustar 00root root 0000000 0000000 ts-103-115-hci-api-testspec-REL-9.4.0/source/Annex_D_TestAppletsSourceCode/uicc/hci/test/framework/ 0000775 0000000 0000000 00000000000 14066310775 0032332 5 ustar 00root root 0000000 0000000 api_1_hdv_gpm/ 0000775 0000000 0000000 00000000000 14066310775 0034750 5 ustar 00root root 0000000 0000000 ts-103-115-hci-api-testspec-REL-9.4.0/source/Annex_D_TestAppletsSourceCode/uicc/hci/test/framework Api_1_Hdv_Gpm_1.java 0000664 0000000 0000000 00000006232 14066310775 0040373 0 ustar 00root root 0000000 0000000 ts-103-115-hci-api-testspec-REL-9.4.0/source/Annex_D_TestAppletsSourceCode/uicc/hci/test/framework/api_1_hdv_gpm package uicc.hci.test.framework.api_1_hdv_gpm;
import javacard.framework.APDU;
import javacard.framework.Applet;
import javacard.framework.ISO7816;
import javacard.framework.ISOException;
import uicc.hci.framework.HCIDevice;
import uicc.hci.framework.HCIListener;
import uicc.hci.framework.HCIMessage;
import uicc.hci.services.cardemulation.CardEmulationListener;
/**
* The method with the following header shall be compliant to its definition in the API.
* public static byte getPowerMode()
*
*/
public class Api_1_Hdv_Gpm_1 extends Applet implements CardEmulationListener {
// Define specific SWs
/**
* Status word: Full power mode
*/
private final static short SW_FULL_POWER_MODE = ISO7816.SW_NO_ERROR + (short) 3;
/**
* Status word: Low power mode
*/
private final static short SW_LOW_POWER_MODE = ISO7816.SW_NO_ERROR + (short) 4;
/**
* Status word: Power mode could't be retrieved
*/
private final static short SW_POWER_MODE_COULD_NOT_BE_RETRIEVED = ISO7816.SW_NO_ERROR + (short) 5;
// Define specific INS bytes for HCIDevice tests
/**
* Instruction byte: Retrieve power mode
*/
private final static short INS_HELPER = (short) 0x01;
private final static short INS_RETRIEVE_POWER_MODE = (short) 0x05;
/**
* Default constructor, registers the applet.
*/
private Api_1_Hdv_Gpm_1() {
register();
}
/**
* To create an instance of the Applet
subclass, the Java Card runtime environment will call this static method first.
* @see Applet#install(byte[], short, byte)
*/
public static void install(byte bArray[], short bOffset, byte bLength)
throws ISOException {
new Api_1_Hdv_Gpm_1();
}
/**
* Called by the Java Card runtime environment to process an incoming APDU command.
* @see Applet#process(APDU)
*/
public void process(APDU apdu) throws ISOException {
/*
* Check for SELECT command
*/
if (selectingApplet())
return;
byte buffer[] = apdu.getBuffer();
/*
* main switch
*/
switch (buffer[ISO7816.OFFSET_INS]) {
case INS_HELPER:
return;
case INS_RETRIEVE_POWER_MODE:
ISOException.throwIt(checkPowerMode(HCIDevice.getPowerMode()));
default:
ISOException.throwIt (ISO7816.SW_INS_NOT_SUPPORTED);
}
}
/**
* Checks the power mode an determine the according status word.
* @param powerMode Value, taken from {@link HCIDevice#getPowerMode()}
* @return The according status word.
*/
private short checkPowerMode(byte powerMode){
switch (powerMode) {
case HCIDevice.FULL_POWER_MODE:
return SW_FULL_POWER_MODE;
case HCIDevice.LOW_POWER_MODE:
return SW_LOW_POWER_MODE;
case (-1):
return SW_POWER_MODE_COULD_NOT_BE_RETRIEVED;
default:
return ISO7816.SW_UNKNOWN;
}
}
/**
* Not used
* This method is called by the HCI framework to inform the Listener Object about a specific event and pass the corresponding HCIMessage to the Listener Object.
* @see HCIListener#onCallback(byte, HCIMessage)
*/
public void onCallback(byte arg0, HCIMessage arg1) {
}
}
javacard/ 0000775 0000000 0000000 00000000000 14066310775 0036523 5 ustar 00root root 0000000 0000000 ts-103-115-hci-api-testspec-REL-9.4.0/source/Annex_D_TestAppletsSourceCode/uicc/hci/test/framework/api_1_hdv_gpm api_1_hdv_gpm.cap 0000664 0000000 0000000 00000005651 14066310775 0041714 0 ustar 00root root 0000000 0000000 ts-103-115-hci-api-testspec-REL-9.4.0/source/Annex_D_TestAppletsSourceCode/uicc/hci/test/framework/api_1_hdv_gpm/javacard PK A^sF META-INF/MANIFEST.MF Tn0G?!-M*-*J :NIhHQ*;3;ӈ,;)#uḟwu1Bp*cE[]ӵ2ǍL3!/?c5h]n]'=тB
:NU&"Y(at`ڳ{=fcqS<>}
dc5PF*\A(ck&2Os>r.o/,W
\mr01 &p&+`b2ly6)&\۰l^6'
&a\>XsO!XY_1&;Iv,/sj:S)EmӴG[[jVa6K;