Skip to content

Commit b3df11a

Browse files
RobertoRoberto
authored andcommitted
Update Communication Parameters
1 parent 6ea32b3 commit b3df11a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/hardware/BLEMIDI_Client_ESP32.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ static uint32_t userOnPassKeyRequest()
112112
* 0 latency (Number of intervals allowed to skip),
113113
* TimeOut (unit: 10ms) 51 * 10ms = 510ms. Timeout should be minimum 100ms.
114114
*/
115-
#define BLEMIDI_CLIENT_COMM_MIN_INTERVAL 6 // 7.5ms
116-
#define BLEMIDI_CLIENT_COMM_MAX_INTERVAL 35 // 40ms
117-
#define BLEMIDI_CLIENT_COMM_LATENCY 0 //
118-
#define BLEMIDI_CLIENT_COMM_TIMEOUT 200 //2000ms
115+
#define BLEMIDI_CLIENT_COMM_MIN_INTERVAL 6 // 7.5ms
116+
#define BLEMIDI_CLIENT_COMM_MAX_INTERVAL 35 // 40ms
117+
#define BLEMIDI_CLIENT_COMM_LATENCY 0 //
118+
#define BLEMIDI_CLIENT_COMM_TIMEOUT 200 //2000ms
119119

120120
/*
121121
#############################################
@@ -322,7 +322,7 @@ class MyClientCallbacks : public BLEClientCallbacks
322322
void onConnect(BLEClient *pClient)
323323
{
324324
//Serial.println("##Connected##");
325-
pClient->updateConnParams(BLEMIDI_CLIENT_COMM_MIN_INTERVAL, BLEMIDI_CLIENT_COMM_MAX_INTERVAL, BLEMIDI_CLIENT_COMM_LATENCY, BLEMIDI_CLIENT_COMM_TIMEOUT);
325+
//pClient->updateConnParams(BLEMIDI_CLIENT_COMM_MIN_INTERVAL, BLEMIDI_CLIENT_COMM_MAX_INTERVAL, BLEMIDI_CLIENT_COMM_LATENCY, BLEMIDI_CLIENT_COMM_TIMEOUT);
326326
vTaskDelay(1);
327327
if (_bluetoothEsp32)
328328
{
@@ -358,10 +358,11 @@ class MyClientCallbacks : public BLEClientCallbacks
358358
{ /** Number of intervals allowed to skip */
359359
return false;
360360
}
361-
else if (params->supervision_timeout > BLEMIDI_CLIENT_COMM_TIMEOUT + 10)
361+
else if (params->supervision_timeout > BLEMIDI_CLIENT_COMM_TIMEOUT)
362362
{ /** 10ms units */
363363
return false;
364364
}
365+
pClient->updateConnParams(params->itvl_min, params->itvl_max, params->latency, params->supervision_timeout);
365366

366367
return true;
367368
};

0 commit comments

Comments
 (0)