microbit-dal

Dependencies:   BLE_API mbed-dev-bin nRF51822

Fork of microbit-dal by Lancaster University

Revision:
65:f7ebabf23e15
Parent:
58:2ac8d45f1b08
Child:
66:2fc7d7c2fffc
--- a/inc/bluetooth/MicroBitUARTService.h	Wed Jul 13 12:18:43 2016 +0100
+++ b/inc/bluetooth/MicroBitUARTService.h	Wed Jul 13 12:18:45 2016 +0100
@@ -55,7 +55,7 @@
 
     uint8_t txBufferSize;
 
-    uint32_t rxCharacteristicHandle;
+    uint32_t txCharacteristicHandle;
 
     // Bluetooth stack we're running on.
     BLEDevice           &ble;
@@ -115,69 +115,36 @@
     int getc(MicroBitSerialMode mode = SYNC_SLEEP);
 
     /**
-      * Places a single character into our transmission buffer,
+      * places a single character into our transmission buffer,
       *
       * @param c the character to transmit
       *
-      * @param mode the selected mode, one of: ASYNC, SYNC_SPINWAIT, SYNC_SLEEP. Each mode
-      *        gives a different behaviour:
-      *
-      *            ASYNC - Will copy as many characters as it can into the buffer for transmission,
-      *                    and return control to the user.
-      *
-      *            SYNC_SPINWAIT - will return MICROBIT_INVALID_PARAMETER
-      *
-      *            SYNC_SLEEP - Will perform a cooperative blocking wait until all
-      *                         given characters have been received by the connected
-      *                         device.
-      *
-      * @return the number of characters written, or MICROBIT_NOT_SUPPORTED if there is
-      *         no connected device, or the connected device has not enabled indications.
+      * @return the number of characters written (0, or 1).
       */
-    int putc(char c, MicroBitSerialMode mode = SYNC_SLEEP);
+    int putc(char c);
 
     /**
       * Copies characters into the buffer used for Transmitting to the central device.
       *
       * @param buf a buffer containing length number of bytes.
       * @param length the size of the buffer.
-      * @param mode the selected mode, one of: ASYNC, SYNC_SPINWAIT, SYNC_SLEEP. Each mode
-      *        gives a different behaviour:
       *
-      *            ASYNC - Will copy as many characters as it can into the buffer for transmission,
-      *                    and return control to the user.
-      *
-      *            SYNC_SPINWAIT - will return MICROBIT_INVALID_PARAMETER
+      * @return the number of characters copied into the buffer
       *
-      *            SYNC_SLEEP - Will perform a cooperative blocking wait until all
-      *                         given characters have been received by the connected
-      *                         device.
-      *
-      * @return the number of characters written, or MICROBIT_NOT_SUPPORTED if there is
-      *         no connected device, or the connected device has not enabled indications.
+      * @note no modes for sending are available at the moment, due to interrupt overhead.
       */
-    int send(const uint8_t *buf, int length, MicroBitSerialMode mode = SYNC_SLEEP);
+    int send(const uint8_t *buf, int length);
 
     /**
       * Copies characters into the buffer used for Transmitting to the central device.
       *
       * @param s the string to transmit
-      * @param mode the selected mode, one of: ASYNC, SYNC_SPINWAIT, SYNC_SLEEP. Each mode
-      *        gives a different behaviour:
       *
-      *            ASYNC - Will copy as many characters as it can into the buffer for transmission,
-      *                    and return control to the user.
-      *
-      *            SYNC_SPINWAIT - will return MICROBIT_INVALID_PARAMETER
+      * @return the number of characters copied into the buffer
       *
-      *            SYNC_SLEEP - Will perform a cooperative blocking wait until all
-      *                         given characters have been received by the connected
-      *                         device.
-      *
-      * @return the number of characters written, or MICROBIT_NOT_SUPPORTED if there is
-      *         no connected device, or the connected device has not enabled indications.
+      * @note no modes for sending are available at the moment, due to interrupt overhead.
       */
-    int send(ManagedString s, MicroBitSerialMode mode = SYNC_SLEEP);
+    int send(ManagedString s);
 
     /**
       * Reads a number of characters from the rxBuffer and fills user given buffer.