1 |
|
#ifndef __SMSPDU_H__ |
2 |
|
#define __SMSPDU_H__ |
3 |
|
|
4 |
#include <string> |
#include <string> |
5 |
#include <vector> |
#include <vector> |
6 |
|
|
7 |
|
#include "Sms.h" |
8 |
|
|
9 |
struct PduInfo |
struct PduInfo |
10 |
{ |
{ |
11 |
std::string pdu; |
std::string pdu; |
12 |
int len; |
int len; |
13 |
}; |
}; |
14 |
|
|
15 |
|
|
16 |
|
struct SmsPart |
17 |
|
{ |
18 |
|
std::string message; |
19 |
|
std::string sender; |
20 |
|
short group,count,id; |
21 |
|
|
22 |
|
bool operator<(const SmsPart& p2) const |
23 |
|
{ |
24 |
|
return (id < p2.id); |
25 |
|
} |
26 |
|
bool operator==(const SmsPart& p2) const |
27 |
|
{ |
28 |
|
return (message==p2.message && sender==p2.sender && group==p2.group && count==p2.count && id==p2.id); |
29 |
|
} |
30 |
|
|
31 |
|
}; |
32 |
|
|
33 |
namespace SmsPdu |
namespace SmsPdu |
34 |
{ |
{ |
35 |
|
//public section: |
36 |
|
std::vector<PduInfo> CreateSmsPdu(std::string to, std::string message, bool allowMultipart); |
37 |
|
|
38 |
|
SMS ParseSmsPdu(std::string pdu); |
39 |
|
|
40 |
|
//private section: |
41 |
|
|
42 |
|
SmsPart ParseSmsPduWorker(std::string pdu); |
43 |
|
|
44 |
std::string EncodePhonenr(std::string input); |
std::string EncodePhonenr(std::string input); |
45 |
std::string DecodePhonenr(std::string input); |
std::string DecodePhonenr(std::string input); |
46 |
|
|
47 |
std::string HexformatVector(std::vector<unsigned char> vec); |
std::string HexformatVector(std::vector<unsigned char> vec); |
48 |
|
std::vector<unsigned char> HexDecodeString(std::string str); |
49 |
|
|
50 |
std::vector<unsigned char> Encode7to8bit(std::string str); |
std::vector<unsigned char> Encode7to8bit(std::string str, int shift_start); |
51 |
std::string Decode8to7bit( std::vector<unsigned char> input ); |
std::string Decode8to7bit( std::vector<unsigned char> input, int shift_start ); |
|
|
|
|
std::vector<PduInfo> CreateSmsPdu(std::string to, std::string message, bool allowMultipart); |
|
52 |
|
|
53 |
} |
} |
54 |
|
|
55 |
|
#endif // __SMSPDU_H__ |
56 |
|
|