mirror of
https://github.com/KevinMidboe/TinyGSM.git
synced 2025-10-29 18:00:18 +00:00
use common TinyGsmUTFSMS calss
This commit is contained in:
@@ -45,7 +45,7 @@ enum TinyGSMDateTimeFormat {
|
||||
DATE_DATE = 2
|
||||
};
|
||||
|
||||
class TinyGsmSim5360
|
||||
class TinyGsmSim5360: public TinyGsmUTFSMS<TinyGsmSim5360>
|
||||
{
|
||||
|
||||
public:
|
||||
@@ -520,36 +520,6 @@ TINY_GSM_MODEM_WAIT_FOR_NETWORK()
|
||||
return waitResponse(60000L) == 1;
|
||||
}
|
||||
|
||||
bool sendSMS_UTF16(const String& number, const void* text, size_t len) {
|
||||
// Select message format (1=text)
|
||||
sendAT(GF("+CMGF=1"));
|
||||
waitResponse();
|
||||
// Select TE character set
|
||||
sendAT(GF("+CSCS=\"HEX\""));
|
||||
waitResponse();
|
||||
// Set text mode parameters
|
||||
sendAT(GF("+CSMP=17,167,0,8"));
|
||||
waitResponse();
|
||||
// Send the message
|
||||
sendAT(GF("+CMGS=\""), number, GF("\""));
|
||||
if (waitResponse(GF(">")) != 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint16_t* t = (uint16_t*)text;
|
||||
for (size_t i=0; i<len; i++) {
|
||||
uint8_t c = t[i] >> 8;
|
||||
if (c < 0x10) { stream.print('0'); }
|
||||
stream.print(c, HEX);
|
||||
c = t[i] & 0xFF;
|
||||
if (c < 0x10) { stream.print('0'); }
|
||||
stream.print(c, HEX);
|
||||
}
|
||||
stream.write((char)0x1A);
|
||||
stream.flush();
|
||||
return waitResponse(60000L) == 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Location functions
|
||||
|
||||
Reference in New Issue
Block a user