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.
36 lines
838 B
Markdown
36 lines
838 B
Markdown
Go port of the POCSAG::Encode Perl module.
|
|
|
|
Example usage
|
|
|
|
```
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
|
|
"github.com/kgolding/go-pocsagencode"
|
|
)
|
|
|
|
func main() {
|
|
messages := []*pocsagencode.Message{
|
|
&pocsagencode.Message{1300100, "Hello Pager!"},
|
|
}
|
|
|
|
for i := 0; i < 50; i++ {
|
|
addr := uint32(1200000 + i*100)
|
|
messages = append(messages, &pocsagencode.Message{addr, fmt.Sprintf("Hello pager number %d", addr)})
|
|
}
|
|
|
|
log.Println("Sending", len(messages), "messages")
|
|
var burst pocsagencode.Burst
|
|
for len(messages) > 0 {
|
|
burst, messages = pocsagencode.Generate(messages)
|
|
// Options can be set as below for MaxLen and PreambleBits
|
|
// burst, messages = pocsagencode.Generate(messages, pocsagencode.OptionPreambleBits(250))
|
|
log.Println("Burst", burst.String())
|
|
// Send Burst to the FSK modem here...
|
|
}
|
|
log.Println("Done")
|
|
}
|
|
``` |