From be01eb8a87f1582b1c15ec4e09a9a66770da87c5 Mon Sep 17 00:00:00 2001 From: Brandon Bayer Date: Mon, 26 Oct 2015 14:58:43 -0500 Subject: feat: sms support for CE910-DUAL, DE910-DUAL, LE910-SVG - PDU is used for everything except LE910-SVG sending - a bug in radio requires radio reboot to send more than 1 PDU sms --- src/pdu.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/pdu.h') diff --git a/src/pdu.h b/src/pdu.h index 468687d..5f47e5e 100644 --- a/src/pdu.h +++ b/src/pdu.h @@ -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) { \ -- cgit v1.2.3