Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update initialization to work with latest Arduino Mbed board packages #6

Merged
merged 2 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ It was designed for the **Arduino nano 33 BLE** and tested with _GNU/Linux, Andr

## Environment

On the Arduino IDE you will need the **Arduino nRF528x boards (Mbed OS)** with version **1.1.6** (In the menu bar click on "_Tools > Boards > Boards manager.._").
On the Arduino IDE you will need the **Arduino mbed-enabled Boards** with version **1.3.1** or higher (In the menu bar click on "_Tools > Boards > Boards manager.._").

Alternatively you can use [platformio](https://github.com/platformio) [Deviot](https://github.com/platformio/Deviot).

Expand Down
12 changes: 2 additions & 10 deletions src/Mbed_BLE_HID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,15 @@ void MbedBleHID::postInitialization(BLE &ble)
Gap &gap = ble.gap();
gap.setEventHandler(this);

const Gap::ConnectionParams_t connectionParams = {
7, // min conn interval
15, // max conn interval
0, // slave latency
3200 // supervision timeout
};
gap.setPreferredConnectionParams(&connectionParams);

// GAP Advertising parameters.
{
using namespace ble;

gap.setAdvertisingPayload(
LEGACY_ADVERTISING_HANDLE,
AdvertisingDataSimpleBuilder<LEGACY_ADVERTISING_MAX_SIZE>()
.setFlags(GapAdvertisingData::BREDR_NOT_SUPPORTED
| GapAdvertisingData::LE_GENERAL_DISCOVERABLE
.setFlags(adv_data_flags_t::BREDR_NOT_SUPPORTED
| adv_data_flags_t::LE_GENERAL_DISCOVERABLE
)
.setName(kDeviceName_.c_str(), true)
.setAppearance(services_.hid->appearance())
Expand Down