1 #include <gammu.h>
2 #include <stdlib.h>
3
4 #include "common.h"
5
6 #include "../helper/message-display.h"
7 #include "../helper/message-cmdline.h"
8
main(int argc,char ** argv)9 int main(int argc, char **argv)
10 {
11 GSM_MultiSMSMessage sms;
12 GSM_Error error;
13 GSM_Message_Type type = SMS_Display;
14 GSM_Debug_Info *debug_info;
15 int i;
16
17 /* Configure debugging */
18 debug_info = GSM_GetGlobalDebug();
19 GSM_SetDebugFileDescriptor(stdout, FALSE, debug_info);
20 /* Include debugging to help diagnose test failures */
21 GSM_SetDebugLevel("textall", debug_info);
22
23 error = CreateMessage(&type, &sms, argc, 1, argv, NULL);
24 gammu_test_result(error, "CreateMessage");
25
26 DisplayMultiSMSInfo(&sms, FALSE, TRUE, NULL, NULL);
27 DisplayMultiSMSInfo(&sms, TRUE, TRUE, NULL, NULL);
28
29 for (i = 0; i < sms.Number; i++) {
30 printf("Message number: %i\n", i);
31 sms.SMS[i].SMSC.Location = 0;
32 error = DisplaySMSFrame(&sms.SMS[i], NULL);
33 gammu_test_result(error, "DisplaySMSFrame");
34 }
35
36 printf("\n");
37 printf("Number of messages: %i\n", sms.Number);
38 return 0;
39 }
40
41 /* Editor configuration
42 * vim: noexpandtab sw=8 ts=8 sts=8 tw=72:
43 */
44