From c67f84086b4bc7b8c9ed12de53b99bbf21ff6316 Mon Sep 17 00:00:00 2001 From: Wijnand Modderman-Lenstra Date: Tue, 8 Dec 2015 14:54:18 +0100 Subject: [PATCH] Docs --- homebrew/homebrew.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/homebrew/homebrew.go b/homebrew/homebrew.go index 52d2e8d..8e03736 100644 --- a/homebrew/homebrew.go +++ b/homebrew/homebrew.go @@ -119,22 +119,28 @@ type Frame struct { DMR [33]byte } +// CallType returns if the current frame is a group or unit call. func (f *Frame) CallType() CallType { return CallType((f.Flags >> 1) & 0x01) } +// DataType is the slot type when the FrameType is a data sync frame. For voice +// frames it's the voice sequence number in DMR numbering, where 0=A, 1=B, etc. func (f *Frame) DataType() byte { return f.Flags >> 4 } +// FrameType returns if the current frame is a voice, voice sync or data sync frame. func (f *Frame) FrameType() FrameType { return FrameType((f.Flags >> 2) & 0x03) } +// Slot is the time slot number. func (f *Frame) Slot() int { return int(f.Flags&0x01) + 1 } +// ParseFrame parses a raw DMR data frame. func ParseFrame(data []byte) (*Frame, error) { if len(data) != 53 { return nil, errors.New("invalid packet length")