0

我想解码 LoRaWAN 数据包并将其有效负载作为文本获取。

我试过的是

  1. 使用https://github.com/jsubercaze/javalora
final LoraDecrypter decrypter = new LoraDecrypter(
                Hex.decode("2B7E151628AED2A6ABF7158809CF4F3C"));

final byte[] decrypt = decrypter
                .decrypt("gRWQH+IAAAAAAAAAAAAAAACXIjkjAAj7");

final String hexString = ByteUtils.toHexString(decrypt);
System.out.println(hexString);

有效负载 hexString 的预期值为8115901FE2000000000000000000000000972239230008FB但我得到了bb03a676609aef0f7d4c6d044ee0b5

是否有任何其他库可以将 LoRaWAN 数据包有效负载数据作为十六进制字符串获取?

  1. 我使用了https://lorawan-packet-decoder-0ta6puiniaut.runkit.sh/它给出了我的预期值,但我想在 JAVA 中获得类似的输出。第 5 行给出了我的预期值PHYPayload = 8115901FE2000000000000000000000000972239230008FB
Assuming base64-encoded packet
gRWQH+IAAAAAAAAAAAAAAACXIjkjAAj7

Message Type = Data
  PHYPayload = 8115901FE2000000000000000000000000972239230008FB

( PHYPayload = MHDR[1] | MACPayload[..] | MIC[4] )
        MHDR = 81
  MACPayload = 15901FE2000000000000000000000000972239
         MIC = 230008FB

( MACPayload = FHDR | FPort | FRMPayload )
        FHDR = 15901FE2000000
       FPort = 00
  FRMPayload = 0000000000000000972239

      ( FHDR = DevAddr[4] | FCtrl[1] | FCnt[2] | FOpts[0..15] )
     DevAddr = E21F9015 (Big Endian)
       FCtrl = 00
        FCnt = 0000 (Big Endian)
       FOpts = 

Message Type = Confirmed Data Up
   Direction = up
        FCnt = 0
   FCtrl.ACK = false
   FCtrl.ADR = false
4

0 回答 0