Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
Tests/Test13.h
- Committer:
- nherriot
- Date:
- 2012-09-10
- Revision:
- 28:c630a04a7198
- Parent:
- 16:c89d426c6175
- Child:
- 29:c0e6f198db84
File content as of revision 28:c630a04a7198:
#pragma once
#include "VodafoneTestCase.h"
// this test case will wait to receive an SMS from the modem.
// if the method that reports a message waiting returns an error it will fail.
// if the method that returns the message from the mailbox returns an error it will fai.
// it will report the test as failed if any of the above happens.
// it waits forever for an SMS.
// TODO: this should wait for a set time before failing.
class Test13 : public VodafoneTestCase {
public:
char num[17];
char msg[64];
size_t count;
Test13(VodafoneUSBModem *m, int tcNumber) : VodafoneTestCase(m, tcNumber) {
}
virtual bool runTest() {
LOG("Creating GSM test buffer");
LOG("Test %d waiting for an SMS message...", _testCaseNumber);
LOG("Receiving SMS from test phone, waiting for response.");
while(true)
{
LOG("Waiting for an SMS message...");
int ret = _modem->getSMCount(&count);
if(ret)
{
LOG("getSMCount returned %d", ret);
Thread::wait(3000);
continue;
}
if( count > 0)
{
LOG("%d SMS to read", count);
ret = _modem->getSM(num, msg, 64);
if(ret)
{
LOG("Error receiving sms. The method getSMS returned %d", ret);
LOG("THE MESSAGE IS: %S", testMessage);
LOG("THE MESSAGE IS: %S", myMessage);
return false;
}
LOG("The message is from number: %s and the message is: \"%s\"", num, testMessage);
return true;
}
Thread::wait(500);
}
}
private:
char gsm03dot38CharacterSet[127];
// gsm03dot38CharacterSet="@�$�����������Δ_ΦΓΛΩΠΨΣΘΞ���� !�#�%&�()*+,-./0123456789:;<=>?�ABCDEFGHIJKLMNOPQRSTUVWXYZ���ܧ�abcdefghijklmnopqrstuvwxyz�����";
};

