Hi,

I am trying to create a modify the BLE GATT service TXPWR to allow me to
set the power as well as read.  Not to spec, but bear with me here.

*1)  This works: *

 },

    [3] = {
        /*** Service: TXPWR */
        .type = BLE_GATT_SVC_TYPE_PRIMARY,
        .uuid128 = BLE_UUID16(GATT_SVR_SVC_TXPWR_UUID),
        .characteristics = (struct ble_gatt_chr_def[]) { {
            .uuid128 = BLE_UUID16(GATT_SVR_CHR_TXPWR_TXPWRLVL),
            .access_cb = gatt_svr_chr_txpwrlvl_cb,
            .flags = BLE_GATT_CHR_F_READ,
        }, {
            0, /* No more characteristics in this service. */
        } },
    },

  {
        0, /* No more services. */
    },
};



*2)  Adding an additional characteristic to this service definition
compiles, but seems to be stuck trying to register services on an internal
loop.  *

#define GATT_SVR_CHR_TXPWR_TXPWRLVL_SET 0x2A08
....

  },

    [3] = {
        /*** Service: TXPWR */
        .type = BLE_GATT_SVC_TYPE_PRIMARY,
        .uuid128 = BLE_UUID16(GATT_SVR_SVC_TXPWR_UUID),
        .characteristics = (struct ble_gatt_chr_def[]) { {
            .uuid128 = BLE_UUID16(GATT_SVR_CHR_TXPWR_TXPWRLVL),
            .access_cb = gatt_svr_chr_txpwrlvl_cb,
            .flags = BLE_GATT_CHR_F_READ,
        }, {
        .characteristics = (struct ble_gatt_chr_def[]) { {
            .uuid128 = BLE_UUID16(GATT_SVR_CHR_TXPWR_TXPWRLVL_SET),
            .access_cb = gatt_svr_chr_txpwrlvl_cb,
            .flags = BLE_GATT_CHR_F_READ,
        }, {
            0, /* No more characteristics in this service. */
        } },
    },

  {
        0, /* No more services. */
    },
};

*Here's the output out of the serial port:*

registered service 0x1800 with handle=1
4:[ts=4000ssb, mod=64 level=1] registering characteristic 0x2a00 with
def_handle=2 val_handle=3
12:[ts=12000ssb, mod=64 level=1] registering characteristic 0x2a01 with
def_handle=4 val_handle=5
22:[ts=22000ssb, mod=64 level=1] registering characteristic 0x2a02 with
def_handle=6 val_handle=7
30:[ts=30000ssb, mod=64 level=1] registering characteristic 0x2a03 with
def_handle=8 val_handle=9
39:[ts=39000ssb, mod=64 level=1] registering characteristic 0x2a04 with
def_handle=10 val_handle=11
48:[ts=48000ssb, mod=64 level=1] registered service 0x1801 with handle=12
54:[ts=54000ssb, mod=64 level=1] registering characteristic 0x2a05 with
def_handle=13 val_handle=14
64:[ts=64000ssb, mod=64 level=1] registered service 0x1811 with handle=16
70:[ts=70000ssb, mod=64 level=1] registering characteristic 0x2a47 with
def_handle=17 val_handle=18
79:[ts=79000ssb, mod=64 level=1] registering characteristic 0x2a46 with
def_handle=19 val_handle=20
89:[ts=89000ssb, mod=64 level=1] registering characteristic 0x2a48 with
def_handle=22 val_handle=23
97:[ts=97000ssb, mod=64 level=1] registering characteristic 0x2a45 with
def_handle=24 val_handle=25
107:[ts=107000ssb, mod=64 level=1] registering characteristic 0x2a44 with
def_handle=27 val_handle=28
116:[ts=116000ssb, mod=64 level=1] registered service 0x1804 with handle=29
122:[ts=122000ssb, mod=64 level=1] registering characteristic 0x2a07 with
....................................................................0:[ts=0ssb,
mod=64 level=1] registered service 0x1800 with handle=1
4:[ts=4000ssb, mod=64 level=1] registering characteristic 0x2a00 with
def_handle=2 val_handle=3
12:[ts=12000ssb, mod=64 level=1] registering characteristic 0x2a01 with
def_handle=4 val_handle=5
22:[ts=22000ssb, mod=64 level=1] registering characteristic 0x2a02 with
def_handle=6 val_handle=7
30:[ts=30000ssb, mod=64 level=1] registering characteristic 0x2a03 with
def_handle=8 val_handle=9
39:[ts=39000ssb, mod=64 level=1] registering characteristic 0x2a04 with
def_handle=10 val_handle=11
48:[ts=48000ssb, mod=64 level=1] registered service 0x1801 with handle=12
54:[ts=54000ssb, mod=64 level=1] registering characteristic 0x2a05 with
def_handle=13 val_handle=14
64:[ts=64000ssb, mod=64 level=1] registered service 0x1811 with handle=16
70:[ts=70000ssb, mod=64 level=1] registering characteristic 0x2a47 with
def_handle=17 val_handle=18
79:[ts=79000ssb, mod=64 level=1] registering characteristic 0x2a46 with
def_handle=19 val_handle=20
89:[ts=89000ssb, mod=64 level=1] registering characteristic 0x2a48 with
def_handle=22 val_handle=23
97:[ts=97000ssb, mod=64 level=1] registering characteristic 0x2a45 with
def_handle=24 val_handle=25
107:[ts=107000ssb, mod=64 level=1] registering characteristic 0x2a44 with
def_handle=27 val_handle=28
116:[ts=116000ssb, mod=64 level=1] registered service 0x1804 with handle=29
122:[ts=122000ssb, mod=64 level=1] registering characteristic 0x2a07 with
....................................................................0:[ts=0ssb,
mod=64 level=1] registered service 0x1800 with handle=1


Any ideas appreciated.

Cheers
James

Reply via email to