aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSmoke <[email protected]>2024-01-23 11:08:39 -1000
committerSmoke <[email protected]>2024-01-23 11:08:39 -1000
commit202889338e29c416e810de888734a2d41c6b1069 (patch)
treeaed29f8520321875be833c61c2f987ea1f549aea
parent33c1a57e8913b47ec46f7014d38a885d7525d761 (diff)
fix staticcheck issues
-rw-r--r--radio/radio.go1
-rw-r--r--transport/serial/serial.go4
-rw-r--r--transport/serial/usb.go19
3 files changed, 1 insertions, 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)
- }
- }
-}