Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API mbed nRF51822
Diff: main.cpp
- 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);