HID-over-GATT implementation with the BLE API. This library allows to create devices such as mouse, keyboard or joystick, over Bluetooth Low Energy.

Dependents:   BLENano_HID BLE_HID_MouseScrollDemo BLE_HID_KeyboardStreamDemo Shervs_TestKeyboard_TinyBLE ... more

The development repository is currently hosted on github. It contains examples and documentation. This is a snapshot of the library. The documentation can be read on github, or on docs.mbed.com.

Revision:
1:7a6c2e2c9371
Parent:
0:cfd70fa91663
Child:
3:4f8429a1905b
--- a/HIDServiceBase.h	Tue Sep 15 20:16:58 2015 +0100
+++ b/HIDServiceBase.h	Wed Oct 07 11:29:52 2015 +0100
@@ -1,3 +1,19 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2015 ARM Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 #ifndef HID_SERVICE_BASE_H_
 #define HID_SERVICE_BASE_H_
 
@@ -87,19 +103,8 @@
      */
     virtual ble_error_t read(report_t report);
 
-    /**
-     * Set connection state.
-     *
-     * BLE API doesn't allow to chain onConnection callbacks at the moment, so it is the
-     * application's responsibility to use this method to update connection state.
-
-     * TODO: This is temporary. Remove external calls to setConnected once connection callback
-     * chaining is integrated into BLE API.
-     */
-    virtual void setConnected(bool connected)
-    {
-        this->connected = connected;
-    }
+    virtual void onConnection(const Gap::ConnectionCallbackParams_t *params);
+    virtual void onDisconnection(const Gap::DisconnectionCallbackParams_t *params);
 
     virtual bool isConnected(void)
     {