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 2018/09/05 13:25:52 UTC

[GitHub] rymanluk commented on a change in pull request #182: DTM; for TX create a chained list of mbufs.

rymanluk commented on a change in pull request #182: DTM; for TX create a chained list of mbufs.
URL: https://github.com/apache/mynewt-nimble/pull/182#discussion_r215267305
 
 

 ##########
 File path: nimble/controller/src/ble_ll_dtm.c
 ##########
 @@ -238,21 +238,30 @@ ble_ll_dtm_tx_create_ctx(uint8_t packet_payload, uint8_t len,
 {
     int rc = 0;
     uint8_t byte_pattern;
+    struct ble_mbuf_hdr *ble_hdr;
+    struct os_mbuf *m;
     struct ble_ll_sched_item *sch = &g_ble_ll_dtm_ctx.sch;
 
     /* MSYS is big enough to get continues memory */
-    g_ble_ll_dtm_ctx.om = os_msys_get_pkthdr(len, sizeof(struct ble_mbuf_hdr));
+    m = os_msys_get_pkthdr(len, sizeof(struct ble_mbuf_hdr));
+    g_ble_ll_dtm_ctx.om = m;
     BLE_LL_ASSERT(g_ble_ll_dtm_ctx.om);
 
     g_ble_ll_dtm_ctx.phy_mode = phy_mode;
     g_ble_ll_dtm_ctx.rf_channel = rf_channel;
 
     /* Set BLE transmit header */
-    ble_ll_mbuf_init(g_ble_ll_dtm_ctx.om, len, packet_payload);
+    ble_hdr = BLE_MBUF_HDR_PTR(m);
+    ble_hdr->txinfo.flags = 0;
+    ble_hdr->txinfo.offset = 0;
+    ble_hdr->txinfo.pyld_len = len;
+    ble_hdr->txinfo.hdr_byte = packet_payload;
 
     switch(packet_payload) {
     case 0x00:
-        memcpy(g_ble_ll_dtm_ctx.om->om_data, &g_ble_ll_dtm_prbs9_data, len);
+        if (os_mbuf_copyinto(m, 0, &g_ble_ll_dtm_prbs9_data, len)) {
 
 Review comment:
   Actually we don't need in this patch nothing more than changing memcpy to os_mbuf_copyinto in this and below.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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