Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding CFUN - Airplane Mode settings #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Adafruit_FONA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,21 @@ uint8_t Adafruit_FONA::getIMEI(char *imei) {
return strlen(imei);
}

/********* CFUN *******************************************************/
boolean Adafruit_FONA::setCFUN(uint8_t i) {
if (! sendCheckReply(F("AT+CFUN="), i, ok_reply))
return false;
}

uint8_t Adafruit_FONA::getCFUN(void) {
uint16_t status;

if (! sendParseReply(F("AT+CFUN?"), F("+CFUN: "), &status)) return 255;

return status;
}


/********* NETWORK *******************************************************/

uint8_t Adafruit_FONA::getNetworkStatus(void) {
Expand Down
9 changes: 9 additions & 0 deletions Adafruit_FONA.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@
#define FONA_CALL_RINGING 3
#define FONA_CALL_INPROGRESS 4

#define FONA_CFUN_MINIMUM 0
#define FONA_CFUN_FULL 1
#define FONA_CFUN_FLIGHT 4
#define FONA_CFUN_UNKNOWN 255

class Adafruit_FONA : public FONAStreamType {
public:
Adafruit_FONA(int8_t r);
Expand Down Expand Up @@ -98,6 +103,10 @@ class Adafruit_FONA : public FONAStreamType {
// IMEI
uint8_t getIMEI(char *imei);

// set Functionaly Mode
boolean setCFUN(uint8_t mode);
uint8_t getCFUN(void);

// set Audio output
boolean setAudio(uint8_t a);
boolean setVolume(uint8_t i);
Expand Down