Send USSD APDU

Author: Scruffy bear 2009.09.07
Some operator would implement the Send USSD in the STK, the Card vendor need to construct the Send USSD APDU command, here give out a brief sample about the detail of the this APDU command.
Fetch
      ME --> ICC  : A0 12 00 00 23
      ME <-- ICC  : D0 21 81 03 01 12 00 82 02 81 83 85 0C 53 65 6E 64 69 6E 67 20 55 53 53 44 8A 08 0F AA 9A CD A6 A2 8D 00 90 00
the dissection of the APDU command,
      Command Detail : 81 03 01 12 00
      Device Identities : 82 02 82 81
      alpha identifier : "Sending USSD"  85 0C 53 65 6E 64 69 6E 67 20 55 53 53 44
      USSD String Tag, 8A Data Coding Scheme : 0F  USSD String:  AA 9A CD A6 A2 8D 00,   8A 08 0F AA 9A CD A6 A2 8D 00
For the USSD String, it's a little complicated, please refer GSM03.38 for the detail, below is the detail for this sample.
AA 9A CD A6 A2 8D 00 transfer to bits format:  10101010 10011010 11001101 10100110 10100010 10001101 00000000
do the 7 bit coding transfer, the result is: 0101010 0110101  0110110 0110110  0101010 0110100 0100011, i.e. 2A 35 36 36 2A 34 23
transfer to Ascii code is: *566*4#, yes, this STK command send out the USSD request to the server of '*566*4#'
about the 7bit coding, have to refer to the detail of GSM03.38
let's take this example to do the transform(AA 9A CD A6 A2 8D 00).
10101010 10011010 11001101 10100110 10100010 10001101 00000000
the highest 1 bit of first byte move to the lowest bit of 2nd byte , i.e.
0101010 100110101 11001101 10100110 10100010 10001101 00000000
the highest 2 bits of second byte move to the lowest bit of 3rd byte, i.e.
0101010 0110101 1100110110 10100110 10100010 10001101 00000000
the highest 3 bits of third byte move to the lowest bit of 4th byte, i.e.
0101010 0110101 0110110 10100110110 10100010 10001101 00000000
the highest 4 bits of 4th byte move to the lowest bit of 5th byte, i.e.
0101010 0110101 0110110 0110110 101000101010 10001101 00000000
the highest 5 bits of 5th byte move to the lowest bit of 6th byte, i.e.
0101010 0110101 0110110 0110110 0101010 1000110110100 00000000
the highest 6 bits of 6th byte move to the lowest bit of 7th byte, i.e.
0101010 0110101 0110110 0110110 0101010 0110100 00000000100011
the highest 7 bits of 7th byte move to the lowest bit of 8th byte, i.e.
0101010 0110101 0110110 0110110 0101010 0110100 0100011 0000000
this is the final result: 2A 35 36 36 2A 34 23 00(*566*4#)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值