Translation update done using Pootle.
[gammu.git] / tests / sms-nokia-02.c
blob62bbc9d81ca77af028451f098d7816abea3decdc
1 /* Test for decoding SMS on Nokia 6110 driver */
3 #include <gammu.h>
4 #include <stdlib.h>
5 #include <stdio.h>
6 #include "../libgammu/protocol/protocol.h" /* Needed for GSM_Protocol_Message */
7 #include "../libgammu/gsmstate.h" /* Needed for state machine internals */
9 #include "../helper/message-display.h"
11 #include "common.h"
13 unsigned char data[] = {
14 0x01, 0x08, 0x00, 0x08, 0x01, 0x02, 0x01, 0x00, 0x05, 0x91, 0x26, 0x18, 0x16, 0x42, 0x00, 0xF0,
15 0x10, 0x00, 0x05, 0x91, 0x00, 0x00, 0x00, 0xA0, 0x0E, 0xD0, 0x49, 0x27, 0xF1, 0x39, 0x0D, 0x52,
16 0x41, 0x0B, 0x0C, 0x91, 0x70, 0x50, 0x03, 0x11, 0x61, 0x13, 0x00, 0xD2, 0x70, 0x1A, 0x0D, 0xA2,
17 0xC9, 0x40, 0xD6, 0x77, 0x7D, 0x8C, 0x2E, 0xCB, 0x41, 0xC2, 0x32, 0x3B, 0xEC, 0x56, 0x87, 0x41,
18 0x52, 0xB8, 0xAC, 0x06, 0x93, 0x8B, 0x5B, 0x52, 0xB8, 0x4C, 0x49, 0x47, 0x05, 0xE1, 0xF2, 0x96,
19 0xB2, 0xEE, 0x86, 0xDD, 0x52, 0x2E, 0x6A, 0xDA, 0x7D, 0x5E, 0x87, 0xE9, 0xEB, 0xB0, 0x1B, 0x04,
20 0x2F, 0xB7, 0xC3, 0xEB, 0x70, 0x3A, 0xEC, 0x06, 0x05, 0xDD, 0xE4, 0x30, 0xC8, 0x04, 0x4A, 0xB7,
21 0xE4, 0x69, 0xF7, 0x19, 0x14, 0x5E, 0xD3, 0xD3, 0x66, 0xD7, 0xB2, 0x4C, 0x4F, 0xAF, 0x75, 0x52,
22 0x5A, 0x95, 0x37, 0x87, 0x87, 0xE7, 0x69, 0x9F, 0x33, 0xDC, 0x0E, 0x8F, 0x90, 0x6F, 0x71, 0x1A,
23 0xB4, 0x2E, 0xDF, 0x6E, 0xB7, 0x1B, 0x4A, 0x0A, 0x9F, 0xD5, 0x60, 0x2B, 0x28, 0xD4, 0x99, 0x72,
24 0x4D, 0xF3, 0x61, 0x79, 0x98, 0x0E, 0x32, 0x81, 0xD6, 0x65, 0x7A, 0xD9, 0x4D, 0xAF, 0x87, 0xDD,
25 0x20, 0x71, 0x59, 0xCE, 0x0E, 0xAF, 0xEB,
28 /* This is not part of API! */
29 extern GSM_Error N6110_ReplyGetSMSMessage(GSM_Protocol_Message *msg, GSM_StateMachine * s);
31 int main(int argc UNUSED, char **argv UNUSED)
33 GSM_Debug_Info *debug_info;
34 GSM_StateMachine *s;
35 GSM_Protocol_Message msg;
36 GSM_Error error;
37 GSM_MultiSMSMessage sms;
39 /* Init locales for proper output */
40 GSM_InitLocales(NULL);
42 debug_info = GSM_GetGlobalDebug();
43 GSM_SetDebugFileDescriptor(stderr, FALSE, debug_info);
44 GSM_SetDebugLevel("textall", debug_info);
46 /* Allocates state machine */
47 s = GSM_AllocStateMachine();
48 test_result(s != NULL);
50 /* Init message */
51 msg.Type = 0x14;
52 msg.Length = sizeof(data);
53 msg.Buffer = data;
55 s->Phone.Data.GetSMSMessage = &sms;
57 /* Parse it */
58 error = N6110_ReplyGetSMSMessage(&msg, s);
60 /* Display message */
61 DisplayMultiSMSInfo(&sms, FALSE, TRUE, NULL, NULL);
62 DisplayMultiSMSInfo(&sms, TRUE, TRUE, NULL, NULL);
64 /* Free state machine */
65 GSM_FreeStateMachine(s);
67 gammu_test_result(error, "N6110_ReplyGetSMSMessage");
69 return 0;
72 /* Editor configuration
73 * vim: noexpandtab sw=8 ts=8 sts=8 tw=72: