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.
Fork of football_project by
Diff: PhoneAppIO.cpp
- Revision:
- 75:1b357bee1839
- Parent:
- 19:afcbb425b3cf
diff -r 9257d83bd36c -r 1b357bee1839 PhoneAppIO.cpp
--- 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; }
