PDU长短信配置设定
Change-Id: Ibca330cc1e871aeff682b5f1eb68841b734900e7
diff --git a/mbtk/libmbtk_lib/ril/mbtk_pdu_sms.c b/mbtk/libmbtk_lib/ril/mbtk_pdu_sms.c
index b2a05b0..d2be3c7 100755
--- a/mbtk/libmbtk_lib/ril/mbtk_pdu_sms.c
+++ b/mbtk/libmbtk_lib/ril/mbtk_pdu_sms.c
@@ -7,6 +7,7 @@
#include <stdio.h>
#include "mbtk_pdu_sms.h"
#include "mbtk_alphabet.h"
+#include "mbtk_log.h"
#define SUB_STR_SIZE 512
char temp[SUB_STR_SIZE];
@@ -608,7 +609,8 @@
}
int getUDHL(struct UDHS *udhs) {
- if (udhs == NULL)
+ //在编码处添加用户数据头长度
+ //if (udhs == NULL)
return 0;
// 加上1字节的用户数据头长度
@@ -935,12 +937,14 @@
if (udhs == NULL || udhs->count == 0)
return "";
-
+#if 1
+ *UDHL = 5;
+#else
*UDHL = 0;
for (i = 0; i < udhs->count; i++) {
*UDHL += udhs->UDH[i].count + 2;
}
-
+#endif
char *result;
char *buf;
result = (char *) malloc(sizeof(char) * ((*UDHL + 1) * 2 + 1));
@@ -950,12 +954,15 @@
buf += 2;
for (i = 0; i < udhs->count; i++) {
- // 信息元素标识1字节
- sprintf(buf, "%02X", udhs->UDH[i].IEI);
- buf += 2;
- // 信息元素长度1字节
- sprintf(buf, "%02X", udhs->UDH[i].count);
- buf += 2;
+ if (i == 0)
+ {
+ // 信息元素标识1字节
+ sprintf(buf, "%02X", udhs->UDH[i].IEI);
+ buf += 2;
+ // 信息元素长度1字节
+ sprintf(buf, "%02X", udhs->UDH[i].count);
+ buf += 2;
+ }
// 信息元素数据
int j = 0;
for (j = 0; j < udhs->UDH[i].count; j++) {