Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java String and Hex character representation

Tags:

java

hex

ascii

smpp

I am trying to send a square bracket to a phone using logica smpp 1.3.7. I use dataCodingSetting of 3 - as per the network I asked about this. They advised that I need to package my message as below:

  You want to send ASCII                Send the following

  Character  Decimal  Hex              Character    Hex     Decimal
     [         91     5B                <ESC><     1B 3C     27 60

My question is, I have no clue what this character is: ESC < And if I put just the Hex value of 1B 3C it comes out on the phone as exactly that: 1B 3C

like image 330
lulu88 Avatar asked Jan 13 '23 19:01

lulu88


1 Answers

I guess they want a String containing the bytes 0x1b and 0x3c so :

sm.setShortMessage(new String(new byte[] { 0x1b, 0x3c }));
like image 103
bowmore Avatar answered Jan 17 '23 15:01

bowmore