51822 gatt gamepad no test https://github.com/ozanaltinkaya/BLE_Gamepad_NRF51822

Dependencies:   mbed BLE_API nRF51822

Committer:
weisimin
Date:
Tue Jul 20 09:23:54 2021 +0000
Revision:
0:706cf6936c11
BLE GATT GAMEPAD NO TEST

Who changed what in which revision?

UserRevisionLine numberNew contents of line
weisimin 0:706cf6936c11 1 /* mbed Microcontroller Library
weisimin 0:706cf6936c11 2 * Copyright (c) 2015 ARM Limited
weisimin 0:706cf6936c11 3 *
weisimin 0:706cf6936c11 4 * Licensed under the Apache License, Version 2.0 (the "License");
weisimin 0:706cf6936c11 5 * you may not use this file except in compliance with the License.
weisimin 0:706cf6936c11 6 * You may obtain a copy of the License at
weisimin 0:706cf6936c11 7 *
weisimin 0:706cf6936c11 8 * http://www.apache.org/licenses/LICENSE-2.0
weisimin 0:706cf6936c11 9 *
weisimin 0:706cf6936c11 10 * Unless required by applicable law or agreed to in writing, software
weisimin 0:706cf6936c11 11 * distributed under the License is distributed on an "AS IS" BASIS,
weisimin 0:706cf6936c11 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
weisimin 0:706cf6936c11 13 * See the License for the specific language governing permissions and
weisimin 0:706cf6936c11 14 * limitations under the License.
weisimin 0:706cf6936c11 15 */
weisimin 0:706cf6936c11 16
weisimin 0:706cf6936c11 17 #ifndef HID_EXAMPLES_COMMON_H_
weisimin 0:706cf6936c11 18 #define HID_EXAMPLES_COMMON_H_
weisimin 0:706cf6936c11 19
weisimin 0:706cf6936c11 20 /**
weisimin 0:706cf6936c11 21 * Functions and configuration common to all HID demos
weisimin 0:706cf6936c11 22 */
weisimin 0:706cf6936c11 23
weisimin 0:706cf6936c11 24 #include "ble/BLE.h"
weisimin 0:706cf6936c11 25
weisimin 0:706cf6936c11 26 #include "HIDServiceBase.h"
weisimin 0:706cf6936c11 27
weisimin 0:706cf6936c11 28 /**
weisimin 0:706cf6936c11 29 * IO capabilities of the device. During development, you most likely want "JustWorks", which means
weisimin 0:706cf6936c11 30 * no IO capabilities.
weisimin 0:706cf6936c11 31 * It is also possible to use IO_CAPS_DISPLAY_ONLY to generate and show a pincode on the serial
weisimin 0:706cf6936c11 32 * output.
weisimin 0:706cf6936c11 33 */
weisimin 0:706cf6936c11 34 #ifndef HID_SECURITY_IOCAPS
weisimin 0:706cf6936c11 35 #define HID_SECURITY_IOCAPS (SecurityManager::IO_CAPS_NONE)
weisimin 0:706cf6936c11 36 #endif
weisimin 0:706cf6936c11 37
weisimin 0:706cf6936c11 38 /**
weisimin 0:706cf6936c11 39 * Security level. MITM disabled forces "Just Works". If you require MITM, HID_SECURITY_IOCAPS must
weisimin 0:706cf6936c11 40 * be at least IO_CAPS_DISPLAY_ONLY.
weisimin 0:706cf6936c11 41 */
weisimin 0:706cf6936c11 42 #ifndef HID_SECURITY_REQUIRE_MITM
weisimin 0:706cf6936c11 43 #define HID_SECURITY_REQUIRE_MITM false
weisimin 0:706cf6936c11 44 #endif
weisimin 0:706cf6936c11 45
weisimin 0:706cf6936c11 46 /**
weisimin 0:706cf6936c11 47 * Disable debug messages by setting NDEBUG
weisimin 0:706cf6936c11 48 */
weisimin 0:706cf6936c11 49 #ifndef NDEBUG
weisimin 0:706cf6936c11 50 #define HID_DEBUG(...) printf(__VA_ARGS__)
weisimin 0:706cf6936c11 51 #else
weisimin 0:706cf6936c11 52 #define HID_DEBUG(...)
weisimin 0:706cf6936c11 53 #endif
weisimin 0:706cf6936c11 54
weisimin 0:706cf6936c11 55 /**
weisimin 0:706cf6936c11 56 * Initialize security manager: set callback functions and required security level
weisimin 0:706cf6936c11 57 */
weisimin 0:706cf6936c11 58 void initializeSecurity(BLE &ble);
weisimin 0:706cf6936c11 59
weisimin 0:706cf6936c11 60 /**
weisimin 0:706cf6936c11 61 * - Initialize auxiliary services required by the HID-over-GATT Profile.
weisimin 0:706cf6936c11 62 * - Initialize common Gap advertisement.
weisimin 0:706cf6936c11 63 *
weisimin 0:706cf6936c11 64 * Demos only have to set a custom device name and appearance, and their HID
weisimin 0:706cf6936c11 65 * service.
weisimin 0:706cf6936c11 66 */
weisimin 0:706cf6936c11 67 void initializeHOGP(BLE &ble);
weisimin 0:706cf6936c11 68
weisimin 0:706cf6936c11 69 #endif /* !BLE_HID_COMMON_H_ */