Hey guys,
Im using Adafruit's Bluetooth Low Energy (BLE 4.0) nRF8001 Breakout board to establish a connection between my Arduino and Android device.
My arduino code is below:
#include <Adafruit_BLE_UART.h>
#include <SPI.h>
#include <aREST.h>
// Libraries
// Pins
#define ADAFRUITBLE_REQ 10
#define ADAFRUITBLE_RDY 2 // This should be an interrupt pin, on Uno thats #2 or #3
#define ADAFRUITBLE_RST 9
// Relay pin
const int relay_pin = 7;
// Create aREST instance
aREST rest = aREST();
// BLE instance
Adafruit_BLE_UART BTLEserial = Adafruit_BLE_UART(ADAFRUITBLE_REQ, ADAFRUITBLE_RDY, ADAFRUITBLE_RST);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
BTLEserial.begin();
rest.set_id("001");
rest.set_name("relay_control");
pinMode(relay_pin, OUTPUT);
}
void loop() {
// Tell the nRF8001 to do whatever it should be working on.
BTLEserial.pollACI();
// Ask what is our current status
aci_evt_opcode_t status = BTLEserial.getState();
// Handle REST calls
if (status == ACI_EVT_CONNECTED) {
rest.handle(BTLEserial);
}
}
As you can see, Im using Adafruit's library for this particular chip along with a REST api library.
However, im receiving this error message (below) whenever I try to compile the project :
In file included from bluetoothArduino.ino:5:0:
C:\Users\Gokul\Documents\Arduino\libraries\aREST-master/aREST.h: In member function 'void aREST::publish(Adafruit_BLE_UART&, String, T)':
C:\Users\Gokul\Documents\Arduino\libraries\aREST-master/aREST.h:369:17: error: 'client' was not declared in this scope
publish_proto(client, eventName, value);
^
Error compiling.
Im new to the arduino and am unsure about what is causing this error. Any advice would be much appreciated!
Thanks in advance!