Using the MBED BLE library and Nordic Puck library this is a simple scoring application using Bluetooth LE. It monitors three analog inputs and triggers on reception of a pulse on any one recording data for a short period on all three. This is then published via BLE characteristics. It's a demonstrator for a new UI dev toolkit that is under development.

Dependencies:   Puck mbed

Fork of Example_Puck_BLE by Nordic Semiconductor

Files at this revision

API Documentation at this revision

Comitter:
aleksanb
Date:
Mon Aug 11 11:17:56 2014 +0000
Child:
1:1a59b4810261
Commit message:
Initial commit

Changed in this revision

Puck.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Puck.lib	Mon Aug 11 11:17:56 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/teams/Nordic-Pucks/code/Puck/#93d3574e9e36
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Aug 11 11:17:56 2014 +0000
@@ -0,0 +1,44 @@
+/**
+ * Copyright 2014 Nordic Semiconductor
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+#define LOG_LEVEL_INFO
+#include "Puck.h"
+
+Puck* puck = &Puck::getPuck();
+
+// Sample Gatt characteristic and service UUIDs
+const UUID SAMPLE_GATT_SERVICE = stringToUUID("bftj sample     ");
+const UUID SAMPLE_GATT_CHARACTERISTIC = stringToUUID("bftj sample char");
+
+int main(void) {
+    // Add the Gatt characteristic
+    int characteristicValueLength = 1;
+    puck->addCharacteristic(
+            SAMPLE_GATT_SERVICE,
+            SAMPLE_GATT_CHARACTERISTIC,
+            characteristicValueLength,
+            GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY);
+
+    // Initialize the puck
+    puck->init(0xFEED);
+
+    // Set the initial value of the characteristic
+    uint8_t new_value = 42;
+    puck->updateCharacteristicValue(SAMPLE_GATT_CHARACTERISTIC, &new_value, characteristicValueLength);
+
+    // Let the puck do it's thing
+    while(puck->drive());
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Aug 11 11:17:56 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6213f644d804
\ No newline at end of file