レガシー システムと Android デバイスの間で双方向通信を行う必要があります。従来のシステムでは、リトル エンディアンのバイト順が使用されています。受信部分は正常に実装されましたが、送信は機能しません。
私にとっては、ByteBufferクラスが誤動作しているように見えるので奇妙です(私はそれをほとんど信じられません)
ByteBuffer byteBuffer = ByteBuffer.allocate(4);
byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
byteBuffer = ByteBuffer.allocate(4);
byteBuffer.putInt(88);
byte[] result = byteBuffer.array();
結果: [0, 0, 0, 88]
ByteBuffer byteBuffer = ByteBuffer.allocate(4);
byteBuffer.order(ByteOrder.BIG_ENDIAN);
byteBuffer = ByteBuffer.allocate(4);
byteBuffer.putInt(88);
byte[] result = byteBuffer.array();
また、結果は同じです: [0, 0, 0, 88]
ただし、リトルエンディアンの順序を間違えていなければ、[88, 0, 0, 0] が返されます。
それで、私が見逃しているポイントは何ですか?