summaryrefslogtreecommitdiff
path: root/src/pdu.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pdu.h')
-rw-r--r--src/pdu.h16
1 files changed, 10 insertions, 6 deletions
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) { \