|
1 | 1 | #include <BLEMIDI_Transport.h>
|
2 | 2 |
|
| 3 | +static uint32_t customPasskeyRequest() |
| 4 | +{ |
| 5 | + // FILL WITH YOUR CUSTOM AUTH METHOD CODE or PASSKEY |
| 6 | + // FOR EXAMPLE: |
| 7 | + uint32_t passkey = 123456; |
| 8 | + |
| 9 | + // Serial.println("Client Passkey Request"); |
| 10 | + |
| 11 | + /** return the passkey to send to the server */ |
| 12 | + return passkey; |
| 13 | +}; |
| 14 | + |
3 | 15 | struct CustomBufferSizeSettings : public BLEMIDI_NAMESPACE::DefaultSettings {
|
| 16 | + //See all options and them explanation in the library. |
| 17 | + |
| 18 | + /* |
| 19 | + ##### BLE DEVICE NAME ##### |
| 20 | + */ |
| 21 | + //static constexpr char *name = "BleMidiClient"; |
| 22 | + /* |
| 23 | + ###### TX POWER ##### |
| 24 | + */ |
| 25 | + //static const esp_power_level_t clientTXPwr = ESP_PWR_LVL_P9; |
| 26 | + /* |
| 27 | + ###### SECURITY ##### |
| 28 | + */ |
| 29 | + //static const uint8_t clientSecurityCapabilities = BLE_HS_IO_NO_INPUT_OUTPUT; |
| 30 | + //static const bool clientBond = true; |
| 31 | + //static const bool clientMITM = false; |
| 32 | + //static const bool clientPair = true; |
| 33 | + //static constexpr PasskeyRequestCallback userOnPassKeyRequest = customPasskeyRequest; |
| 34 | + /* |
| 35 | + ###### BLE COMMUNICATION PARAMS ###### |
| 36 | + */ |
| 37 | + //static const uint16_t commMinInterval = 6; // 7.5ms |
| 38 | + //static const uint16_t commMaxInterval = 35; // 40ms |
| 39 | + //static const uint16_t commLatency = 0; // |
| 40 | + //static const uint16_t commTimeOut = 200; // 2000ms |
| 41 | + /* |
| 42 | + ###### BLE FORCE NEW CONNECTION ###### |
| 43 | + */ |
| 44 | + //static const bool forceNewConnection = false; |
| 45 | + /* |
| 46 | + ###### BLE SUBSCRIPTION: NOTIFICATION & RESPONSE ###### |
| 47 | + */ |
| 48 | + //static const bool notification = true; |
| 49 | + //static const bool response = true; |
| 50 | + /* |
| 51 | + ###### AND THE OTHER SETTINGS OF MIDI LIBRARY ###### |
4 | 52 | static const size_t MaxBufferSize = 16;
|
| 53 | + |
5 | 54 | };
|
6 | 55 |
|
7 | 56 | #include <hardware/BLEMIDI_ESP32_NimBLE.h>
|
|
0 commit comments