Dissertation project, looking at BLE communication in cars. This project is BLE peripheral acting as car indicator stalk

Dependencies:   BLE_API mbed nRF51822

Fork of BLE_GATT_test1 by Alexander Lea

Revision:
10:2c5c202c69a5
Parent:
9:0ed64b14d46b
Child:
11:35b63ab4c76c
--- a/main.cpp	Thu Mar 12 12:52:26 2015 +0000
+++ b/main.cpp	Sun Mar 22 17:47:11 2015 +0000
@@ -6,6 +6,7 @@
 #include "mbed.h"
 #include "BLEDevice.h"
 #include "BroadcasterService.h"
+#include "ErrorService.h"
 #include <string>
 
 using namespace std;
@@ -40,7 +41,7 @@
 int main(void)
 {
     //TODO: I want to be able to send something like:
-    uint8_t cmdOn[8] = { 0x4d,0x32,0x81,0xc0,0x01,0x01,0x01,0x01 };
+    uint8_t cmdOn[8] = { 0x4d,0x32,0x81,0xc0,0x4d,0x4d,0x4d,0x4d };
     uint8_t cmdOff[8] = { 0x4d,0x32,0x81,0xc0,0x00,0x00,0x00,0x00 };
     //with first 4 bits being type code, and last 4 being command, or something
 
@@ -59,6 +60,7 @@
 
     //CarCommsService commsService(ble, cmd);
     BroadcasterService broadcasterService(ble);
+    ErrorService errorService(ble);
 
     /*
     **BREDR_NOT_SUPPORTED = BLE only
@@ -84,6 +86,8 @@
             if(x) {
                 pc.printf("Command = %u\r\n", cmdOn);
                 broadcasterService.sendCommand(cmdOn);
+                
+                errorService.registerError(ErrorService::ERROR_GENERIC);
                 x = false;
             } else {
                 pc.printf("Command = %u\r\n", cmdOff);