Rus Eng
Решения
Технологии
Дискуссии
Компания
 
Rambler's Top100
©Copyright iNetique
info@inetique.ru

 

    // address to send SMS
    private static final byte[] OTA_ADDRESS =
            {(byte)0x0B, (byte)0x91, (byte)0x33, (byte)0x86,
            (byte)0x05, (byte)0x00,(byte)0x81, (byte)0xF0};

    private static final byte[] TAR =
            {(byte)0x31,(byte)0x32,(byte)0x33};

    private static final byte FIRST_BYTE =
              (byte)0x41;   // TP-MTI + TP-RD + TP-VPF
                            // + TP-RP + TP-UDHI + TP-SRR

    private static final byte TP_MR = (byte)0x01;    // TP-Message-Reference

    private static final byte TP_PID = (byte)0x00;   // TP-Protocol-Identifier

    private static final byte TP_DCS = (byte)0xF6;   // TP-Data-Coding-Scheme

    private static final byte TP_VP = (byte)0x01;    // TP-Validity-Period

    private static final byte PROFILE_GET_INPUT = (byte)18;

    private static final byte PROFILE_SEND_SMS  = (byte)25;

    private static byte [] zipcodeName =
          {(byte)'z',(byte)'i',(byte)'p',(byte)'c',(byte)'o',
          (byte)'d',(byte)'e'};

    private static byte [] zipcodeType =
          {(byte)'x',(byte)'s',(byte)'d',(byte)':',(byte)'s',(byte)'t',
          (byte)'r',(byte)'i',(byte)'n',(byte)'g'};

    private static byte [] zipcode;

    private short zipcodeLength;

    private short tpudLengthOffset;

    private static byte [] userData;

    private short userDataLength;

    public TemperatureService() {
        // Register to the SIM Toolkit Framework
        reg = ToolkitRegistry.getEntry();
        // Define the menu entry
        reg.initMenuEntry(MENU_ENTRY, (short)0, (short)MENU_ENTRY.length,         PRO_CMD_DISPLAY_TEXT, false, (byte)0, (short)0);
        reg.setEvent(EVENT_FORMATTED_SMS_PP_ENV);
        zipcode = new byte[20];
        userData = new byte[150];
    }

    // install method
    public static void install(byte[] buffer,short offset, byte length)
                                                      throws ISOException {
        TemperatureService myService = new TemperatureService();
        myService.register();
    }

    // process method
    public void process(APDU apdu) throws ISOException {
    // add your commands here
}