pkg :github.com/bluenviron/gomavlib/v3 v3.3.0
I am not using the general TCP/UDP protocols directly, but adopting other transport protocols for data transmission. I would like to ask if there is any function or method available to convert Message() message.Message type data into binary data for MAVLink. I intend to transmit this binary data via a private proprietary protocol. I cannot accept converting Message() message.Message data into JSON format, as this conversion is too slow and occupies excessive bandwidth.
for {
select {
case evt := <-p.node.Events():
switch ev := evt.(type) {
case *gomavlib.EventFrame:
//I want to convert the data from ev.Message() into binary data.
return ev.Message(), nil
case *gomavlib.EventParseError:
// fmt.Printf("parse error: %v\n", ev.Error)
continue
}
case <-time.After(5 * time.Second):
return nil, errors.New("read timeout")
}
}
pkg :github.com/bluenviron/gomavlib/v3 v3.3.0
I am not using the general TCP/UDP protocols directly, but adopting other transport protocols for data transmission. I would like to ask if there is any function or method available to convert Message() message.Message type data into binary data for MAVLink. I intend to transmit this binary data via a private proprietary protocol. I cannot accept converting Message() message.Message data into JSON format, as this conversion is too slow and occupies excessive bandwidth.
for {
select {
case evt := <-p.node.Events():
switch ev := evt.(type) {
case *gomavlib.EventFrame:
//I want to convert the data from ev.Message() into binary data.
return ev.Message(), nil