diff --git a/commandkeys.go b/commandkeys.go index 36c4bf6..cabb9f6 100644 --- a/commandkeys.go +++ b/commandkeys.go @@ -754,7 +754,7 @@ func (b *Talkkonnect) cmdDisplayVersion() { log.Println("info: Talkkonnect Version Request ") releasedVersion := checkGitHubVersion() if talkkonnectVersion != releasedVersion { - log.Printf("warn: Ver %v Rel %v (Newer Ver %v Available!)\n", talkkonnectVersion, talkkonnectReleased, releasedVersion) + log.Printf("warn: Ver %v Rel %v (Different Ver %v Available!)\n", talkkonnectVersion, talkkonnectReleased, releasedVersion) } else { log.Printf("info: Ver %v Rel %v (Latest Release)\n", talkkonnectVersion, talkkonnectReleased) } diff --git a/media.go b/media.go index fff5dff..f4672ad 100644 --- a/media.go +++ b/media.go @@ -43,16 +43,18 @@ import ( func aplayLocal(fileNameWithPath string) { var player string + CmdArguments := []string{} + if path, err := exec.LookPath("aplay"); err == nil { + CmdArguments = []string{fileNameWithPath, "-q", "-N"} player = path } else if path, err := exec.LookPath("paplay"); err == nil { + CmdArguments = []string{fileNameWithPath} player = path } else { return } - CmdArguments := []string{fileNameWithPath, "-q", "-N"} - log.Printf("debug: player %v CmdArguments %v", player, CmdArguments) cmd := exec.Command(player, CmdArguments...) diff --git a/onevent.go b/onevent.go index 84b670c..0940a12 100644 --- a/onevent.go +++ b/onevent.go @@ -337,19 +337,25 @@ func (b *Talkkonnect) OnPermissionDenied(e *gumble.PermissionDeniedEvent) { } func (b *Talkkonnect) OnChannelChange(e *gumble.ChannelChangeEvent) { + log.Println("debug: Channel Change Event Detected") } func (b *Talkkonnect) OnUserList(e *gumble.UserListEvent) { + log.Println("debug: On User List Event Detected") } func (b *Talkkonnect) OnACL(e *gumble.ACLEvent) { + log.Println("debug: On ACL Event Detected") } func (b *Talkkonnect) OnBanList(e *gumble.BanListEvent) { + log.Println("debug: OnBanList Event Detected") } func (b *Talkkonnect) OnContextActionChange(e *gumble.ContextActionChangeEvent) { + log.Println("debug: OnContextActionChange Event Detected") } func (b *Talkkonnect) OnServerConfig(e *gumble.ServerConfigEvent) { + log.Println("debug: OnServerConfigs Event Detected") } diff --git a/talkkonnect.go b/talkkonnect.go index 863b958..12df7df 100644 --- a/talkkonnect.go +++ b/talkkonnect.go @@ -55,7 +55,7 @@ func talkkonnectBanner(backgroundcolor string) { log.Println("info: " + backgroundcolor + "└────────────────────────────────────────────────────────────────┘" + backgroundreset) releasedVersion := checkGitHubVersion() if talkkonnectVersion != releasedVersion { - log.Printf("warn: Ver %v Rel %v (Newer Ver %v Available!)\n", talkkonnectVersion, talkkonnectReleased, releasedVersion) + log.Printf("warn: Ver %v Rel %v (Different Ver %v Available!)\n", talkkonnectVersion, talkkonnectReleased, releasedVersion) } else { log.Printf("info: Ver %v Rel %v (Latest Release)\n", talkkonnectVersion, talkkonnectReleased) } diff --git a/version.go b/version.go index 37ef24d..06ea16e 100644 --- a/version.go +++ b/version.go @@ -31,11 +31,18 @@ package talkkonnect const ( - talkkonnectVersion string = "2.07.20" - talkkonnectReleased string = "Jan 11 2022" + talkkonnectVersion string = "2.07.21" + talkkonnectReleased string = "Jan 12 2022" ) /* Release Notes -1. Combined http traccar protocols into one function -2. Added sound events for user to know traccar status +1. Sanity Check for voiceactivitytimersecs if less that 200 msecs set to 200 msecs +2. Removed redundant definition of ttyKBStruct and usbStruct and combined into one struct +3. Removed unused definition of InputEventSoundStruct +4. Added Tighter GPIO Checks for Pins 2,3 If I2C Device enabled these pins should be avoided warning +5. Added Tighter GPIO Checks for Pins 7,8,9,10,11 if SPI Device Enabled these pins should be avoided warning +6. Added Tighter GPIO Checks for Pins in the rage 2-27 only +7. Added Debugging Verbosity to currently unhandled mumble events +8. Fixed Command Arguements for PaPlay +9. Changed version checking function instead of saying newer version available say different version available */ diff --git a/xmlparser.go b/xmlparser.go index b50ba90..91ce729 100644 --- a/xmlparser.go +++ b/xmlparser.go @@ -509,15 +509,7 @@ type VTStruct struct { } } -type TTYKBStruct struct { - Enabled bool - KeyLabel uint32 - Command string - ParamName string - ParamValue string -} - -type USBKBStruct struct { +type KBStruct struct { Enabled bool KeyLabel uint32 Command string @@ -532,13 +524,6 @@ type EventSoundStruct struct { Blocking bool } -type InputEventSoundStruct struct { - Enabled bool - InputEvent string - ToneFrequency int - ToneDuration float32 -} - type InputEventSoundFileStruct struct { Event string File string @@ -597,8 +582,8 @@ var ( var ( LcdText = [4]string{"nil", "nil", "nil", "nil"} MyLedStrip *LedStrip - TTYKeyMap = make(map[rune]TTYKBStruct) - USBKeyMap = make(map[rune]USBKBStruct) + TTYKeyMap = make(map[rune]KBStruct) + USBKeyMap = make(map[rune]KBStruct) ) //Mumble Account Settings Global Variables @@ -707,10 +692,10 @@ func readxmlconfig(file string, reloadxml bool) error { for _, kMainCommands := range Config.Global.Hardware.Keyboard.Command { if kMainCommands.Enabled { if kMainCommands.Ttykeyboard.Enabled { - TTYKeyMap[kMainCommands.Ttykeyboard.Scanid] = TTYKBStruct{kMainCommands.Ttykeyboard.Enabled, kMainCommands.Ttykeyboard.Keylabel, kMainCommands.Action, kMainCommands.ParamName, kMainCommands.Paramvalue} + TTYKeyMap[kMainCommands.Ttykeyboard.Scanid] = KBStruct{kMainCommands.Ttykeyboard.Enabled, kMainCommands.Ttykeyboard.Keylabel, kMainCommands.Action, kMainCommands.ParamName, kMainCommands.Paramvalue} } if kMainCommands.Usbkeyboard.Enabled { - USBKeyMap[kMainCommands.Usbkeyboard.Scanid] = USBKBStruct{kMainCommands.Usbkeyboard.Enabled, kMainCommands.Usbkeyboard.Keylabel, kMainCommands.Action, kMainCommands.ParamName, kMainCommands.Paramvalue} + USBKeyMap[kMainCommands.Usbkeyboard.Scanid] = KBStruct{kMainCommands.Usbkeyboard.Enabled, kMainCommands.Usbkeyboard.Keylabel, kMainCommands.Action, kMainCommands.ParamName, kMainCommands.Paramvalue} } } @@ -1390,6 +1375,12 @@ func CheckConfigSanity(reloadxml bool) { } } + if Config.Global.Hardware.VoiceActivityTimermsecs < 200 { + log.Print("warn: Config Error [Section Hardware] VoiceActivityTimersecs < 200 setting to 200") + Config.Global.Hardware.VoiceActivityTimermsecs = 200 + Warnings++ + } + for index, gpio := range Config.Global.Hardware.IO.Pins.Pin { if gpio.Enabled { if !(gpio.Direction == "input" || gpio.Direction == "output") { @@ -1414,12 +1405,22 @@ func CheckConfigSanity(reloadxml bool) { Warnings++ } - if gpio.PinNo > 30 { + if gpio.PinNo < 2 || gpio.PinNo > 27 { log.Printf("warn: Config Error [Section GPIO] Enabled GPIO Name %v Pin Number %v Invalid GPIO Number\n", gpio.Name, gpio.PinNo) Config.Global.Hardware.IO.Pins.Pin[index].Enabled = false Warnings++ } + if (Config.Global.Hardware.OLED.Enabled || Config.Global.Hardware.IO.GPIOExpander.Enabled || Config.Global.Hardware.LCD.InterfaceType == "i2c") && (gpio.PinNo == 2 || gpio.PinNo == 3) { + log.Printf("warn: Config Possible Pins Clash with I2C Interface [Section GPIO] Enabled GPIO Name %v Pin Number %v Invalid GPIO Number\n", gpio.Name, gpio.PinNo) + Warnings++ + } + + if (Config.Global.Hardware.LedStripEnabled) && (gpio.PinNo == 7 || gpio.PinNo == 8 || gpio.PinNo == 9 || gpio.PinNo == 10 || gpio.PinNo == 11) { + log.Printf("warn: Config Possible Pins Clash with SPI Interface [Section GPIO] Enabled GPIO Name %v Pin Number %v Invalid GPIO Number\n", gpio.Name, gpio.PinNo) + Warnings++ + } + if gpio.ID > 8 { log.Print("warn: Config Error [Section GPIO] Invalid ChipID Address") Config.Global.Hardware.IO.Pins.Pin[index].Enabled = false