More protocols

This commit is contained in:
2026-02-17 23:30:49 +01:00
parent 62a90a468d
commit 74a517a22a
15 changed files with 2268 additions and 21 deletions

30
protocol/packet.go Normal file
View File

@@ -0,0 +1,30 @@
package protocol
// Packet represents a raw packet.
type Packet struct {
Protocol string `json:"protocol"` // Protocol name
SNR float64 `json:"snr"` // Signal-to-noise Ratio
RSSI int8 `json:"rssi"` // Received Signal Strength Indicator
Raw []byte `json:"raw"` // Raw packet
}
type Device interface {
// Close the device.
Close() error
}
// Receiver of packets.
type Receiver interface {
Device
// RawPackets starts receiving raw packets.
RawPackets() <-chan *Packet
}
// Transmitter of packets.
type Transmitter interface {
Device
// SendRawPacket sends a raw (encoded) packet.
SendRawPacket(*Packet) error
}