Created
November 29, 2019 09:35
-
-
Save mgulsoy/0cca9cb921deb4538d482b9d2ad18a27 to your computer and use it in GitHub Desktop.
Gatt Server Callback Tanımı
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaglantiCallback : public BLEServerCallbacks | |
{ | |
void onConnect(BLEServer* pServer, esp_ble_gatts_cb_param_t *param) { | |
Serial.print("Baglandi. ID: "); | |
Serial.print(param->connect.conn_id, DEC); | |
Serial.print(" client addr: "); | |
Serial.printf(ESP_BD_ADDR_STR | |
, (uint8_t)param->connect.remote_bda[0] | |
, (uint8_t)param->connect.remote_bda[1] | |
, (uint8_t)param->connect.remote_bda[2] | |
, (uint8_t)param->connect.remote_bda[3] | |
, (uint8_t)param->connect.remote_bda[4] | |
, (uint8_t)param->connect.remote_bda[5] ); | |
Serial.println(); | |
pServer->updateConnParams( //Bağlantı parametrelerini ayarlıyoruz. BKZ: "Dikkat Edilmesi Gereken Noktalar" | |
param->connect.remote_bda, | |
10, 20, 0, 500 | |
); | |
} | |
void onDisconnect(BLEServer *pServer) | |
{ | |
deviceConnected = false; | |
Serial.println("Disconnected."); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment