Skip to content

BLEServer.h callback onDisconnect() missing esp_ble_gatts_cb_param_t parameter  #6008

Closed
@pabloandresm

Description

@pabloandresm

The BLEServer.h defines callbacks for connection and disconnection.

For the connect, there are 2 virtual methods, 1 without and 1 with esp_ble_gatts_cb_param_t.

For the disconnect, there is only 1 virtual method, without that parameter.

At least for coherency, there should be an onDisconnect() with that parameter. This parameter it is even in the comments!!! and it is missing in the code.

That parameter is useful for example to know the client that disconnects.

This fix wouldn't even impact the code already written, as it is an extra virtual method.

Look at the comment of the missing parameter esp_ble_gatts_cb_param_t:

class BLEServerCallbacks {
public:
virtual ~BLEServerCallbacks() {};
/**
* @brief Handle a new client connection.
*
* When a new client connects, we are invoked.
*
* @param [in] pServer A reference to the %BLE server that received the client connection.
/
virtual void onConnect(BLEServer
pServer);
virtual void onConnect(BLEServer* pServer, esp_ble_gatts_cb_param_t param);
/
*
* @brief Handle an existing client disconnection.
*
* When an existing client disconnects, we are invoked.
*
* @param [in] pServer A reference to the %BLE server that received the existing client disconnection. <--- HERE!!!
/
virtual void onDisconnect(BLEServer
pServer);
}; // BLEServerCallbacks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: BT&WifiBT & Wifi related issuesStatus: Needs investigationWe need to do some research before taking next steps on this issue

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions