Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nimble ble spp client not subscribing to server (IDFGH-14753) #15492

Open
3 tasks done
tommasoclini opened this issue Feb 27, 2025 · 5 comments
Open
3 tasks done

nimble ble spp client not subscribing to server (IDFGH-14753) #15492

tommasoclini opened this issue Feb 27, 2025 · 5 comments
Assignees
Labels
Status: In Progress Work is in progress

Comments

@tommasoclini
Copy link

tommasoclini commented Feb 27, 2025

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

I have been sent a fix for this via email, but I see that it has not been fixed here, in examples/bluetooth/nimble/ble_spp/spp_client/main/main.c:

static void
ble_spp_client_set_handle(const struct peer *peer)
{
    const struct peer_chr *chr;
    chr = peer_chr_find_uuid(peer,
                             BLE_UUID16_DECLARE(GATT_SPP_SVC_UUID),
                             BLE_UUID16_DECLARE(GATT_SPP_CHR_UUID));
    attribute_handle[peer->conn_handle] = chr->chr.val_handle;
    // subscribe event; conn_handle=1 attr_handle=12 reason=1 prevn=0 curn=1 previ=0 curi=
    printf("attribute_handle %x\n", attribute_handle[peer->conn_handle]);
    const struct peer_dsc *dsc;
    dsc = peer_dsc_find_uuid(peer,
                             BLE_UUID16_DECLARE(GATT_SPP_SVC_UUID),
                             BLE_UUID16_DECLARE(GATT_SPP_CHR_UUID),
                             BLE_UUID16_DECLARE(BLE_GATT_DSC_CLT_CFG_UUID16));
    if (dsc == NULL) {
        MODLOG_DFLT(ERROR, "Error: Peer lacks a CCCD for the subscribable characterstic\n");
    }
    uint8_t value[2];
    value[0] = 1;
    value[1] = 0;
    ble_gattc_write_flat(peer->conn_handle, dsc->dsc.handle,
                            value, sizeof(value), NULL, NULL);
}
@github-actions github-actions bot changed the title nimble ble spp client not subscribing to server nimble ble spp client not subscribing to server (IDFGH-14753) Feb 27, 2025
@espressif-bot espressif-bot added the Status: Opened Issue is new label Feb 27, 2025
@rahult-github
Copy link
Collaborator

Hi @tommasoclini , this is application level change. The SPP client / server demo example just shows how SPP as a BLE service can be implemented in IDF. For all other application changes, you are free to make them at your end as per your use case.

For information, we maintaing Bleprph/ blecent as a detailed example present in IDF which showcases majorly all features.

@tommasoclini
Copy link
Author

Hi @tommasoclini , this is application level change. The SPP client / server demo example just shows how SPP as a BLE service can be implemented in IDF. For all other application changes, you are free to make them at your end as per your use case.

For information, we maintaing Bleprph/ blecent as a detailed example present in IDF which showcases majorly all features.

Ok but I think it would be nice to have the client subscribe to the server as the default, because not everyone knows how to do that, and it's probably expected to happen in the example.

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Mar 3, 2025
@tommasoclini
Copy link
Author

Why do you not want to add this to the client code? It is literally wrong as of now.

@Shreeyash-17
Copy link
Collaborator

Agreed, we are adding it up internally, and should soon show up.

@tommasoclini
Copy link
Author

tommasoclini commented Mar 4, 2025

Agreed, we are adding it up internally, and should soon show up.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: In Progress Work is in progress
Projects
None yet
Development

No branches or pull requests

4 participants