1 /* 2 * Copyright (C) 2018 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.internal.telephony.uicc.euicc.apdu; 18 19 /** 20 * Parts of an APDU command. 21 * 22 * @hide 23 */ 24 class ApduCommand { 25 /** Channel of an APDU as defined in GlobalPlatform Card Specification v.2.3. */ 26 public final int channel; 27 28 /** Class of an APDU as defined in GlobalPlatform Card Specification v.2.3. */ 29 public final int cla; 30 31 /** Instruction of an APDU as defined in GlobalPlatform Card Specification v.2.3. */ 32 public final int ins; 33 34 /** Parameter 1 of an APDU as defined in GlobalPlatform Card Specification v.2.3. */ 35 public final int p1; 36 37 /** Parameter 2 of an APDU as defined in GlobalPlatform Card Specification v.2.3. */ 38 public final int p2; 39 40 /** Parameter 3 of an APDU as defined in GlobalPlatform Card Specification v.2.3. */ 41 public final int p3; 42 43 /** Command data of an APDU as defined in GlobalPlatform Card Specification v.2.3. */ 44 public final String cmdHex; 45 46 /** The parameters are defined as in GlobalPlatform Card Specification v.2.3. */ 47 ApduCommand(int channel, int cla, int ins, int p1, int p2, int p3, String cmdHex) { 48 this.channel = channel; 49 this.cla = cla; 50 this.ins = ins; 51 this.p1 = p1; 52 this.p2 = p2; 53 this.p3 = p3; 54 this.cmdHex = cmdHex; 55 } 56 57 @Override 58 public String toString() { 59 return "ApduCommand(channel=" + channel + ", cla=" + cla + ", ins=" + ins + ", p1=" + p1 60 + ", p2=" + p2 + ", p3=" + p3 + ", cmd=" + cmdHex + ")"; 61 } 62 } 63