1 /* Test for decoding SMS on Nokia 6110 driver */
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"
13 unsigned char data
[] = {
14 0x01, 0x08, 0x00, 0x08, 0x01, 0x02, 0x01, 0x00, 0x05, 0x91, 0x26, 0x18, 0x16, 0x42, 0x00, 0x00,
15 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x08, 0x0D, 0x91, 0x26, 0x58, 0x26, 0x84, 0x88, 0x65,
16 0xF8, 0x00, 0x00, 0x00, 0x70, 0x90, 0x30, 0x10, 0x61, 0x63, 0x82, 0xD4, 0xF2, 0x9C, 0x0E, 0x9A,
20 /* This is not part of API! */
21 extern GSM_Error
N6110_ReplyGetSMSMessage(GSM_Protocol_Message
*msg
, GSM_StateMachine
* s
);
23 int main(int argc UNUSED
, char **argv UNUSED
)
25 GSM_Debug_Info
*debug_info
;
27 GSM_Protocol_Message msg
;
29 GSM_MultiSMSMessage sms
;
31 debug_info
= GSM_GetGlobalDebug();
32 GSM_SetDebugFileDescriptor(stderr
, FALSE
, debug_info
);
33 GSM_SetDebugLevel("textall", debug_info
);
35 /* Allocates state machine */
36 s
= GSM_AllocStateMachine();
37 test_result(s
!= NULL
);
41 msg
.Length
= sizeof(data
);
44 s
->Phone
.Data
.GetSMSMessage
= &sms
;
47 error
= N6110_ReplyGetSMSMessage(&msg
, s
);
50 DisplayMultiSMSInfo(&sms
, FALSE
, TRUE
, NULL
, NULL
);
51 DisplayMultiSMSInfo(&sms
, TRUE
, TRUE
, NULL
, NULL
);
53 /* Free state machine */
54 GSM_FreeStateMachine(s
);
56 gammu_test_result(error
, "N6110_ReplyGetSMSMessage");
61 /* Editor configuration
62 * vim: noexpandtab sw=8 ts=8 sts=8 tw=72: