You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/04/04 17:16:12 UTC

[GitHub] [mynewt-nimble] ccollins476ad commented on a change in pull request #380: nimble/host: Improve usage of MSYS by ATT

ccollins476ad commented on a change in pull request #380: nimble/host: Improve usage of MSYS by ATT
URL: https://github.com/apache/mynewt-nimble/pull/380#discussion_r272281533
 
 

 ##########
 File path: nimble/host/src/ble_hs_mbuf.c
 ##########
 @@ -84,15 +85,33 @@ ble_hs_mbuf_l2cap_pkt(void)
     return ble_hs_mbuf_gen_pkt(BLE_HCI_DATA_HDR_SZ + BLE_L2CAP_HDR_SZ);
 }
 
+struct os_mbuf *
+ble_hs_mbuf_hdr_pkt(void)
+{
+    struct os_mbuf *om;
+    uint16_t leading_space = BLE_HS_ATT_PKT_HDR_LEADINGSPACE;
+
+
+    /* This is just for header which is going to be added later on, that is
+    * why size is equal to leading_space
+    */
+    om = os_msys_get_pkthdr(leading_space, leading_space);
 
 Review comment:
   I must be missing something, because I still don't understand why we want a user-header length equal to `leading_space`.  Why not specify 0 here, and then perform `om->om_data += leading_space`?
   
   Specifying `leading_space` as the user-header length causes `om->om_pkthdr_len` to be equal to `sizeof (struct os_mbuf_pkthdr) + `leading_space`.  Does the code ever decrease `om_pkthdr_len`?  If not, I think this space can never be used.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services