mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-12 19:03:42 +00:00
Lorawan uplink support and new lorawan 'basic-demo' example
This commit is contained in:
committed by
Ron Evans
parent
301e6bc35b
commit
889536f7f0
@@ -0,0 +1,40 @@
|
||||
//go:build !featherwing && !gnse && !lorae5 && !nucleowl55jc
|
||||
|
||||
package common
|
||||
|
||||
import "tinygo.org/x/drivers/lora"
|
||||
|
||||
// do simulator setup here
|
||||
func SetupLora() (lora.Radio, error) {
|
||||
return &SimLoraRadio{}, nil
|
||||
}
|
||||
|
||||
type SimLoraRadio struct {
|
||||
}
|
||||
|
||||
func (sr *SimLoraRadio) Reset() {
|
||||
}
|
||||
|
||||
func (sr *SimLoraRadio) Tx(pkt []uint8, timeoutMs uint32) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (sr *SimLoraRadio) Rx(timeoutMs uint32) ([]uint8, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
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 (sr *SimLoraRadio) LoraConfig(cnf lora.Config) {}
|
||||
|
||||
func FirmwareVersion() string {
|
||||
return "simulator " + CurrentVersion()
|
||||
}
|
||||
|
||||
func Lorarx() ([]byte, error) {
|
||||
return nil, nil
|
||||
}
|
||||
Reference in New Issue
Block a user