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.
29 lines
535 B
Go
29 lines
535 B
Go
package repeater
|
|
|
|
import (
|
|
"github.com/tehmaze/go-dmr/bptc"
|
|
"github.com/tehmaze/go-dmr/dmr"
|
|
"github.com/tehmaze/go-dmr/ipsc"
|
|
)
|
|
|
|
func (r *Repeater) HandleDataHeader(p *ipsc.Packet) error {
|
|
var (
|
|
h dmr.DataHeader
|
|
err error
|
|
payload = make([]byte, 12)
|
|
)
|
|
|
|
if err = bptc.Process(dmr.ExtractInfoBits(p.PayloadBits), payload); err != nil {
|
|
return err
|
|
}
|
|
if h, err = dmr.ParseDataHeader(payload, false); err != nil {
|
|
return err
|
|
}
|
|
|
|
// TODO(maze): handle receiving of data blocks
|
|
switch h.(type) {
|
|
}
|
|
|
|
return nil
|
|
}
|