You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
492 B
Go
23 lines
492 B
Go
9 years ago
|
// Package dmr contains generic message structures for the Digital Mobile Radio standard
|
||
|
package dmr
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
|
||
|
"github.com/pd0mz/go-dmr/bit"
|
||
|
)
|
||
|
|
||
|
// Burst contains data from a single burst, see 4.2.2 Burst and frame structure
|
||
|
type Burst struct {
|
||
|
bits bit.Bits
|
||
|
}
|
||
|
|
||
|
func NewBurst(raw []byte) (*Burst, error) {
|
||
|
if len(raw)*8 != PayloadBits {
|
||
|
return nil, fmt.Errorf("dmr: expected %d bits, got %d", PayloadBits, len(raw)*8)
|
||
|
}
|
||
|
b := &Burst{}
|
||
|
b.bits = bit.NewBits(raw)
|
||
|
return b, nil
|
||
|
}
|