-
Notifications
You must be signed in to change notification settings - Fork 2
/
FirstOctet.h
64 lines (52 loc) · 1.4 KB
/
FirstOctet.h
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
61
62
63
64
#ifndef _FIRST_OCTET_H_
#define _FIRST_OCTET_H_
#include "Util.h"
enum SMS_MTI
{
/* SMS-DELIVER (in the direction SC to MS) */
MTI_DELIVER = 0,
/* SMS-DELIVER REPORT (in the direction MS to SC) */
MTI_DELIVER_REPORT = 0,
/* SMS-STATUS-REPORT (in the direction SC to MS) */
MTI_SUBMIT = 1,
/* SMS-COMMAND (in the direction MS to SC) */
MTI_SUBMIT_REPORT = 1,
/* SMS-SUBMIT (in the direction MS to SC) */
MTI_STATUS_REPORT = 2,
/* SMS-SUBMIT-REPORT (in the direction SC to MS) */
MTI_COMMAND = 2,
/* Reserved */
MTI_RESERVED = 3
};
class FirstOctet
{
private:
/* Message Type Indicator */
unsigned char mti:2;
/* Reject Duplicates */
unsigned char rd:1;
/* Validity Period Format */
unsigned char vpf:2;
/* Status Report Request */
unsigned char srr:1;
/* User Data Header Indicator */
unsigned char udhi:1;
/* Reply Path */
unsigned char rp:1;
public:
FirstOctet();
/* Set TP-RD */
void setRd(bool rd = true);
/* Set TP-SRR */
void setSrr(bool srr = true);
/* Set TP-UDHI */
void setUdhi(bool udhi = true);
/* Set TP-RP */
void setRp(bool rp = true);
/* Set TP-MTI */
void setMti(unsigned char mti);
/* Set TP-VPF */
void setVpf(unsigned char vpf);
string format();
};
#endif /* _FIRST_OCTET_H_ */