Documentation
¶
Index ¶
Constants ¶
View Source
const ( MagicStart1 = byte(0x94) MagicStart2 = byte(0xc3) MaxPayloadLength = 512 )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type DownlinkAudience ¶
type DownlinkAudience struct {
// contains filtered or unexported fields
}
type DownlinkBaseConfig ¶
type DownlinkBaseConfig struct {
Uplink string `toml:"uplink"`
MeshPacketBuffer int `toml:"mesh_packet_buffer"`
MeshPacketDedupe bool `toml:"mesh_packet_dedupe"`
}
func (*DownlinkBaseConfig) GetDownlinkBaseConfig ¶
func (c *DownlinkBaseConfig) GetDownlinkBaseConfig() *DownlinkBaseConfig
func (*DownlinkBaseConfig) Prepare ¶
func (c *DownlinkBaseConfig) Prepare() error
type FrameCollector ¶
type FrameCollector struct {
// contains filtered or unexported fields
}
FrameCollector searches for frames in a byte stream and collects them. It accepts data chunks that may contain zero, one, or multiple frames, and handles cases where frames are split across multiple chunks.
func NewFrameCollector ¶
func NewFrameCollector(logger *slog.Logger) *FrameCollector
func (*FrameCollector) Collect ¶
func (c *FrameCollector) Collect(data []byte) []*Frame
func (*FrameCollector) Reset ¶
func (c *FrameCollector) Reset()
type RingBuffer ¶
type RingBuffer[T any] struct { // contains filtered or unexported fields }
func NewRingBuffer ¶
func NewRingBuffer[T any](capacity int) *RingBuffer[T]
func (*RingBuffer[T]) Add ¶
func (rb *RingBuffer[T]) Add(item T)
func (*RingBuffer[T]) GetAll ¶
func (rb *RingBuffer[T]) GetAll() []T
func (*RingBuffer[T]) GetLastN ¶
func (rb *RingBuffer[T]) GetLastN(n int) []T
func (*RingBuffer[T]) Reset ¶
func (rb *RingBuffer[T]) Reset()
type Uplink ¶
type Uplink struct {
// contains filtered or unexported fields
}
func NewUplink ¶
func NewUplink(logger *slog.Logger, config UplinkBaseConfig, connector UplinkConnector) *Uplink
func (*Uplink) AttachClient ¶
func (*Uplink) GetNodeInfo ¶
func (u *Uplink) GetNodeInfo() *protobuf.MyNodeInfo
type UplinkBaseConfig ¶
type UplinkBaseConfig struct {
ID string `toml:"id"`
ReconnectInterval *time.Duration `toml:"reconnect_interval"`
RequestConfig bool `toml:"request_config"`
MeshPacketBuffer int `toml:"-"` // maximum MeshPacketBuffer value across all downlinks using this uplink
}
func (*UplinkBaseConfig) GetUplinkBaseConfig ¶
func (c *UplinkBaseConfig) GetUplinkBaseConfig() *UplinkBaseConfig
func (*UplinkBaseConfig) Prepare ¶
func (c *UplinkBaseConfig) Prepare() error
Click to show internal directories.
Click to hide internal directories.