protocol/aprs: extract comment to frame
This commit is contained in:
@@ -29,6 +29,7 @@ type Frame struct {
|
|||||||
Longitude float64
|
Longitude float64
|
||||||
Altitude float64
|
Altitude float64
|
||||||
Symbol string
|
Symbol string
|
||||||
|
Comment string
|
||||||
}
|
}
|
||||||
|
|
||||||
func Parse(s string) (*Frame, error) {
|
func Parse(s string) (*Frame, error) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Message struct {
|
type Message struct {
|
||||||
ID int `json::"id"`
|
ID int `json:"id"`
|
||||||
IsAcknowledge bool `json:"is_ack"`
|
IsAcknowledge bool `json:"is_ack"`
|
||||||
IsRejection bool `json:"is_rejection"`
|
IsRejection bool `json:"is_rejection"`
|
||||||
IsBulletin bool `json:"is_bulletin"`
|
IsBulletin bool `json:"is_bulletin"`
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ func (d micEDecoder) Decode(frame *Frame) (data Data, err error) {
|
|||||||
frame.Longitude = report.Longitude
|
frame.Longitude = report.Longitude
|
||||||
frame.Altitude = report.Altitude
|
frame.Altitude = report.Altitude
|
||||||
frame.Symbol = report.Symbol
|
frame.Symbol = report.Symbol
|
||||||
|
frame.Comment = report.Comment
|
||||||
|
|
||||||
return report, nil
|
return report, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ func (d positionDecoder) Decode(frame *Frame) (data Data, err error) {
|
|||||||
frame.Longitude = pos.Longitude
|
frame.Longitude = pos.Longitude
|
||||||
frame.Altitude = pos.Altitude
|
frame.Altitude = pos.Altitude
|
||||||
frame.Symbol = pos.Symbol
|
frame.Symbol = pos.Symbol
|
||||||
|
frame.Comment = pos.Comment
|
||||||
|
|
||||||
return pos, nil
|
return pos, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user