Documentation ¶
Overview ¶
Package homebrew implements the DL5DI Homebrew protocol compatible with BrandMeister
https://wiki.brandmeister.network/images/5/54/DMRplus_IPSC_Protocol_for_HB_repeater.pdf
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Close() error
- func (c *Client) ListenAndServe(f chan<- *DMRData) error
- func (c *Client) SendDMR(dmrData *DMRData) error
- func (c *Client) SendIdle(tokenID uint64, token string) error
- func (c *Client) SendInterrupt(slot uint8) error
- func (c *Client) SendRSSI(slot uint8, dBm float32) error
- func (c *Client) SendWake(tokenID uint64, token string) error
- type Configuration
- type DMRData
- type Options
Constants ¶
const ( DefaultPort = 62030 DefaultKeepAliveInterval = time.Second * 5 DefaultTimeout = time.Second * 15 DefaultFirebaseTokenID = 393838907279 DefaultFirebaseToken = "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1" )
Defaults
const ( SignDMRData = "DMRD" SignRepeaterConfig = "RPTC" SignRepeaterLogin = "RPTL" SignRepeaterKey = "RPTK" SignRepeaterPong = "RPTPONG" SignRepeaterClose = "RPTCL" SignRepeaterRSSI = "RPTRSSI" SignRepeaterInterrupt = "RPTINTR" SignRepeaterIdle = "RPTIDLE" SignRepeaterWake = "RPTWAKE" SignMaster = "MST" SignMasterACK = "MSTACK" SignMasterNAK = "MSTNAK" SignMasterPing = "MSTPING" SignMasterClose = "MSTCL" )
Message types
Variables ¶
var ( ErrInvalidCallsign = errors.New("homebrew: invalid callsign") ErrInvalidColorCode = errors.New("homebrew: invalid color code") ErrInvalidLatitude = errors.New("homebrew: invalid latitude") ErrInvalidLongitude = errors.New("homebrew: invalid longitude") ErrInvalidSlot = errors.New("homebrew: invalid slot") ErrMasterRefusedLogin = errors.New("homebrew: master refused login") ErrMasterRefusedPassword = errors.New("homebrew: master refused password") ErrMasterClose = errors.New("homebrew: master sent close") ErrMasterShortNonce = errors.New("homebrew: master sent short nonce") )
Errors
var Debug bool
Debug enables debug messages
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { KeepAlive time.Duration Timeout time.Duration // Configuration of the repeater Configuration *Configuration // Description of the client Description string // URL of the client URL string // contains filtered or unexported fields }
Client implementing the Homebrew protocol
func NewClient ¶
func NewClient(cfg *Configuration, addr, password string) (*Client, error)
NewClient sets up a Homebrew protocol client with defaults configured.
func (*Client) Close ¶
Close the client socket and stop the receiver loop after it has been started by ListenAndServe.
func (*Client) ListenAndServe ¶
ListenAndServe starts the packet receiver and decoder
func (*Client) SendInterrupt ¶
SendInterrupt sends a call interrupt to a time slot (0 = DMO, 1 = ts1, 2 = ts2)
type Configuration ¶
type Configuration struct { // Callsign of the repeater Callsign string // ID DMR-ID of the repeater ID uint32 // RXFreq frequency in Hz RXFreq int // TXFreq frequency in Hz TXFreq int // TXPower in dBm, decimal [0,99] TXPower uint8 // ColorCode [1,15] ColorCode uint8 // Latitude with north as positive [-90,+90] Latitude float64 // Longitude with east as positive [-180+,180] Longitude float64 // Height above ground in meters Height uint16 // Location description Location string // Description (optional) about the repeater Description string // URL (optional) for the repeater or group URL string // SoftwareID with version (no HTML, no ads, no spam) SoftwareID string // PackageID with version and platform (no HTML, no ads, no spam) PackageID string }
Configuration for the Homebrew repeater
func (*Configuration) Check ¶
func (c *Configuration) Check() error
Check if the supplied Configuration is sane
type DMRData ¶
type DMRData struct { // Signature (always DMRD) Signature [4]byte // Sequence of data frame Sequence uint8 // Source ID Source dmr.ID // Target ID Target dmr.ID // Repeater ID Repeater uint32 // Options flags Options Options // Stream ID Stream uint32 // Data is the raw DMR data Data [33]byte }
DMRData is a DMR data frame with metadata from the LC
type Options ¶
type Options uint8
Options flags
func (Options) DataType ¶
DataType raw DMR data type for data calls, voice frame number for voice calls