From 202889338e29c416e810de888734a2d41c6b1069 Mon Sep 17 00:00:00 2001 From: Smoke <86024507+crypto-smoke@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:08:39 -1000 Subject: fix staticcheck issues --- radio/radio.go | 1 - transport/serial/serial.go | 4 +--- transport/serial/usb.go | 19 ------------------- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/radio/radio.go b/radio/radio.go index 7a5088e..31d113a 100644 --- a/radio/radio.go +++ b/radio/radio.go @@ -87,7 +87,6 @@ func GenerateByteSlices() [][]byte { } var ErrDecrypt = errors.New("unable to decrypt payload") -var otherKeys = GenerateByteSlices() // xorHash computes a simple XOR hash of the provided byte slice. func xorHash(p []byte) uint8 { diff --git a/transport/serial/serial.go b/transport/serial/serial.go index e3412c5..5e0cb9f 100644 --- a/transport/serial/serial.go +++ b/transport/serial/serial.go @@ -176,8 +176,6 @@ func (c *Conn) ConnectOld(ch chan *meshtastic.FromRadio, ch2 chan *meshtastic.To return nil } -var txtCh = make(chan *meshtastic.MeshPacket) - func (c *Conn) decodeProtos(printDebug bool, ch chan *meshtastic.FromRadio) { for { data, err := readUntilProtobuf(c.serialConn, printDebug) @@ -247,7 +245,7 @@ func readUntilProtobuf(reader io.Reader, printDebug bool) ([]byte, error) { } func (c *Conn) flushPort() error { - flush := make([]byte, 32, 32) + flush := make([]byte, 32) for j := 0; j < len(flush); j++ { flush[j] = START2 } diff --git a/transport/serial/usb.go b/transport/serial/usb.go index ed15f99..b341321 100644 --- a/transport/serial/usb.go +++ b/transport/serial/usb.go @@ -41,22 +41,3 @@ func GetPorts() []string { } return foundDevices } -func getUSB() { - ports, err := enumerator.GetDetailedPortsList() - if err != nil { - log.Fatal(err) - } - if len(ports) == 0 { - fmt.Println("No serial ports found!") - return - } - for _, port := range ports { - fmt.Printf("Found port: %s\n", port.Name) - if port.IsUSB { - fmt.Printf(" Product %s\n", port.Product) - - fmt.Printf(" USB ID %s:%s\n", port.VID, port.PID) - fmt.Printf(" USB serial %s\n", port.SerialNumber) - } - } -} -- cgit v1.2.3