Skip to content

Conversation

Williangalvani
Copy link

@Williangalvani Williangalvani commented Nov 10, 2024

I need to get this stuff out onto a separate file, but I'm opening the pr so I don't forget about it.
I already works as is. With BlueOS, I use ws://192.168.2.2/mavlink2rest/ws/mavlink for connecting.
This just maps the msg object format from mavlink2rest`s to the one outputted by the js parser.

@@ -115,6 +271,17 @@ function setup_connect(button_svg, button_color) {
}

ws.onmessage = (msg) => {
if (msg.data[0] == "{") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should just be able to check if its a string. Presuming that the json data is sent as a text message and that raw is sent with the binary message.

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

Successfully merging this pull request may close these issues.

2 participants