ble nano hid over gatt

Dependencies:   BLE_API mbed-dev nRF51822

Revision:
80:3beb0293b384
Parent:
79:0095bfb18c57
Child:
81:fbe7358e38a4
--- a/KeyboardService.h	Sat Sep 03 20:36:40 2016 +0900
+++ b/KeyboardService.h	Sat Sep 03 22:30:00 2016 +0900
@@ -165,13 +165,13 @@
 	virtual ble_error_t send(const report_t report) {
 		if (protocolMode == REPORT_PROTOCOL) { // this is default
 			return ble.gattServer().write(
-				bootKeyboardInputReportCharacteristic.getValueHandle(),
+				inputReportCharacteristic.getValueHandle(),
 				report,
 				inputReportLength
 			);
 		} else {
 			return ble.gattServer().write(
-				inputReportCharacteristic.getValueHandle(),
+				bootKeyboardInputReportCharacteristic.getValueHandle(),
 				report,
 				inputReportLength
 			);
@@ -212,6 +212,7 @@
 	}
 
 	void queueCurrentReportData() {
+		DEBUG_PRINTF_BLE("Q %d\r\n", bufferCount);
 		bufferCount++;
 		inputReportBuffer.push(inputReportData);
 		startReportTicker();
@@ -264,9 +265,10 @@
 
 		static uint8_t busyCount = 0;
 		isSending = true;
-		ble_error_t error = HIDServiceBase::send(inputReportDataSending.raw);
+		ble_error_t error = send(inputReportDataSending.raw);
 		if (error == BLE_STACK_BUSY) {
 			if (busyCount++ > 10) {
+				DEBUG_PRINTF_BLE("BLE_STACK_BUSY\r\n");
 				busyCount = 0;
 				stopReportTicker();
 			}