@sterretje thanks for the quick reply. Things are even easier for me - I don't need to cover all high ascii values, but only 7 chars:
(öäüÖÄÜß). I ignore all others.
I'm still confused about the values I received. My test SMS contained "mit mehr öäü". That should be:
{6D,69,74,20,6D,65,68,72,20...} and now three high ascii value {7C,7B,7E} according to the GSM encoding table I linked before.
with this little method:
void printASCIICode(char * myString) {
char currentChar;
for(int i=0;i<strlen(myString);i++) {
currentChar = myString[i];
Serial.println(currentChar,HEX);
}
}
I got this:
6D
69
74
20
6D
65
68
72
20
F6
E4
FC
Why do I get this high numbers (dec 246, 228 and 252) for the chars that should be 7C,7B,7E?
The relevant part of my code to retrieve the SMS:
//any data available from the FONA?
do {
//Read the notification into fonaNotificationBuffer
*bufPtr = fona.read();
delay(1);
} while ((*bufPtr++ != '\n') && (fona.available()) && (++charCount < (sizeof(fonaNotificationBuffer)-1)));
*bufPtr = 0; //Add a terminal NULL to the notification string
if (1 == sscanf(fonaNotificationBuffer, "%*c%*c+CMTI: " FONA_PREF_SMS_STORAGE ",%d", &slot)) {
// Retrieve SMS sender phone number.
if (! fona.getSMSSender(slot, callerIDbuffer, 31)) {
Serial.print(F("Didn't find SMS message in slot 1: "));
MYDEBUG_PRINTLN(slot);
}
MYDEBUG_PRINT(F("FROM: ")); MYDEBUG_PRINTLN(callerIDbuffer);
// Retrieve SMS value.
if (fona.readSMS(slot, smsBuffer, 250, &smslen)) { // pass in buffer and max len!
strcat(msgText, smsBuffer); // the msg
strcat(msgText, "#");
strcat(msgText, callerIDbuffer); // the callers number
emptyCharBuffer();
// delete the original msg after it is processed
deleteSingleSMS(slot);
}