diff --git a/examples/lora/atcmd/commands.go b/examples/lora/atcmd/commands.go index 64c1ee1..1126fdb 100644 --- a/examples/lora/atcmd/commands.go +++ b/examples/lora/atcmd/commands.go @@ -67,7 +67,7 @@ func msg(data string) error { cmd := "MSG" writeCommandOutput(cmd, "Start") - if err := radio.LoraTx([]byte(data), defaultTimeout); err != nil { + if err := radio.Tx([]byte(data), defaultTimeout); err != nil { writeCommandOutput(cmd, err.Error()) return err @@ -82,7 +82,7 @@ func cmsg(data string) error { cmd := "CMSG" writeCommandOutput(cmd, "Start") - if err := radio.LoraTx([]byte(data), defaultTimeout); err != nil { + if err := radio.Tx([]byte(data), defaultTimeout); err != nil { writeCommandOutput(cmd, err.Error()) return err @@ -337,7 +337,7 @@ func send(data string) error { // remove leading/trailing quotes data = strings.Trim(data, "\"'") - if err := radio.LoraTx([]byte(data), defaultTimeout); err != nil { + if err := radio.Tx([]byte(data), defaultTimeout); err != nil { writeCommandOutput(cmd, err.Error()) return err @@ -363,7 +363,7 @@ func sendhex(data string) error { return err } - if err := radio.LoraTx(payload, defaultTimeout); err != nil { + if err := radio.Tx(payload, defaultTimeout); err != nil { writeCommandOutput(cmd, err.Error()) return err diff --git a/examples/lora/atcmd/radio.go b/examples/lora/atcmd/radio.go index eda7106..340f817 100644 --- a/examples/lora/atcmd/radio.go +++ b/examples/lora/atcmd/radio.go @@ -11,12 +11,12 @@ var ( type LoraRadio interface { Reset() - LoraTx(pkt []uint8, timeoutMs uint32) error - LoraRx(timeoutMs uint32) ([]uint8, error) - SetLoraFrequency(freq uint32) - SetLoraIqMode(mode uint8) - SetLoraCodingRate(cr uint8) - SetLoraBandwidth(bw uint8) - SetLoraCrc(enable bool) - SetLoraSpreadingFactor(sf uint8) + Tx(pkt []uint8, timeoutMs uint32) error + Rx(timeoutMs uint32) ([]uint8, error) + SetFrequency(freq uint32) + SetIqMode(mode uint8) + SetCodingRate(cr uint8) + SetBandwidth(bw uint8) + SetCrc(enable bool) + SetSpreadingFactor(sf uint8) } diff --git a/examples/lora/atcmd/sim.go b/examples/lora/atcmd/sim.go index f070077..93934d3 100644 --- a/examples/lora/atcmd/sim.go +++ b/examples/lora/atcmd/sim.go @@ -13,20 +13,20 @@ type SimLoraRadio struct { func (sr *SimLoraRadio) Reset() { } -func (sr *SimLoraRadio) LoraTx(pkt []uint8, timeoutMs uint32) error { +func (sr *SimLoraRadio) Tx(pkt []uint8, timeoutMs uint32) error { return nil } -func (sr *SimLoraRadio) LoraRx(timeoutMs uint32) ([]uint8, error) { +func (sr *SimLoraRadio) Rx(timeoutMs uint32) ([]uint8, error) { return nil, nil } -func (sr *SimLoraRadio) SetLoraFrequency(freq uint32) {} -func (sr *SimLoraRadio) SetLoraIqMode(mode uint8) {} -func (sr *SimLoraRadio) SetLoraCodingRate(cr uint8) {} -func (sr *SimLoraRadio) SetLoraBandwidth(bw uint8) {} -func (sr *SimLoraRadio) SetLoraCrc(enable bool) {} -func (sr *SimLoraRadio) SetLoraSpreadingFactor(sf uint8) {} +func (sr *SimLoraRadio) SetFrequency(freq uint32) {} +func (sr *SimLoraRadio) SetIqMode(mode uint8) {} +func (sr *SimLoraRadio) SetCodingRate(cr uint8) {} +func (sr *SimLoraRadio) SetBandwidth(bw uint8) {} +func (sr *SimLoraRadio) SetCrc(enable bool) {} +func (sr *SimLoraRadio) SetSpreadingFactor(sf uint8) {} func firmwareVersion() string { return "simulator " + currentVersion() diff --git a/examples/lora/atcmd/sx126x.go b/examples/lora/atcmd/sx126x.go index 9367839..8d476ce 100644 --- a/examples/lora/atcmd/sx126x.go +++ b/examples/lora/atcmd/sx126x.go @@ -65,5 +65,5 @@ func firmwareVersion() string { } func lorarx() ([]byte, error) { - return loraRadio.LoraRx(LORA_DEFAULT_RXTIMEOUT_MS) + return loraRadio.Rx(LORA_DEFAULT_RXTIMEOUT_MS) } diff --git a/examples/lora/atcmd/sx127x.go b/examples/lora/atcmd/sx127x.go index c89f108..dd5a7de 100644 --- a/examples/lora/atcmd/sx127x.go +++ b/examples/lora/atcmd/sx127x.go @@ -81,5 +81,5 @@ func firmwareVersion() string { } func lorarx() ([]byte, error) { - return loraRadio.LoraRx(LORA_DEFAULT_RXTIMEOUT_MS) + return loraRadio.Rx(LORA_DEFAULT_RXTIMEOUT_MS) }