Skip to content
/ sbp Public

Parser/Serializer for the Swift Navigation Binary Protocol (SBP)

Notifications You must be signed in to change notification settings

kteru/sbp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sbp

Parser/Serializer for the Swift Navigation Binary Protocol (SBP). This is compatible with SBP protocol specification v2.2.7 (stable messages).

GoDoc Build Status Coverage Status

Installation

$ go get -u github.com/kteru/sbp

Example

package main

import (
	"fmt"
	"io"
	"os"

	"github.com/kteru/sbp"
)

func main() {
	frd := sbp.NewFrameReader(os.Stdin)

	for {
		fr, err := frd.ReadFrame()
		if err == io.EOF {
			os.Exit(0)
		}
		if err != nil {
			continue
		}

		msg, _ := fr.Msg()

		switch m := msg.(type) {
		case *sbp.MsgPosLlh:
			fmt.Printf("%.9f,%.9f,%.3f,%d\n", m.Lat, m.Lon, m.Height, m.FixMode)
		}
	}
}

About

Parser/Serializer for the Swift Navigation Binary Protocol (SBP)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages