From 67612e0c035cf1900c6baba6f56ac38de9759dbf Mon Sep 17 00:00:00 2001 From: Kevin Golding Date: Thu, 16 Dec 2021 17:46:30 +0000 Subject: [PATCH] fix function bits consts --- examples/cli/main.go | 5 +++++ pocsagencode.go | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/examples/cli/main.go b/examples/cli/main.go index 3b6abe7..8838cb5 100644 --- a/examples/cli/main.go +++ b/examples/cli/main.go @@ -32,9 +32,14 @@ Usage: %s [-num] 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, }, diff --git a/pocsagencode.go b/pocsagencode.go index dc5c577..a9c5b2b 100644 --- a/pocsagencode.go +++ b/pocsagencode.go @@ -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