Lorawan uplink support and new lorawan 'basic-demo' example

This commit is contained in:
Olivier Fauchon
2023-01-10 23:15:39 +01:00
committed by Ron Evans
parent 301e6bc35b
commit 889536f7f0
15 changed files with 195 additions and 28 deletions
+11 -1
View File
@@ -71,7 +71,17 @@ func Join(otaa *Otaa, session *Session) error {
return nil
}
func SendUplink() error {
func SendUplink(data []uint8, session *Session) error {
payload, err := session.GenMessage(0, []byte(data))
if err != nil {
return err
}
ActiveRadio.SetCrc(true)
ActiveRadio.SetIqMode(0) // IQ Standard
ActiveRadio.Tx(payload, LORA_RXTX_TIMEOUT)
if err != nil {
return err
}
return nil
}