Skip to content

Commit ae85c84

Browse files
skip setConnectionInterval for Arduino 101 by default
1 parent 25e6615 commit ae85c84

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

examples/StandardFirmataBLE/StandardFirmataBLE.ino

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,10 +756,27 @@ void setup()
756756

757757
stream.setLocalName(FIRMATA_BLE_LOCAL_NAME);
758758

759+
// setConnectionInterval is not available in the CurieBLE library included in the
760+
// Intel Curie Boards package v1.0.5 (latest version via the Boards Manager). Without
761+
// setConnectionInterval, the BLE reporting rate for analog input and I2C read continuous mode
762+
// will be very slow (150ms instead of 30ms).
763+
// However, you can manually update CurieBLE to get the functionality now. Follow these steps:
764+
// 1. Install Intel Curie Boards v1.0.5 via the Arduino Boards manager (use Arduino 1.6.7 or newer)
765+
// 2. Download or clone corelibs-arduino101: https://github.com/01org/corelibs-arduino101
766+
// 3. Make a copy of the CurieBLE directory found in corelibs-arduino101/libraries/
767+
// 4. Find the Arduino15 directory on your computer:
768+
// OS X: ~/Library/Arduino15
769+
// Windows: C:\Users\(username)\AppData\Local\Arduino15
770+
// Linux: ~/.arduino15
771+
// 5. From the Arduino15 directory, navigate to: /packages/Intel/hardware/arc32/1.0.5/libraries/
772+
// 6. Replace the CurieBLE library with the version you copied in step 3
773+
// 7. Comment out the #ifndef statement below and the following #endif statement
774+
#ifndef _VARIANT_ARDUINO_101_X_
759775
// set the BLE connection interval - this is the fastest interval you can read inputs
760776
stream.setConnectionInterval(FIRMATA_BLE_MIN_INTERVAL, FIRMATA_BLE_MAX_INTERVAL);
761777
// set how often the BLE TX buffer is flushed (if not full)
762778
stream.setFlushInterval(FIRMATA_BLE_MAX_INTERVAL);
779+
#endif
763780

764781
#ifdef BLE_REQ
765782
for (byte i = 0; i < TOTAL_PINS; i++) {

examples/StandardFirmataBLE/bleConfig.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@
2222
* If you are using a RedBearLab BLE shield, uncomment the define below.
2323
* Also, change the define for BLE_RST if you have the jumper set to pin 7 rather than pin 4.
2424
*
25-
* You will need to use the shield with an Arduino Mega, Due or other board with sufficient
25+
* You will need to use the shield with an Arduino Zero, Due, Mega, or other board with sufficient
2626
* Flash and RAM. Arduino Uno, Leonardo and other ATmega328p and Atmega32u4 boards to not have
2727
* enough memory to run StandardFirmataBLE.
2828
*
2929
* TODO: verify if this works and with which boards it works.
3030
*
3131
* Test script: https://gist.github.com/soundanalogous/927360b797574ed50e27
32-
* (may need to skip capabilities - see https://gist.github.com/soundanalogous/d39bb3eb36333a0906df)
3332
*/
3433
//#define REDBEAR_BLE_SHIELD
3534

utility/BLEStream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Based on BLESerial.cpp by Voita Molda
55
https://github.com/sandeepmistry/arduino-BLEPeripheral/blob/master/examples/serial/BLESerial.cpp
66
7-
Last updated by Jeff Hoefs: March 5th, 2016
7+
Last updated March 5th, 2016
88
*/
99

1010
#include "BLEStream.h"

utility/BLEStream.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Based on BLESerial.cpp by Voita Molda
55
https://github.com/sandeepmistry/arduino-BLEPeripheral/blob/master/examples/serial/BLESerial.h
66
7-
Last updated by Jeff Hoefs: March 5th, 2016
7+
Last updated March 13th, 2016
88
*/
99

1010
#ifndef _BLE_STREAM_H_
@@ -19,11 +19,7 @@
1919
#define _MAX_ATTR_DATA_LEN_ BLE_ATTRIBUTE_MAX_VALUE_LENGTH
2020
#endif
2121

22-
#if defined(_VARIANT_ARDUINO_101_X_)
23-
#define BLESTREAM_TXBUFFER_FLUSH_INTERVAL 30
24-
#else
2522
#define BLESTREAM_TXBUFFER_FLUSH_INTERVAL 80
26-
#endif
2723
#define BLESTREAM_MIN_FLUSH_INTERVAL 8 // minimum interval for flushing the TX buffer
2824

2925
class BLEStream : public BLEPeripheral, public Stream

0 commit comments

Comments
 (0)