You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@mynewt.apache.org by "Sterling Hughes (JIRA)" <ji...@apache.org> on 2016/06/09 20:47:20 UTC

[jira] [Commented] (MYNEWT-291) BLE Host - Split GATT attribute access function into more specific events

    [ https://issues.apache.org/jira/browse/MYNEWT-291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15323311#comment-15323311 ] 

Sterling Hughes commented on MYNEWT-291:
----------------------------------------

where are we on this? 

> BLE Host - Split GATT attribute access function into more specific events
> -------------------------------------------------------------------------
>
>                 Key: MYNEWT-291
>                 URL: https://issues.apache.org/jira/browse/MYNEWT-291
>             Project: Mynewt
>          Issue Type: Bug
>          Components: Nimble
>            Reporter: Christopher Collins
>            Assignee: Christopher Collins
>             Fix For: v0_9_0
>
>
> Nimble notifies the app that a characteristic or descriptor is being accessed via an access callback.  The access callback takes a context parameter which points to an instance of the following union:
> {noformat}
> union ble_gatt_access_ctxt {
>     struct {
>         const struct ble_gatt_chr_def *chr;
>         void *data;
>         int len;
>     } chr_access;
>     struct {
>         const struct ble_gatt_dsc_def *dsc;
>         void *data;
>         int len;
>     } dsc_access;
> };
> {noformat}
> This is problematic because the user may wish to point the _data_ fields to read-only data, requiring them to "cast away const."  This looks questionable in code, and is difficult to document in the user guide with a straight face.
> Instead, we should change the union to the following:
> {noformat}
> union ble_gatt_access_ctxt {
>     struct {
>         const struct ble_gatt_chr_def *chr;
>         const void *data;
>         int len;
>     } chr_read;
>     struct {
>         const struct ble_gatt_chr_def *chr;
>         void *data;
>         int len;
>     } chr_write;
>     struct {
>         const struct ble_gatt_dsc_def *dsc;
>         const void *data;
>         int len;
>     } dsc_read;
>     struct {
>         const struct ble_gatt_dsc_def *dsc;
>         void *data;
>         int len;
>     } dsc_write;
> };
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)