Skip to Main Content

Java Card

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is this the right format to send SMS?

843851Sep 6 2007 — edited Sep 20 2007
Hi,

I am using the below code to send SMS to the SIM. But i am getting an unsupported format error. Can anyone point me what mistake i am doing here? I am new to STK.

static byte [] mySMS = {(byte)0x0B, // Tag : SMS-TPDU
(byte)0x00, // Length : coded on 1 bytes only, data field must be less than 128 bytes long
(byte)0x41, // b8 = 0 : TP-RP = reply path not set
// b7 = 1 : TP-UDHI = header included in the TP-UD field
// b6 = 0 : TP-SRR = no status report requested
// b5b4 = 00 : TP-VPF = TP-VP field not present
// b3 = 0 : TP-RD = accept messages with same TP-MR and TP-DA
// b2b1 = 01 : TP-MTI = SMS-SUBMIT
(byte)0x01, // TP-MR : message reference = '01' (not used)
(byte)0x00, // TP-DA : Address length = 2n or 2n-1 useful semi-bytes
(byte)0x91, // TP-DA : TON-NPI = International Number - ISDN / telephone numbering plan
(byte)0x00,
(byte)0x00,
(byte)0x00,
(byte)0x00,
(byte)0x00,
(byte)0x00,
(byte)0x00,
(byte)0x00,
(byte)0x00,
(byte)0x00,
(byte)'H' ,
(byte) 'A',
(byte) 'L',
(byte) 'O'};


byte [] enviar=new byte[ 160];
byte [] ALPHA_ID=mySMS;

hdlrProCmd.init(PRO_CMD_SEND_SHORT_MESSAGE,(byte) 0,DEV_ID_NETWORK);
hdlrProCmd.appendTLV(TAG_ALPHA_IDENTIFIER, ALPHA_ID, (short)0, (short)0);
hdlrProCmd.appendTLV(TAG_SMS_TPDU, ALPHA_ID, (short)0, (short)ALPHA_ID.length);
hdlrProCmd.send();

Pls do help me.
Thanks in advance,
Dhanya
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 18 2007
Added on Sep 6 2007
11 comments
311 views