bluetooth control motor
Dependents: BLE_LED_IDB0XA1_demo MOTOR_BLE_V2 Motor_Ble_v1 Motor_Ble_v10223 ... more
Fork of X_NUCLEO_IDB0XA1 by
Diff: source/platform/btle.cpp
- Branch:
- 83c30f290087a6f5a503812f507492e725a3b717
- Revision:
- 272:4639da7705e1
- Parent:
- 271:7dc6261c33e5
- Child:
- 273:00205952d841
--- a/source/platform/btle.cpp Thu Sep 15 10:51:33 2016 +0100 +++ b/source/platform/btle.cpp Thu Sep 15 10:51:34 2016 +0100 @@ -426,7 +426,7 @@ BlueNRGGap::getInstance().setConnectionHandle(cc->handle); BlueNRGGap::ConnectionParams_t connectionParams = { /* minConnectionInterval = */ cc->interval, - /* maxConnectionInterval = */ cc->interval, + /* maxConnectionInterval = */ cc->interval, /* slaveLatency = */ cc->latency, /* connectionSupervisionTimeout = */ cc->supervision_timeout }; @@ -459,7 +459,9 @@ role = Gap::PERIPHERAL; break; } - //PRINTF("EVT_LE_CONN_COMPLETE GAP role=%d\n", role); + + BlueNRGGap::getInstance().setGapRole(role); + BlueNRGGap::getInstance().processConnectionEvent(cc->handle, role, peerAddrType, @@ -638,6 +640,36 @@ } break; + case EVT_BLUE_L2CAP_CONN_UPD_REQ: + { + PRINTF("EVT_BLUE_L2CAP_CONN_UPD_REQ\r\n"); + evt_l2cap_conn_upd_req *evt = (evt_l2cap_conn_upd_req*)blue_evt->data; + if(bnrg_expansion_board == IDB05A1) { + // we assume the application accepts the request from the slave + aci_l2cap_connection_parameter_update_response_IDB05A1(evt->conn_handle, + evt->interval_min, + evt->interval_max, + evt->slave_latency, + evt->timeout_mult, + CONN_L1, CONN_L2, + evt->identifier, + 0x0000); + } + } + break; + + case EVT_BLUE_L2CAP_CONN_UPD_RESP: + { + PRINTF("EVT_BLUE_L2CAP_CONN_UPD_RESP\r\n"); + } + break; + + case EVT_LE_CONN_UPDATE_COMPLETE: + { + PRINTF("EVT_LE_CONN_UPDATE_COMPLETE\r\n"); + } + break; + case EVT_BLUE_GAP_DEVICE_FOUND: { evt_gap_device_found *pr = (evt_gap_device_found*)blue_evt->data;