From 36361d5ed09ea65a14694a269e062a787dddf866 Mon Sep 17 00:00:00 2001 From: Kevin Townsend Date: Mon, 13 Feb 2017 02:25:48 +0100 Subject: [PATCH 1/3] Cleanup --- .../examples/hid_mouse/hid_mouse.ino | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/libraries/Bluefruit52Lib/examples/hid_mouse/hid_mouse.ino b/libraries/Bluefruit52Lib/examples/hid_mouse/hid_mouse.ino index 5254fce9..c873d257 100644 --- a/libraries/Bluefruit52Lib/examples/hid_mouse/hid_mouse.ino +++ b/libraries/Bluefruit52Lib/examples/hid_mouse/hid_mouse.ino @@ -24,13 +24,13 @@ void setup() Serial.begin(115200); Serial.println("Bluefruit52 HID Mouse Example"); - Serial.println("- Enter 'WASD' for move mouse (up, left, down, right)"); - Serial.println("- Enter 'LRMBF' for pressing mouse buttons (left, right, middle, backward, forward)"); - Serial.println("- Enter 'X' for releasing mouse buttons"); + Serial.println("- Enter 'WASD' to move mouse (up, left, down, right)"); + Serial.println("- Enter 'LRMBF' to press mouse button(s) (left, right, middle, backward, forward)"); + Serial.println("- Enter 'X' to release mouse button(s)"); Bluefruit.begin(); - // HID Device can have min connection interval up to 9*1.25 = 11.25 ms - Bluefruit.setConnInterval(9, 16); // min = 11.25 ms, max = 20ms + // HID Device can have a min connection interval of 9*1.25 = 11.25 ms + Bluefruit.setConnInterval(9, 16); // min = 9*1.25=11.25 ms, max = 16*1.25=20ms Bluefruit.setName("Bluefruit52"); // Configure and Start Device Information Service @@ -43,7 +43,7 @@ void setup() // Configure and Start BLE Uart Service bleuart.start(); - // BLE Hid + // BLE HID blehid.start(); // Set up Advertising Packet @@ -60,10 +60,10 @@ void setupAdv(void) Bluefruit.addAdvApperance(BLE_APPEARANCE_HID_MOUSE); - // Include ble hid service + // Include BLE HID service Bluefruit.addAdvService(blehid); - // There is enough room for Name in Advertising packet + // There is enough room for the name in the advertising packet Bluefruit.addAdvName(); } @@ -76,12 +76,12 @@ void loop() // convert to upper case ch = (char) toupper(ch); - // ehco + // echo Serial.println(ch); switch(ch) { - // WASD is mouse move + // WASD to move the mouse case 'W': blehid.mouseMove(0, -MOVE_STEP); break; @@ -98,7 +98,7 @@ void loop() blehid.mouseMove(MOVE_STEP, 0); break; - // LRM is mouse button + // LRMBF for mouse button(s) case 'L': blehid.mouseButtonPress(MOUSE_BUTTON_LEFT); break; @@ -116,7 +116,7 @@ void loop() break; case 'F': - // This key is not always supported by OS + // This key is not always supported by every OS blehid.mouseButtonPress(MOUSE_BUTTON_FORWARD); break; From e2a563312cfc43ecee7afa35a4c75faf71cbfc0a Mon Sep 17 00:00:00 2001 From: Kevin Townsend Date: Mon, 13 Feb 2017 02:27:51 +0100 Subject: [PATCH 2/3] Cleanup --- .../examples/hid_keyboard/hid_keyboard.ino | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libraries/Bluefruit52Lib/examples/hid_keyboard/hid_keyboard.ino b/libraries/Bluefruit52Lib/examples/hid_keyboard/hid_keyboard.ino index 2b64d949..672b10f8 100644 --- a/libraries/Bluefruit52Lib/examples/hid_keyboard/hid_keyboard.ino +++ b/libraries/Bluefruit52Lib/examples/hid_keyboard/hid_keyboard.ino @@ -26,8 +26,8 @@ void setup() Serial.println("Bluefruit52 HID Keyboard Example"); Bluefruit.begin(); - // HID Device can have min connection interval up to 9*1.25 = 11.25 ms - Bluefruit.setConnInterval(9, 16); // min = 11.25 ms, max = 20ms + // HID Device can have a min connection interval of 9*1.25 = 11.25 ms + Bluefruit.setConnInterval(9, 16); // min = 9*1.25=11.25 ms, max = 16*1.25=20ms Bluefruit.setName("Bluefruit52"); // Configure and Start Device Information Service @@ -40,10 +40,10 @@ void setup() // Configure and Start BLE Uart Service bleuart.start(); - // BLE Hid + // BLE HID blehid.start(); - // Set up Advertising Packet + // Setup Advertising Packet setupAdv(); // Start Advertising @@ -57,17 +57,17 @@ void setupAdv(void) Bluefruit.addAdvApperance(BLE_APPEARANCE_HID_KEYBOARD); - // Include ble hid service + // Include BLE HID service Bluefruit.addAdvService(blehid); - // There is enough room for Name in Advertising packet + // There is enough room for the dev name in the advertising packet Bluefruit.addAdvName(); } void loop() { - // Only send KeyRelease if previously pressed, to avoid sending - // multiple keyRelease report (that consume memories and bandwidth) + // Only send KeyRelease if previously pressed to avoid sending + // multiple keyRelease reports (that consume memory and bandwidth) if ( hasKeyPressed ) { hasKeyPressed = false; @@ -75,7 +75,7 @@ void loop() blehid.consumerKeyRelease(); - // delay a bit after a report + // Delay a bit after a report delay(5); } @@ -83,7 +83,7 @@ void loop() { char ch = (char) Serial.read(); - // ehco + // echo Serial.write(ch); blehid.keyPress(ch); @@ -91,7 +91,7 @@ void loop() blehid.consumerKeyPress(HID_USAGE_CONSUMER_MUTE); - // delay a bit after a report + // Delay a bit after a report delay(5); } } From c1475da668c3fc2c96d37345998b0f687be937ae Mon Sep 17 00:00:00 2001 From: Kevin Townsend Date: Mon, 13 Feb 2017 02:29:14 +0100 Subject: [PATCH 3/3] Cleanup --- libraries/Bluefruit52Lib/examples/controller/controller.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/Bluefruit52Lib/examples/controller/controller.ino b/libraries/Bluefruit52Lib/examples/controller/controller.ino index bcf88cbe..27cbef0a 100644 --- a/libraries/Bluefruit52Lib/examples/controller/controller.ino +++ b/libraries/Bluefruit52Lib/examples/controller/controller.ino @@ -16,7 +16,7 @@ BLEUart bleuart; -// function prototypes over in packetparser.cpp +// Function prototypes for packetparser.cpp uint8_t readPacket(BLEUart *ble_uart, uint16_t timeout); float parsefloat(uint8_t *buffer); void printHex(const uint8_t * data, const uint32_t numBytes); @@ -34,7 +34,7 @@ extern uint8_t packetbuffer[]; void setup(void) { Serial.begin(115200); - Serial.println(F("Adafruit Bluefruit52 App Controller Example")); + Serial.println(F("Adafruit Bluefruit52 Controller App Example")); Serial.println(F("-------------------------------------------")); Bluefruit.begin(); @@ -43,7 +43,7 @@ void setup(void) // Configure and Start BLE Uart Service bleuart.start(); - // Set up Advertising Packet + // Set up the advertising packet setupAdv(); // Start Advertising