File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747#define NORMAL_MODE " AT+CFUN=1,1\r\n "
4848#define REGISTRATION_STATUS " AT+CREG?\r\n "
4949#define SIGNAL_QUALITY " AT+CSQ\r\n "
50+ #define READ_VOLTAGE " AT+CBC\r\n "
5051#define SLEEP_MODE " AT+CSCLK=1\r\n "
5152
5253#define OK " OK\r\n "
@@ -66,7 +67,8 @@ Result HTTP::configureBearer(const char *apn){
6667 sendATTest ();
6768
6869 while (sendCmdAndWaitForResp (REGISTRATION_STATUS, CONNECTED, 2000 ) != TRUE && attempts < MAX_ATTEMPTS){
69- sendCmdAndWaitForResp (SIGNAL_QUALITY, CONNECTED, 1000 );
70+ sendCmdAndWaitForResp (READ_VOLTAGE, OK, 1000 );
71+ sendCmdAndWaitForResp (SIGNAL_QUALITY, OK, 1000 );
7072 attempts ++;
7173 delay (1000 * attempts);
7274 if (attempts == MAX_ATTEMPTS) {
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ void SIM800::sendCmd(const char* cmd)
9090
9191int SIM800::sendATTest (void )
9292{
93- int ret = sendCmdAndWaitForResp (" AT\r\n " ," OK" ,DEFAULT_TIMEOUT);
93+ int ret = sendCmdAndWaitForResp (" AT\r\n " , " OK" , DEFAULT_TIMEOUT);
9494 return ret;
9595}
9696
@@ -126,7 +126,6 @@ void SIM800::sendEndMark(void)
126126 serialSIM800.println ((char )26 );
127127}
128128
129-
130129int SIM800::sendCmdAndWaitForResp (const char * cmd, const char *resp, unsigned timeout)
131130{
132131 delay (1000 );
You can’t perform that action at this time.
0 commit comments