#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "m2m_type.h"
#include "m2m_hw_api.h"
#include "m2m_sms_api.h"
void SMS_Storage_Example(void)
{
INT32 i, Res;
M2M_T_SMS_MEM_STORAGE memory[3];
/* Set SMS storage */
Res = m2m_sms_set_preferred_message_storage("SM", "SM", "SM");
if ( Res != 1 )
{
PrintToUart("Set Error!"); /* See chapter 19.1.8 PrintToUart */
return;
}
/* Get SMS storage status */
Res = m2m_sms_get_preferred_message_storage(memory);
if ( Res != 1 )
{
PrintToUart("Get Error!");
return;
}
for ( i = 0; i < 3; i ++ )
{
PrintToUart("mem[%d] = %s", i, memory[i].mem );
PrintToUart("used[%d] = %d", i, memory[i].nUsed );
PrintToUart("tot[%d] = %d", i, memory[i].nTotal );
}
}
void M2M_main ( INT32 argc, CHAR argv[M2M_ARGC_MAX][M2M_ARGV_MAXTOKEN + 1] )
{
PrintToUart("SMS Storage Example\n");
SMS_Storage_Example();
}