summaryrefslogtreecommitdiff
path: root/src/sms_utils.h
blob: 2c50eb7f1ebebf035d8fa2f159bca2e20f652aaa (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef __SMS_UTILS_H
#define __SMS_UTILS_H

#include <stdarg.h>

#include "pdu.h"
#include "list.h"
#include "phonebook.h"

#ifdef __SMS_UTILS_C
#define SMS_UTILS_EXTERN
#else
#define SMS_UTILS_EXTERN extern
#endif

#define SMS_PDU_MODE		0
#define SMS_TEXT_MODE		1

#define SMS_FORMAT_3GPP		1
#define SMS_FORMAT_3GPP2	0

#define SMS_ADDR_UNSPEC			0x00
#define SMS_ADDR_LOCAL			0x81
#define SMS_ADDR_GLOBAL			0x91
#define SMS_ADDR_NATIONAL		0xA1
#define SMS_ADDR_TEXT			0xD1
#define SMS_ADDR_CMD			0xFF

enum {
	SMS_MSG_REC_UNREAD = 0,
	SMS_MSG_REC_READ = 1,
	SMS_MSG_STO_UNSENT = 2,
	SMS_MSG_STO_SENT = 3,
	SMS_MSG_ALL = 4,
};

enum {
	SMS_DELETE_INDEX = 0,
	SMS_DELETE_READ = 1,
	SMS_DELETE_READSENT = 2,
	SMS_DELETE_READSTO = 3,
	SMS_DELETE_ALL = 4,
};

int msg_status_name_to_value(const char *name);
const char *msg_status_value_to_name(int value);

struct sms_msg {
	int index;
	int status;
	char name[PHONEBOOK_TEXT_SIZE];
	int len;
	struct pdu_info pdu;
	struct list_head list;
};

void sms_msg_free(struct sms_msg *msg);
struct sms_msg *sms_msg_alloc(void);

#endif /* ~__SMS_UTILS_H */