Minor Syntax correction

Tabulation indentation fixed after last commit changes and other minor changes in comments
This commit is contained in:
RobertoHE 2022-06-21 19:19:32 +02:00 committed by GitHub
parent 24dce9ac6a
commit fe3412b289
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 53 additions and 47 deletions

View File

@ -33,15 +33,18 @@ struct DefaultSettingsClient : public BLEMIDI_NAMESPACE::DefaultSettings
/*
##### BLE DEVICE NAME #####
*/
/**
* Set name of ble device (not affect to connection with server)
* max 16 characters
*/
static constexpr char *name = "BleMidiClient";
/*
###### TX POWER #####
*/
/**
* Set power transmision
*
@ -56,9 +59,11 @@ struct DefaultSettingsClient : public BLEMIDI_NAMESPACE::DefaultSettings
*/
static const esp_power_level_t clientTXPwr = ESP_PWR_LVL_P9;
/*
###### SECURITY #####
*/
/** Set the IO capabilities of the device, each option will trigger a different pairing method.
* BLE_HS_IO_KEYBOARD_ONLY - Passkey pairing
* BLE_HS_IO_DISPLAY_YESNO - Numeric comparison pairing
@ -83,9 +88,11 @@ struct DefaultSettingsClient : public BLEMIDI_NAMESPACE::DefaultSettings
*/
static constexpr PasskeyRequestCallback userOnPassKeyRequest = defautlPasskeyRequest;
/*
###### BLE COMMUNICATION PARAMS ######
*/
/** Set connection parameters:
* If you only use one connection, put recomended BLE server param communication
* (you may scan it ussing "nRF Connect" app or other similar apps).
@ -104,6 +111,7 @@ struct DefaultSettingsClient : public BLEMIDI_NAMESPACE::DefaultSettings
static const uint16_t commLatency = 0; //
static const uint16_t commTimeOut = 200; // 2000ms
/*
###### BLE FORCE NEW CONNECTION ######
*/
@ -118,7 +126,6 @@ struct DefaultSettingsClient : public BLEMIDI_NAMESPACE::DefaultSettings
static const bool forceNewConnection = false;
};
/** Define a class to handle the callbacks when advertisments are received */
class AdvertisedDeviceCallbacks : public NimBLEAdvertisedDeviceCallbacks
{
@ -346,24 +353,23 @@ bool BLEMIDI_Client_ESP32<_Settings>::begin(const char *deviceName, BLEMIDI_Tran
_bleMidiTransport = bleMidiTransport;
std::string strDeviceName(deviceName);
if (strDeviceName == "") // Connect to the first midi server found
// Connect to the first midi server found
if (strDeviceName == "")
{
myAdvCB.specificTarget = false;
myAdvCB.nameTarget = "";
}
else // Connect to a specific name or address
// Connect to a specific name or address
else
{
myAdvCB.specificTarget = true;
myAdvCB.nameTarget = strDeviceName;
}
static char array[16] = "patata";
static char array[16];
memcpy(array, _Settings::name, 16);
strDeviceName = array;
DEBUGCLIENT(strDeviceName.c_str());
NimBLEDevice::init(strDeviceName);
// To communicate between the 2 cores.
@ -390,7 +396,8 @@ bool BLEMIDI_Client_ESP32<_Settings>::available(byte *pvBuffer)
return false;
}
if (_client == nullptr || !_client->isConnected()) // Try to connect/reconnect
// Try to connect/reconnect
if (_client == nullptr || !_client->isConnected())
{
if (myAdvCB.doConnect)
{
@ -481,7 +488,6 @@ if (!_Settings::forceNewConnection)
}
}
if (NimBLEDevice::getClientListSize() >= NIMBLE_MAX_CONNECTIONS)
{
DEBUGCLIENT("Max clients reached - no more connections available");