oic; ble - count incoming/outgoing frames separate from fragments.

Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/4aad7931
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/4aad7931
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/4aad7931

Branch: refs/heads/develop
Commit: 4aad793167d60202d26440f78b308344fbc797c4
Parents: bc7a4f5
Author: Marko Kiiskila <[email protected]>
Authored: Thu Jan 12 08:14:57 2017 -0800
Committer: Marko Kiiskila <[email protected]>
Committed: Thu Jan 12 08:14:57 2017 -0800

----------------------------------------------------------------------
 net/oic/src/port/mynewt/ble_adaptor.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/4aad7931/net/oic/src/port/mynewt/ble_adaptor.c
----------------------------------------------------------------------
diff --git a/net/oic/src/port/mynewt/ble_adaptor.c 
b/net/oic/src/port/mynewt/ble_adaptor.c
index cf7075e..b3ff59e 100644
--- a/net/oic/src/port/mynewt/ble_adaptor.c
+++ b/net/oic/src/port/mynewt/ble_adaptor.c
@@ -58,18 +58,22 @@ static const uint8_t oc_gatt_rsp_chr_uuid[16] = {
 };
 
 STATS_SECT_START(oc_ble_stats)
+    STATS_SECT_ENTRY(iframe)
     STATS_SECT_ENTRY(iseg)
     STATS_SECT_ENTRY(ibytes)
     STATS_SECT_ENTRY(ierr)
+    STATS_SECT_ENTRY(oframe)
     STATS_SECT_ENTRY(oseg)
     STATS_SECT_ENTRY(obytes)
     STATS_SECT_ENTRY(oerr)
 STATS_SECT_END
 static STATS_SECT_DECL(oc_ble_stats) oc_ble_stats;
 STATS_NAME_START(oc_ble_stats)
+    STATS_NAME(oc_ble_stats, iframe)
     STATS_NAME(oc_ble_stats, iseg)
     STATS_NAME(oc_ble_stats, ibytes)
     STATS_NAME(oc_ble_stats, ierr)
+    STATS_NAME(oc_ble_stats, oframe)
     STATS_NAME(oc_ble_stats, oseg)
     STATS_NAME(oc_ble_stats, obytes)
     STATS_NAME(oc_ble_stats, oerr)
@@ -143,6 +147,7 @@ oc_ble_reass(struct os_mbuf *om1, uint16_t conn_handle)
 
             if (coap_tcp_msg_size(hdr, sizeof(hdr)) <= pkt2->omp_len) {
                 STAILQ_REMOVE(&oc_ble_reass_q, pkt2, os_mbuf_pkthdr, omp_next);
+                STATS_INC(oc_ble_stats, iframe);
                 oc_recv_message(om2);
             }
             pkt1 = NULL;
@@ -176,6 +181,7 @@ oc_ble_reass(struct os_mbuf *om1, uint16_t conn_handle)
           coap_tcp_msg_size(hdr, sizeof(hdr)) > pkt2->omp_len) {
             STAILQ_INSERT_TAIL(&oc_ble_reass_q, pkt2, omp_next);
         } else {
+            STATS_INC(oc_ble_stats, iframe);
             oc_recv_message(om2);
         }
     }
@@ -332,7 +338,7 @@ oc_send_buffer_gatt(struct os_mbuf *m)
 
 #if (MYNEWT_VAL(OC_SERVER) == 1)
 
-    STATS_INC(oc_ble_stats, oseg);
+    STATS_INC(oc_ble_stats, oframe);
     STATS_INCN(oc_ble_stats, obytes, OS_MBUF_PKTLEN(m));
 
     mtu = ble_att_mtu(conn_handle);
@@ -348,6 +354,7 @@ oc_send_buffer_gatt(struct os_mbuf *m)
         return;
     }
     while (1) {
+        STATS_INC(oc_ble_stats, oseg);
         pkt = STAILQ_NEXT(OS_MBUF_PKTHDR(m), omp_next);
 
         ble_gattc_notify_custom(conn_handle, oc_ble_coap_rsp_handle, m);

Reply via email to