sandeepmistry / arduino-BLEPeripheral

An Arduino library for creating custom BLE peripherals with Nordic Semiconductor's nRF8001 or nR51822.
MIT License
463 stars 180 forks source link

How to update the library BLEPeriferal higher than 0.3.1 in Arduino 1.8.1 ? #139

Closed bossesand closed 7 years ago

bossesand commented 7 years ago

I cannot get the Arduino 1.8.1 to update BLEPeriferal higher than 0,3,1 I have downloaded the arduino-BLEPeriferal-master.zip but when I try to add as a zip library I cannot really see anything happening.

It is probably an easy step but I have difficulty remembering how I updated to 4.0 before, and now I backed down as I wanted to remove the library and reinstall it with the latest examples.

Think I have the libraries in correct place now, but examples do not compile... My C++ Skill is near zero...

The serial example does not compile for me C:\Users\bosse\Documents\Arduino\serial\serial.ino: In function 'void setup()': serial:29: error: request for member 'setLocalName' in 'BLESerial', which is of non-class type 'BLESerial()' BLESerial.setLocalName("UART"); ^ serial:32: error: request for member 'begin' in 'BLESerial', which is of non-class type 'BLESerial()' BLESerial.begin(); C:\Users\bosse\Documents\Arduino\serial\serial.ino: In function 'void loop()': serial:36: error: request for member 'poll' in 'BLESerial', which is of non-class type 'BLESerial()' BLESerial.poll(); ^ C:\Users\bosse\Documents\Arduino\serial\serial.ino: In function 'void forward()': serial:48: error: request for member 'read' in 'BLESerial', which is of non-class type 'BLESerial()' while ((byte = BLESerial.read()) > 0) Serial.write((char)byte); ^ serial:49: error: request for member 'write' in 'BLESerial', which is of non-class type 'BLESerial()' while ((byte = Serial.read()) > 0) BLESerial.write((char)byte); ^ C:\Users\bosse\Documents\Arduino\serial\serial.ino: In function 'void loopback()': serial:57: error: request for member 'read' in 'BLESerial', which is of non-class type 'BLESerial()' while ((byte = BLESerial.read()) > 0) BLESerial.write(byte); ^ serial:57: error: request for member 'write' in 'BLESerial', which is of non-class type 'BLESerial()' while ((byte = BLESerial.read()) > 0) BLESerial.write(byte); ^ C:\Users\bosse\Documents\Arduino\serial\serial.ino: In function 'void spam()': serial:64: error: request for member 'print' in 'BLESerial', which is of non-class type 'BLESerial()' BLESerial.print(millis()); ^ serial:65: error: request for member 'println' in 'BLESerial', which is of non-class type 'BLESerial()'

 BLESerial.println(" tick-tacks!");

           ^

Using library SPI at version 1.0 in folder: C:\Users\bosse\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52\0.5.1\libraries\SPI Using library BLEPeripheral at version 0.3.1 in folder: C:\Users\bosse\Documents\Arduino\libraries\BLEPeripheral exit status 1 request for member 'setLocalName' in 'BLESerial', which is of non-class type 'BLESerial()'

cheeta1 commented 7 years ago

hi @bossesand i have faced this issue you have to remove this line

//custom boards may override default pin definitions with BLESerial(PIN_REQ, PIN_RDY, PIN_RST) BLESerial BLESerial();

and add the following lines

define BLE_REQ 5

define BLE_RDY 4

define BLE_RST 6

BLESerial BLESerial(BLE_REQ, BLE_RDY, BLE_RST);

now it will work

sandeepmistry commented 7 years ago

IDE 1.8.2 lists v0.4.0 of the library is available (and installed) for me, I suggest you post something on forum.arduino.cc

screen shot 2017-04-16 at 7 37 00 pm