Simple test for USSD message.

Dependencies:   C027 UbloxUSBModem mbed

Fork of C027_USSDTest by u-blox

main.cpp

Committer:
mazgch
Date:
2013-10-21
Revision:
3:08248ee71fc0
Parent:
1:e5d64ece3a8c
Child:
4:ffbfe5f03e61

File content as of revision 3:08248ee71fc0:

#include "mbed.h"
#include "C027.h"
#include "UbloxUSBGSMModem.h"
#include "UbloxUSBCDMAModem.h"

#define USSD_COMMAND "*#134#"

void test(void const*) 
{
    UbloxUSBGSMModem modem; // for LISA-C use the UbloxUSBCDMAModem instead
    char result[32];

    printf("Sending %s on USSD channel\n", USSD_COMMAND);

    int ret = modem.sendUSSD(USSD_COMMAND, result, 32);
    if(ret)
    {
      printf("Send USSD command returned %d\n", ret);
    } 

    printf("Result of command: %s\n", result);


    while(1) {
    }
}


int main()
{
  Thread testTask(test, NULL, osPriorityNormal, 1024 * 4);
  DigitalOut led(A0);
  while(1)
  {
    led=!led;
    Thread::wait(1000);  
  }

  return 0;
}