BLE MIDI TO UART MIDI

Dependencies:   BLE_API BufferedSerial mbed nRF51822

Fork of MIDI-to-BLE-MIDI-bridge by Samuele Cornell

Files at this revision

API Documentation at this revision

Comitter:
niklasjakob
Date:
Mon Jun 12 17:14:01 2017 +0000
Parent:
0:244f1d0a3810
Commit message:
BLE RECEIVER

Changed in this revision

BLE_API.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
nRF51822.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 244f1d0a3810 -r 5cdcb9c72948 BLE_API.lib
--- a/BLE_API.lib	Tue Aug 09 12:57:23 2016 +0000
+++ b/BLE_API.lib	Mon Jun 12 17:14:01 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#d494ad3e87bd
+http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#65474dc93927
diff -r 244f1d0a3810 -r 5cdcb9c72948 main.cpp
--- a/main.cpp	Tue Aug 09 12:57:23 2016 +0000
+++ b/main.cpp	Mon Jun 12 17:14:01 2017 +0000
@@ -62,7 +62,7 @@
 DigitalOut greenled(TX_LED); //
 #endif 
 
-
+Serial pc(USBTX, USBRX);
 /******************************************************************************************************************************
 *INITIALIZE VARIABLES, BUFFERS and BLE-MIDI Service and Characteristic
 ******************************************************************************************************************************/
@@ -335,7 +335,7 @@
 int main(void)
 {
 
-
+pc.baud(115200);
 #if LIGHT_SHOW==1
     redled = 1;
     greenled = 1;
@@ -392,9 +392,12 @@
 
 #if ONLY_BLEMIDI_to_MIDI==0    
             if(sendBLEMIDI_flag == true ) { // check if the flag is set 
+        uint8_t buf[TXRX_BUF_LEN];
+        uint16_t bytesRead;
+        ble.readCharacteristicValue(midiCharacteristic.getValueAttribute().getHandle(),
+                                    buf, &bytesRead);
+        pc.putc(buf[1]);
 
-            sendBLEMIDI_flag=false ;
-            sendBLEMIDI() ; // parse MIDI Events from UART and send them over BLE
 
         }
 #endif
diff -r 244f1d0a3810 -r 5cdcb9c72948 mbed.bld
--- a/mbed.bld	Tue Aug 09 12:57:23 2016 +0000
+++ b/mbed.bld	Mon Jun 12 17:14:01 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/093f2bd7b9eb
\ No newline at end of file
diff -r 244f1d0a3810 -r 5cdcb9c72948 nRF51822.lib
--- a/nRF51822.lib	Tue Aug 09 12:57:23 2016 +0000
+++ b/nRF51822.lib	Mon Jun 12 17:14:01 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#088f5738bf18
+http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#c90ae1400bf2