Documentation
¶
Overview ¶
Package network provides network streaming capabilities for NMEA sentences
Package network provides network streaming capabilities for NMEA sentences
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseServer ¶
BaseServer provides common functionality for TCP and WebSocket servers
func NewBaseServer ¶
func NewBaseServer(cfg Config) *BaseServer
NewBaseServer creates a new base server with the given configuration
type Config ¶
type Config struct {
Host string
Port int
UpdateInterval time.Duration
Logger zerolog.Logger
SentenceOptions SentenceOptions
BaudRate int
Protocol string // "nmea0183" or "nmea2000"
}
Config holds server configuration
type NMEA2000Server ¶ added in v1.1.0
NMEA2000Server represents a server that can stream NMEA 2000 messages
type SentenceOptions ¶
type SentenceOptions struct {
EnablePosition bool // GGA, GLL
EnableEnvironment bool // DBT, MTW, MWV, VHW, DPT
}
SentenceOptions configures which NMEA sentences to generate
type TCP2000Server ¶ added in v1.1.0
type TCP2000Server struct {
*BaseServer
// contains filtered or unexported fields
}
TCP2000Server implements NMEA 2000 message streaming over TCP
func NewTCP2000Server ¶ added in v1.1.0
func NewTCP2000Server(cfg Config) *TCP2000Server
NewTCP2000Server creates a new TCP server instance for NMEA 2000
func (*TCP2000Server) SendPGN ¶ added in v1.1.0
func (s *TCP2000Server) SendPGN(msg pgn.Message) error
SendPGN sends a NMEA 2000 message to all connected clients
func (*TCP2000Server) Start ¶ added in v1.1.0
func (s *TCP2000Server) Start(ctx context.Context) error
Start begins the TCP server
func (*TCP2000Server) Stop ¶ added in v1.1.0
func (s *TCP2000Server) Stop() error
Stop terminates the TCP server
type TCPServer ¶
type TCPServer struct {
*BaseServer
// contains filtered or unexported fields
}
TCPServer implements NMEA sentence streaming over TCP
func NewTCPServer ¶
NewTCPServer creates a new TCP server instance
type WebSocket2000Server ¶ added in v1.1.0
type WebSocket2000Server struct {
*BaseServer
// contains filtered or unexported fields
}
WebSocket2000Server implements NMEA 2000 message streaming over WebSocket
func NewWebSocket2000Server ¶ added in v1.1.0
func NewWebSocket2000Server(cfg Config) *WebSocket2000Server
NewWebSocket2000Server creates a new WebSocket server instance for NMEA 2000
func (*WebSocket2000Server) SendPGN ¶ added in v1.1.0
func (s *WebSocket2000Server) SendPGN(msg pgn.Message) error
SendPGN sends a NMEA 2000 message to all connected WebSocket clients
func (*WebSocket2000Server) Start ¶ added in v1.1.0
func (s *WebSocket2000Server) Start(ctx context.Context) error
Start begins the WebSocket server
func (*WebSocket2000Server) Stop ¶ added in v1.1.0
func (s *WebSocket2000Server) Stop() error
Stop terminates the WebSocket server
type WebSocketServer ¶
type WebSocketServer struct {
*BaseServer
// contains filtered or unexported fields
}
WebSocketServer implements NMEA sentence streaming over WebSocket
func NewWebSocketServer ¶
func NewWebSocketServer(cfg Config) *WebSocketServer
NewWebSocketServer creates a new WebSocket server instance
func (*WebSocketServer) Start ¶
func (s *WebSocketServer) Start(ctx context.Context) error
Start begins the WebSocket server
func (*WebSocketServer) Stop ¶
func (s *WebSocketServer) Stop() error
Stop closes all client connections and stops the server