Translation update done using Pootle.
[gammu.git] / tests / sms-cmdline.c
blob37b29f53d527d45ac773afed790e10e2e7fd6e92
1 #include <gammu.h>
2 #include <stdlib.h>
4 #include "common.h"
6 #include "../helper/message-display.h"
7 #include "../helper/message-cmdline.h"
9 int main(int argc, char **argv)
11 GSM_MultiSMSMessage sms;
12 GSM_Error error;
13 GSM_Message_Type type = SMS_Display;
14 GSM_Debug_Info *debug_info;
15 int i;
17 /* Configure debugging */
18 debug_info = GSM_GetGlobalDebug();
19 GSM_SetDebugFileDescriptor(stderr, FALSE, debug_info);
20 /* No debugging as it messes up checking results */
21 GSM_SetDebugLevel("none", debug_info);
23 error = CreateMessage(&type, &sms, argc, 1, argv, NULL);
24 gammu_test_result(error, "CreateMessage");
26 DisplayMultiSMSInfo(&sms, FALSE, TRUE, NULL, NULL);
27 DisplayMultiSMSInfo(&sms, TRUE, TRUE, NULL, NULL);
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");
36 printf("\n");
37 printf("Number of messages: %i\n", sms.Number);
38 return 0;
41 /* Editor configuration
42 * vim: noexpandtab sw=8 ts=8 sts=8 tw=72: