ble nano hid over gatt

Dependencies:   BLE_API mbed-dev nRF51822

Revision:
76:8c5b07462dad
Parent:
75:351d7ffe81d1
Child:
79:0095bfb18c57
--- a/HIDController_BLE.cpp	Fri Sep 02 21:16:15 2016 +0900
+++ b/HIDController_BLE.cpp	Fri Sep 02 22:02:02 2016 +0900
@@ -361,11 +361,18 @@
 
 void HIDController::initializeConnection(const bool ignoreWhiteList = false) {
 	ble_error_t error;
+
+	DEBUG_PRINTF_BLE("initializeConnection(%d)\r\n", ignoreWhiteList);
+
 	BLE& ble = BLE::Instance(BLE::DEFAULT_INSTANCE);
 	ble.gap().setAdvertisingInterval(20);
 	ble.gap().setAdvertisingTimeout(30);
 	if (ignoreWhiteList) {
 		ble.gap().setAdvertisingPolicyMode(Gap::ADV_POLICY_IGNORE_WHITELIST);
+	} else {
+		// XXX : startAdvertising returns BLE_ERROR_PARAM_OUT_OF_RANGE
+		// ble.gap().setAdvertisingPolicyMode(Gap::ADV_POLICY_FILTER_ALL_REQS);
+		ble.gap().setAdvertisingPolicyMode(Gap::ADV_POLICY_IGNORE_WHITELIST);
 	}
 
 	// DEBUG_PRINTF_BLE("advertising\r\n");