Skip to content

Instantly share code, notes, and snippets.

@TakehikoShimojima
Created July 12, 2018 05:52
Show Gist options
  • Select an option

  • Save TakehikoShimojima/1dd5096d2d219c1badb019f73e33cdda to your computer and use it in GitHub Desktop.

Select an option

Save TakehikoShimojima/1dd5096d2d219c1badb019f73e33cdda to your computer and use it in GitHub Desktop.
// 元のプログラム
void BLEServer::handleGATTServerEvent(
esp_gatts_cb_event_t event,
esp_gatt_if_t gatts_if,
esp_ble_gatts_cb_param_t* param) {
// 省略
case ESP_GATTS_CONNECT_EVT: {
m_connId = param->connect.conn_id; // Save the connection id.
if (m_pServerCallbacks != nullptr) {
m_pServerCallbacks->onConnect(this);
}
m_connectedCount++; // Increment the number of connected devices count.
break;
} // ESP_GATTS_CONNECT_EVT
// 修正版
void BLEServer::handleGATTServerEvent(
esp_gatts_cb_event_t event,
esp_gatt_if_t gatts_if,
esp_ble_gatts_cb_param_t* param) {
// 省略
case ESP_GATTS_CONNECT_EVT: {
m_connId = param->connect.conn_id; // Save the connection id.
if (m_pServerCallbacks != nullptr) {
m_pServerCallbacks->onConnect(this, param); // 引数を追加
}
m_connectedCount++; // Increment the number of connected devices count.
break;
} // ESP_GATTS_CONNECT_EVT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment