Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help. What is the encoding for GDL90 messages over WebSocket #788

Closed
3 of 6 tasks
femski opened this issue Aug 7, 2019 · 3 comments
Closed
3 of 6 tasks

Help. What is the encoding for GDL90 messages over WebSocket #788

femski opened this issue Aug 7, 2019 · 3 comments

Comments

@femski
Copy link

femski commented Aug 7, 2019

  1. Stratux version:

  2. Stratux config:

    SDR

    • single
    • dual

    GPS

    • yes
    • no
      type:

    AHRS

    • yes
    • no

    power source:

    usb cable:

  3. EFB app and version: (e.g., WingX Pro7 8.6.2)

    I am the developer of AvNav so its about AvNav

    EFB platform: (e.g., iOS 9.2) iOS and Android

    EFB hardware: (e.g., iPad Mini 2) Mini, iPAD etc

  4. Description of your issue:

I am trying to decode the ws://192.168.10.1/gdl90 WebSocket messages from Javascript App in iOS safari (ours is a PWA). It seems Stratux does not set message type to Binary so they end up as "String" in iOS Safari client. After that its difficult to figure just how to decode this string - I have tried various ways including TextEncoder but data does not come out correct.

It would have been nice if message type was binary because browsers can then receive it as binary. I am not asking to change this at this point, but just want to know how to decode a byte[] sent via Go Websocket that ends up as string in javascript WebSocket client! To me it seems incompatible

Any ideas ?

@femski
Copy link
Author

femski commented Aug 7, 2019

My code is like this:

let client = new ReconnectingWebsocket("ws://192.168.10.1/gdl90");
client.binaryType = 'arraybuffer'
client.onmessage = (event: MessageEvent) => {
console.log("ADSB Buffer is String: " + event.type)
console.log("ADSB data: " + event.data
})

Stratux send "strings" like this and below and encoder like

data = new TextEncoder("utf-8").encode(event.data)

or any other encoder/decoder does nt seem to have produced valid bytestream.

"fhQQoNN0HUWKy29GKKmJGJAWxANBQUwxNDg3AABG1X4="
"fgARAfqhAADiA34="
"fhQQoNN0HUWOy28RKKmJGKAWwwNBQUwxNDg3AAAIFH4="
"flNYAQEBBQEC/////wH4AAYAAwAAAAMAAAEiAZcAonh+"
"fhQQoNN0HUWOy28RKKmJGKAWwwNBQUwxNDg3AAAIFH4="

@femski femski changed the title Help. What is encoding for GDL90 messages over WebSocket Help. What is the encoding for GDL90 messages over WebSocket Aug 7, 2019
@femski
Copy link
Author

femski commented Aug 14, 2019

Figured its base64 encoded with some extra quote characters.
Closing.
Thanks.

@femski femski closed this as completed Aug 14, 2019
@stevecagle59
Copy link

Hi, Did you resolve this GDL90 decoding problem? If I do a base64 decode the data doesn't match the message description for a GDL90 heartbeat message lets say.
Thanks,
Steve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants