Skip to content

Commit 82a1c6e

Browse files
committed
Make ATCommand function accept const char ptr
1 parent b2d33d6 commit 82a1c6e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/ArduinoCellular.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,13 @@ bool ArduinoCellular::enableGPS(bool assisted){
247247
//delay(10000);
248248
}
249249

250-
String ArduinoCellular::sendATCommand( char * command, unsigned long timeout){
250+
String ArduinoCellular::sendATCommand(const char * command, unsigned long timeout){
251251
String resp;
252-
modem.sendAT(const_cast<char *>(command));
252+
modem.sendAT(command);
253253
modem.waitResponse(timeout, resp);
254254
return resp;
255255
}
256256

257-
258-
259257
Time parseTimestamp(const String &timestampStr) {
260258
int hour, minute, second, day, month, year, offset;
261259

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

281279
return Time(year, month, day, hour, minute, second, offset);
282280
}
281+
283282
// Parses a single SMS entry from the data
284283
SMS parseSMSEntry(const String& entry, const String& message) {
285284
SMS sms;

src/ArduinoCellular.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class ArduinoCellular {
189189
* @param timeout The timeout (In milliseconds) to wait for the response.
190190
* @return The response from the modem.
191191
*/
192-
String sendATCommand(char * command, unsigned long timeout = 1000);
192+
String sendATCommand(const char * command, unsigned long timeout = 1000);
193193

194194

195195
/**

0 commit comments

Comments
 (0)