Skip to content

Wrong return value in send method #47

Description

@peacekiller

Hi Erdem,

first let me thank you for developing this lib. I want to use it to realize my sms gateway using the SIM800L on an ESP8266 arduino board.

I get a compile error on line 148:

GSMSim/src/GSMSimSMS.cpp

Lines 127 to 156 in 337a9c8

bool GSMSimSMS::send(char* number, char* message) {
String str = "";
gsm.print(F("AT+CMGS=\"")); // command to send sms
gsm.print(number);
gsm.print(F("\"\r"));
_readSerial();
str += _buffer;
gsm.print(message);
gsm.print("\r");
//change delay 100 to readserial
//_buffer += _readSerial();
_readSerial();
str += _buffer;
gsm.print((char)26);
//_buffer += _readSerial();
_readSerial();
str += _buffer;
//expect CMGS:xxx , where xxx is a number,for the sending sms.
return str;
/**/
if (str.indexOf("+CMGS:") != -1) {
return true;
}
else {
return false;
}
}

The defined return type of the send method is boolean. But you try to return a string. It looks like a unwanted copypaste...

best regards

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions