Skip to content

Commit

Permalink
v.2.0.2
Browse files Browse the repository at this point in the history
Little fix for SMS
  • Loading branch information
erdemarslan committed May 9, 2020
1 parent f98c4cb commit a6c4e00
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ This library for Arduino to use SimCom GSM Modules. This library tested on Sim80
This library use any Serial library like HardwareSerial, SoftwareSerial etc. If you use SoftwareSerial, please dont forget this library's limits.

### ChangeLog
#### v.2.0.2
* Little fix for incoming SMS from iPhone. Remove ???? chars at the begining of SMS.

#### v.2.0.1
* GSMSim now can be use with any serial interface. Hardware or Software
* added some new methods.
Expand Down Expand Up @@ -36,7 +39,6 @@ Please visit the example pages.
* If it possible, use HardwareSerial. SoftwareSerial a bit laggy.
* Use highiest baudrate as you can. (I test on HardwareSerial 115200 baudrate, SoftwareSerial 57600 baudrate)
* Please chooice good power supply. I recommend 5V power supply and 1A or over. (Sim800L EVB Board)
* If it possible, use high SRAM devices like Arduino Mega.
* If the signal is weak or the power supply is insufficient, the module can reset itself on load.


Expand Down Expand Up @@ -82,7 +84,7 @@ saveSettingsToModule()|bool|Save some setting to module EEPROM.

Method Name |Return |Notes
:-------|:-------:|:-----------------------------------------------:|
initCall()|bool|Init call function. If you want to use other methods correctly, add your code this method.
initCall()|bool|Init call function. If you use other methods correctly, add your code this method.
call(char* phone_number)|bool|
answer()|bool|
hangoff()|bool|
Expand Down Expand Up @@ -119,7 +121,7 @@ readUSSD(String serialRaw)|String|Read USSD response from serial raw value.

Method Name |Return |Notes
:-------|:-------:|:-----------------------------------------------:|
initSMS()|bool|Init sms function. If you want to use other methods correctly, add your code this method.
initSMS()|bool|Init sms function. If you use other methods correctly, add your code this method.
setTextMode(bool textModeON)|bool|Text Mode or PDU Mode. This class works with TEXT Mode.
setPreferredSMSStorage(char* mem1, char* mem2, char* mem3)|bool|"ME" (Module), "SM" (Sim), "ME_P" (Module Preferred), "SM_P" (Sim Preferred), "MT" (ME or SM, Sim Preferred). Class use "ME" for all memories.
setNewMessageIndication()|bool|
Expand Down
4 changes: 2 additions & 2 deletions examples/GSMSim_SMS/GSMSim_SMS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* GSMSim_SMS.ino
*
* By Erdem ARSLAN
* Version: v.2.0.1
* Version: v.2.0.2
*
* The MIT License (MIT)
*
Expand Down Expand Up @@ -41,7 +41,7 @@
Begin to listen incoming messages...
1. SMS Index No... 38
Who send the message?...xxxxxxxxxxxx
Read the message... FOLDER:INCOMING|STATUS:UNREAD|PHONENO:xxxxxxxxxxxx|DATETIME:20/05/07,16:00:21+12|MESSAGE:⸮⸮⸮⸮Ne olsun. Yazisiyoruz kendimizle ;)
Read the message... FOLDER:INCOMING|STATUS:UNREAD|PHONENO:xxxxxxxxxxxx|DATETIME:20/05/07,16:00:21+12|MESSAGE:Ne olsun. Yazisiyoruz kendimizle ;)
*/
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=GSMSim
version=2.0.1
version=2.0.2
author=Erdem Arslan, [email protected]
maintainer=Erdem Arslan, [email protected]
sentence=GSM Library For SimCom Modules
Expand Down
23 changes: 22 additions & 1 deletion src/GSMSimSMS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* By Erdem ARSLAN
* Modified 06.05.2020
*
* Version: v.2.0.1
* Version: v.2.0.2
*
* Erdem ARSLAN
* Science and Technology Teacher, an Arduino Lover =)
Expand Down Expand Up @@ -254,6 +254,16 @@ String GSMSimSMS::read(unsigned int index) {

mesaj.trim();

// Little Fix for incoming messaged from iPhone
String messageHex = "";
for(int i = 0; i < mesaj.length(); i++) {
messageHex += String(mesaj[i], HEX);
}

if(messageHex.indexOf("ffa5ffa4ffa3ffa3") != -1) {
mesaj = mesaj.substring(4);
}

durum = "FOLDER:";
durum += klasor;
durum += "|STATUS:";
Expand Down Expand Up @@ -322,6 +332,17 @@ String GSMSimSMS::read(unsigned int index, bool markRead) {

mesaj.trim();


// Little Fix for incoming messaged from iPhone
String messageHex = "";
for(int i = 0; i < mesaj.length(); i++) {
messageHex += String(mesaj[i], HEX);
}

if(messageHex.indexOf("ffa5ffa4ffa3ffa3") != -1) {
mesaj = mesaj.substring(4);
}

durum = "FOLDER:";
durum += klasor;
durum += "|STATUS:";
Expand Down

0 comments on commit a6c4e00

Please sign in to comment.