Skip to content

Commit

Permalink
Make ATCommand function accept const char ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
sebromero committed Apr 12, 2024
1 parent b2d33d6 commit 82a1c6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/ArduinoCellular.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,13 @@ bool ArduinoCellular::enableGPS(bool assisted){
//delay(10000);
}

String ArduinoCellular::sendATCommand( char * command, unsigned long timeout){
String ArduinoCellular::sendATCommand(const char * command, unsigned long timeout){
String resp;
modem.sendAT(const_cast<char *>(command));
modem.sendAT(command);
modem.waitResponse(timeout, resp);
return resp;
}



Time parseTimestamp(const String &timestampStr) {
int hour, minute, second, day, month, year, offset;

Expand All @@ -280,6 +278,7 @@ Time parseTimestamp(const String &timestampStr) {

return Time(year, month, day, hour, minute, second, offset);
}

// Parses a single SMS entry from the data
SMS parseSMSEntry(const String& entry, const String& message) {
SMS sms;
Expand Down
2 changes: 1 addition & 1 deletion src/ArduinoCellular.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class ArduinoCellular {
* @param timeout The timeout (In milliseconds) to wait for the response.
* @return The response from the modem.
*/
String sendATCommand(char * command, unsigned long timeout = 1000);
String sendATCommand(const char * command, unsigned long timeout = 1000);


/**
Expand Down

0 comments on commit 82a1c6e

Please sign in to comment.