@@ -615,7 +615,16 @@ class LoRaModem : public Stream
615615 return false ;
616616 }
617617 return true ;
618- }
618+ }
619+
620+ int getDataRate () {
621+ int dr = -1 ;
622+ sendAT (GF (" +DR?" ));
623+ if (waitResponse (" +OK=" ) == 1 ) {
624+ dr = stream.readStringUntil (' \r ' ).toInt ();
625+ }
626+ return dr;
627+ }
619628
620629 bool setADR (bool adr) {
621630 sendAT (GF (" +ADR=" ), adr);
@@ -625,6 +634,76 @@ class LoRaModem : public Stream
625634 return true ;
626635 }
627636
637+ int getADR () {
638+ int adr = -1 ;
639+ sendAT (GF (" +ADR?" ));
640+ if (waitResponse (" +OK=" ) == 1 ) {
641+ adr = stream.readStringUntil (' \r ' ).toInt ();
642+ }
643+ return adr;
644+ }
645+
646+ String getDevAddr () {
647+ String devaddr = " " ;
648+ sendAT (GF (" +DEVADDR?" ));
649+ if (waitResponse (" +OK=" ) == 1 ) {
650+ devaddr = stream.readStringUntil (' \r ' );
651+ }
652+ return devaddr;
653+ }
654+
655+ String getNwkSKey () {
656+ String nwkskey = " " ;
657+ sendAT (GF (" +NWKSKEY?" ));
658+ if (waitResponse (" +OK=" ) == 1 ) {
659+ nwkskey = stream.readStringUntil (' \r ' );
660+ }
661+ return nwkskey;
662+ }
663+
664+ String getAppSKey () {
665+ String appskey = " " ;
666+ sendAT (GF (" +APPSKEY?" ));
667+ if (waitResponse (" +OK=" ) == 1 ) {
668+ appskey = stream.readStringUntil (' \r ' );
669+ }
670+ return appskey;
671+ }
672+
673+ bool setFCU (uint16_t fcu) {
674+ sendAT (GF (" +FCU=" ), fcu);
675+ if (waitResponse () != 1 ) {
676+ return false ;
677+ }
678+ return true ;
679+ }
680+
681+ int32_t getFCU () {
682+ int32_t fcu = -1 ;
683+ sendAT (GF (" +FCU?" ));
684+ if (waitResponse (" +OK=" ) == 1 ) {
685+ fcu = stream.readStringUntil (' \r ' ).toInt ();
686+ }
687+ return fcu;
688+ }
689+
690+ bool setFCD (uint16_t fcd) {
691+ sendAT (GF (" +FCD=" ), fcd);
692+ if (waitResponse () != 1 ) {
693+ return false ;
694+ }
695+ return true ;
696+ }
697+
698+ int32_t getFCD () {
699+ int32_t fcd = -1 ;
700+ sendAT (GF (" +FCD?" ));
701+ if (waitResponse (" +OK=" ) == 1 ) {
702+ fcd = stream.readStringUntil (' \r ' ).toInt ();
703+ }
704+ return fcd;
705+ }
706+
628707
629708private:
630709
0 commit comments