hcidump: fix crash for LE meta event 52/136652/2
authorChan-yeol Park <chanyeol.park@samsung.com>
Thu, 12 Mar 2015 07:39:52 +0000 (16:39 +0900)
committerSeungyoun Ju <sy39.ju@samsung.com>
Tue, 4 Jul 2017 12:11:41 +0000 (21:11 +0900)
[Problem] hcidump crash happens
[Cause & Measure] There is undefined BLE meta event. It causes crash issue.
 This patch adds BLE meta events.
[Checking Method] hcidump -r log.cfa

Change-Id: I2a25bfb2550a946ad0e67e7fd1dad06426c9abe5

tools/parser/hci.c

index 8c7bd25..fc4099c 100644 (file)
@@ -127,7 +127,11 @@ static char *event_str[EVENT_NUM + 1] = {
        "AMP Status Change",
 };
 
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+#define LE_EV_NUM 11
+#else
 #define LE_EV_NUM 5
+#endif
 static char *ev_le_meta_str[LE_EV_NUM + 1] = {
        "Unknown",
        "LE Connection Complete",
@@ -135,6 +139,14 @@ static char *ev_le_meta_str[LE_EV_NUM + 1] = {
        "LE Connection Update Complete",
        "LE Read Remote Used Features Complete",
        "LE Long Term Key Request",
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+       "LE Remote Connection Parameter Request",
+       "LE Data Length Change",
+       "LE Read Local P-256 Public Key Complete",
+       "LE Generate DHKey Complete",
+       "LE Enhanced Connection Complete",
+       "LE Direct Advertising Report",
+#endif
 };
 
 #define CMD_LINKCTL_NUM 60
@@ -3667,7 +3679,14 @@ static inline void le_meta_ev_dump(int level, struct frame *frm)
        frm->len -= EVT_LE_META_EVENT_SIZE;
 
        p_indent(level, frm);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+       if (subevent <= LE_EV_NUM)
+               printf("%s\n", ev_le_meta_str[subevent]);
+       else
+               printf("%s\n", ev_le_meta_str[0]);
+#else
        printf("%s\n", ev_le_meta_str[subevent]);
+#endif
 
        switch (mevt->subevent) {
        case EVT_LE_CONN_COMPLETE: