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

Wrong return value in send method #47

Open
peacekiller opened this issue Oct 5, 2022 · 1 comment
Open

Wrong return value in send method #47

peacekiller opened this issue Oct 5, 2022 · 1 comment

Comments

@peacekiller
Copy link

peacekiller commented Oct 5, 2022

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

@Slawwoj
Copy link

Slawwoj commented Jan 29, 2023

Were you able to resolve this problem? Because i have the same issue and any help would be great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants