 
 void monitorSensorTagButtons(BLEDevice peripheral)
 {
-  static bool getAllServices = true;
-  static int serviceIndx = 0;
-
   // connect to the peripheral
   Serial.println("Connecting ...");
   if (peripheral.connect()) {

 */

#include <CurieBLE.h>

const int NUM_OF_SERVICE = 10;

char *serviceUUIDArray[NUM_OF_SERVICE] =

  // These are the various services that are included in the CC2650 Sensor Tag
  // If you uncomment them you can see the various services
{ //"f000aa00-0451-4000-b000-000000000000",
  //    "f000aa20-0451-4000-b000-000000000000",
  //    "f000aa40-0451-4000-b000-000000000000",
  //    "f000aa70-0451-4000-b000-000000000000",
  //    "f000aa80-0451-4000-b000-000000000000",
  //    "f000aa64-0451-4000-b000-000000000000",
  //    "f000ac00-0451-4000-b000-000000000000",
  //    "f000ccc0-0451-4000-b000-000000000000",
  //    "f000ffc0-0451-4000-b000-000000000000",
  "0000ffe0-0000-1000-8000-00805f9b34fb"
};

void setup() {
  Serial.begin(9600);

    return;
  }

  // discover peripheral attributes
  Serial.println("Discovering attributes of service 0xffe0 ...");
  if (peripheral.discoverAttributesByService("ffe0")) {
    Serial.println("Attributes discovered");
  } else {
    Serial.println("Attribute discovery failed.");
    peripheral.disconnect();
    return;
  }

  // retrieve the simple key characteristic
  BLECharacteristic simpleKeyCharacteristic = peripheral.characteristic("ffe1");

  // subscribe to the simple key characteristic
  Serial.println("Subscribing to simple key characteristic ...");
