Skip to content

Commit

Permalink
fix function bits consts
Browse files Browse the repository at this point in the history
  • Loading branch information
kgolding committed Dec 16, 2021
1 parent 6014bf9 commit 67612e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions examples/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ Usage: %s [-num] <pager addr> <text or numeric message>
fmt.Println("Invalid pager addr - must be a number")
os.Exit(2)
}
function := pc.FunctionAlpha
if num {
function = pc.FunctionNum
}
messages := []*pc.Message{
&pc.Message{
Addr: uint32(addr),
Function: function,
Content: flag.Arg(0),
IsNumeric: num,
},
Expand Down
10 changes: 6 additions & 4 deletions pocsagencode.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import (
type FunctionBits byte

const (
FunctionA = FunctionBits(00)
FunctionB = FunctionBits(01)
FunctionC = FunctionBits(10)
FunctionD = FunctionBits(11)
FunctionA = FunctionBits(0b00)
FunctionB = FunctionBits(0b01)
FunctionC = FunctionBits(0b10)
FunctionD = FunctionBits(0b11)
FunctionAlpha = FunctionBits(0b00)
FunctionNum = FunctionBits(0b11)
)

// Message is a single POCSAG Alphanumeric message
Expand Down

0 comments on commit 67612e0

Please sign in to comment.