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 2022/09/19 18:50:59 UTC

[GitHub] [mynewt-nimble] danimasa opened a new issue, #1363: Dynamic characteristics

danimasa opened a new issue, #1363:
URL: https://github.com/apache/mynewt-nimble/issues/1363

   How can I create `ble_gatt_chr_def` dynamically at runtime?
   
   All the examples show a static array of `ble_gatt_svc_def` already with the characteristics. In my case I'll only kwown the caractheristics information at runtime. I've tried to change the characteristics pointer to a different array after creating a static global variable but the characteristics was not listed in BLE Service.
   
   I'm doing like that:
   ```c
   static struct ble_gatt_svc_def gatt_svr_svcs[] = {...};
   
   void start()
   {
       struct ble_gatt_chr_def chrs[chr_count];
       for(int i = 0; i < chr_count; i++)
       {
           struct ble_gatt_chr_def chr = {...};
           chrs[i] = chr;
       }
       gatt_svr_svcs[0].characteristics = chrs;
   
       ble_gatts_count_cfg(gatt_svr_svcs);
       ble_gatts_add_svcs(gatt_svr_svcs);
   }
   ```


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [mynewt-nimble] danimasa commented on issue #1363: Dynamic characteristics

Posted by GitBox <gi...@apache.org>.
danimasa commented on issue #1363:
URL: https://github.com/apache/mynewt-nimble/issues/1363#issuecomment-1262146073

   I used micropython as a reference to generate de services at runtime.
   Here is the link to the project: https://github.com/micropython/micropython/blob/master/extmod/nimble/modbluetooth_nimble.c


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [mynewt-nimble] danimasa closed issue #1363: Dynamic characteristics

Posted by GitBox <gi...@apache.org>.
danimasa closed issue #1363: Dynamic characteristics
URL: https://github.com/apache/mynewt-nimble/issues/1363


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org