Andriy Makukha / Mbed 2 deprecated football_project_wo_output

Dependencies:   mbed

Fork of football_project by MZJ

Revision:
75:1b357bee1839
Parent:
19:afcbb425b3cf
--- a/PhoneAppIO.cpp	Wed Mar 02 03:32:40 2016 +0000
+++ b/PhoneAppIO.cpp	Sun Apr 03 08:56:32 2016 +0000
@@ -47,7 +47,7 @@
                                                                                            //  but they might not be needed here.
         }
 
-        bleP->readCharacteristicValue( toConeHandle, buf, &bytesRead );
+        ble_error_t err = bleP->readCharacteristicValue( toConeHandle, buf, &bytesRead );
 
         // Copy data to accessible location for others and handleRead().
         memset( txPayload, 0, TXRX_BUF_LEN );
@@ -117,13 +117,14 @@
 
 void PhoneAppIO::handleRead()
 {
-    while( reading );  // Block.
+    //// while( reading );  // Block.
 
     int charsToBuf = rxBuffer.write( data, bytesRead );
     if( charsToBuf != bytesRead )
     {
         ::printf( "[ERROR] ToPhoneCharacteristic Data Lost, tried %d, got %d\r\n", bytesRead, charsToBuf );
     }
+    DEBUG( "Got:%s", data );
 }
 
 /** This method used to transfer data from the internal write buffer
@@ -137,7 +138,7 @@
 }
 
 // I think we don't need to use these because I'm guessing
-//  all reads happen during main loop ble.waitForEvent()?
+//  all reads happen during main loop ble.waitForEvent()?  -- Not using waitForEvent() now.
 
 // For locking out read() during write() to prevent buffer state corruption.
 void PhoneAppIO::disableTxIrq(){  writing = true;   }