Translation update done using Pootle.
[gammu.git] / tests / nokia-6110-ringtone.c
blobbd30fdda8e901ff011cb475b258c48bb33208613
1 /* Test for decoding Ringtine 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 "common.h"
11 unsigned char data[] = {
12 0x01, 0x01, 0x9E, 0x00, 0x00, 0x00, 0x01, 0x2C, 0x02, 0x4A, 0x3A, 0x6D, 0x4D, 0x85, 0xB8, 0x81,
13 0x4D, 0x95, 0x89, 0x85, 0xCD, 0xD1, 0xA4, 0x04, 0x1E, 0x89, 0x22, 0xD5, 0x16, 0x49, 0x16, 0x11,
14 0x41, 0x64, 0x14, 0x41, 0x34, 0x11, 0x42, 0x4D, 0xA0, 0xCA, 0x14, 0x45, 0x05, 0x10, 0x65, 0x06,
15 0x12, 0x41, 0x85, 0x90, 0x61, 0x06, 0x50, 0x61, 0x05, 0x90, 0x61, 0x06, 0x52, 0x61, 0x85, 0x90,
16 0x61, 0x06, 0x52, 0x61, 0x85, 0x90, 0x51, 0x05, 0x12, 0x41, 0x85, 0x90, 0x61, 0x05, 0x92, 0x45,
17 0x84, 0x50, 0x59, 0x05, 0x10, 0x4D, 0x04, 0x50, 0x93, 0x68, 0x32, 0x85, 0x11, 0x41, 0x44, 0x19,
18 0x41, 0x84, 0x90, 0x61, 0x64, 0x18, 0x41, 0x94, 0x18, 0x41, 0x64, 0x98, 0x61, 0x94, 0x18, 0x41,
19 0x64, 0x98, 0x61, 0x94, 0x98, 0x61, 0x64, 0x14, 0x41, 0x44, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
20 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
21 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
22 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
23 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
24 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
25 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
26 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
27 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
28 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
29 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
30 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
31 0x00, 0x00, 0x00, 0x00,
34 /* This is not part of API! */
35 extern GSM_Error N6110_ReplyGetRingtone(GSM_Protocol_Message *msg, GSM_StateMachine * s);
37 int main(int argc UNUSED, char **argv UNUSED)
39 GSM_Debug_Info *debug_info;
40 GSM_StateMachine *s;
41 GSM_Protocol_Message msg;
42 GSM_Error error;
43 GSM_Ringtone Ringtone;
45 debug_info = GSM_GetGlobalDebug();
46 GSM_SetDebugFileDescriptor(stderr, FALSE, debug_info);
47 GSM_SetDebugLevel("textall", debug_info);
49 /* Allocates state machine */
50 s = GSM_AllocStateMachine();
51 test_result(s != NULL);
52 debug_info = GSM_GetDebug(s);
53 GSM_SetDebugGlobal(TRUE, debug_info);
54 GSM_SetDebugFileDescriptor(stderr, FALSE, debug_info);
55 GSM_SetDebugLevel("textall", debug_info);
57 /* Init message */
58 msg.Type = 0x40;
59 msg.Length = sizeof(data);
60 msg.Buffer = data;
62 s->Phone.Data.Ringtone = &Ringtone;
63 Ringtone.Format = RING_NOTETONE;
65 /* Parse it */
66 error = N6110_ReplyGetRingtone(&msg, s);
68 /* Free state machine */
69 GSM_FreeStateMachine(s);
71 gammu_test_result(error, "N6110_ReplyGetRingtone");
73 return 0;
76 /* Editor configuration
77 * vim: noexpandtab sw=8 ts=8 sts=8 tw=72: