diff options
author | Brandon Bayer <bbayer@multitech.com> | 2015-10-26 14:58:43 -0500 |
---|---|---|
committer | Brandon Bayer <bbayer@multitech.com> | 2015-11-06 13:49:06 -0600 |
commit | be01eb8a87f1582b1c15ec4e09a9a66770da87c5 (patch) | |
tree | d2044a650d334dca4aa2efb2521e3ecf887ac86b /src/pdu.h | |
parent | ab80a82e2e0f5ea7cdef0394f80e69b377fab779 (diff) | |
download | sms-utils-be01eb8a87f1582b1c15ec4e09a9a66770da87c5.tar.gz sms-utils-be01eb8a87f1582b1c15ec4e09a9a66770da87c5.tar.bz2 sms-utils-be01eb8a87f1582b1c15ec4e09a9a66770da87c5.zip |
feat: sms support for CE910-DUAL, DE910-DUAL, LE910-SVG0.0.8
- PDU is used for everything except LE910-SVG sending
- a bug in radio requires radio reboot to send more than 1 PDU sms
Diffstat (limited to 'src/pdu.h')
-rw-r--r-- | src/pdu.h | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -18,6 +18,7 @@ extern char *strptime(const char *s, const char *format, struct tm *tm); #define PDU_UD_SIZE (PDU_UD_7BIT_MAX + 1) #define PDU_TIMESTAMP_LEN 14 +#define PDU_CDMA_TIMESTAMP_LEN 12 #define PDU_TIMESTAMP_SIZE (PDU_TIMESTAMP_LEN + 1) #define GMT_OFFSET_LEN 2 #define GMT_OFFSET_IDX (PDU_TIMESTAMP_LEN - GMT_OFFSET_LEN) @@ -45,10 +46,9 @@ enum { }; enum { - PDU_ALPHABET_DEFAULT = 0, - PDU_ALPHABET_EIGHT = 1, - PDU_ALPHABET_UCS2 = 2, - PDU_ALPHABET_RESERVED = 3, + PDU_ALPHABET_DEFAULT = 0, //7-bit + PDU_ALPHABET_CDMA_DEFAULT = 2, //7-bit + PDU_ALPHABET_EIGHT = 4, }; struct pdu_info { @@ -71,8 +71,8 @@ struct pdu_info { union { uint8_t data_coding; struct { - uint8_t msg_class: 2; - uint8_t alphabet: 2; + // uint8_t msg_class: 2; + uint8_t alphabet: 4; uint8_t have_msg_class: 1; uint8_t compressed: 1; uint8_t unused: 2; @@ -113,6 +113,10 @@ int pdu_user_data_read(int fd, struct pdu_info *pdu); #define octet_align(n) ((((n) * 7) + ((-(n) * 7) & 7)) / 8) +#define septet_idx(n) ((n) * 8 / 7) +#define octet_align_cdma(n) septet_idx(n) + + #define STRLEN_CHECK(str, len, ret) \ do { \ if (strnlen(str, len) < len) { \ |