File: sms-encode-decode.c

package info (click to toggle)
gammu 1.42.0-11
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,340 kB
  • sloc: ansic: 107,388; pascal: 7,209; cpp: 3,976; php: 1,622; python: 1,559; sh: 1,208; sql: 601; perl: 240; makefile: 162; asm: 31; cs: 4
file content (39 lines) | stat: -rw-r--r-- 1,296 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <gammu.h>
#include "../helper/message-display.h"
#include "common.h"

int main(int argc UNUSED, char **argv UNUSED)
{
	GSM_MultiSMSMessage sms;
	GSM_Error error;
	GSM_MultiPartSMSInfo SMSInfo;
	unsigned char Buffer[800];

	GSM_ClearMultiPartSMSInfo(&SMSInfo);
	SMSInfo.EntriesNum = 1;

	EncodeUnicode(Buffer,
		      ".........1.........2.........3.........4.........5.........6.........7.........8.........9........0"
		      ".........1.........2.........3.........4.........5.........6.........7.........8.........9........0"
		      ".........1.........2.........3.........4.........5.........6.........7.........8.........9........0", 300);
	SMSInfo.Entries[0].Buffer = Buffer;
	SMSInfo.Entries[0].ID = SMS_ConcatenatedTextLong;
	SMSInfo.UnicodeCoding = FALSE;
	error = GSM_EncodeMultiPartSMS(NULL, &SMSInfo, &sms);

	gammu_test_result(error, "GSM_EncodeMultiPartSMS");

	/* Just set some values to sender so that we don't print mess */
	EncodeUnicode(sms.SMS[0].Number, "321", GSM_MAX_NUMBER_LENGTH);
	EncodeUnicode(sms.SMS[1].Number, "321", GSM_MAX_NUMBER_LENGTH);

	/* Display message */
	DisplayMultiSMSInfo(&sms, FALSE, TRUE, NULL, NULL);
	DisplayMultiSMSInfo(&sms, TRUE, TRUE, NULL, NULL);

	return 0;
}

/* Editor configuration
 * vim: noexpandtab sw=8 ts=8 sts=8 tw=72:
 */