简体   繁体   English

J8583如何将TPDU设置为二进制

[英]J8583 How set TPDU as Binary

I am using j8583 Library, and I need prepend a TPDU (10 digits in binary BCD Packed) to the message. 我正在使用j8583库,并且需要在消息前添加一个TPDU(二进制BCD包装中的10位数字)。

It´s possible ? 这是可能的 ?

The header of J8583 messages only use String in ASCII. J8583消息的标题仅使用ASCII字符串。

Unfortunately I had the same issue but i found a solution. 不幸的是,我遇到了同样的问题,但是找到了解决方案。 Simply you need to "pack" your message and calculate the TPDU in other variable byte[]. 只需简单地“打包”您的消息并在其他变量byte []中计算TPDU。 I assume your TDPU consist in: 我认为您的TDPU包括:

<2 bytes length of the messages><1 byte: 60><2 bytes origin><2 bytes destiny>

If you have packed your message in a byte[] and your TPDU in other byte[] simply create a new byte[] and concatenate with System.arraycopy. 如果您已将消息打包在一个byte []中,而您的TPDU打包在另一个byte []中,则只需创建一个新的byte []并与System.arraycopy串联即可。 I assume you know how to implement this. 我假设您知道如何实现此目标。

Regards 问候

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM