HW layer for the Nucleo board, it only work with old BLE_API
Dependents: Hello_BLE F446RE-BLE
Fork of X_NUCLEO_IDB0XA1 by
Diff: platform/src/btle.cpp
- Revision:
- 77:332b416123b4
- Parent:
- 74:c4526f8284d5
- Child:
- 78:13e75d352d53
--- a/platform/src/btle.cpp Wed Jun 17 15:07:48 2015 +0200 +++ b/platform/src/btle.cpp Tue Jun 23 17:44:59 2015 +0200 @@ -35,8 +35,8 @@ #include "btle.h" -#include "public/Gap.h" -#include "public/GapEvents.h" +#include "ble/Gap.h" +#include "ble/GapEvents.h" #include "BlueNRGGap.h" #include "BlueNRGGattServer.h" #include "Utils.h" @@ -293,7 +293,7 @@ peerAddrType = Gap::ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE; break; } - BlueNRGGap::getInstance().processConnectionEvent(cc->handle, peerAddrType, cc->peer_bdaddr, addr_type, bleAddr, (const BlueNRGGap::ConnectionParams_t *)&connectionParams); + BlueNRGGap::getInstance().processConnectionEvent(cc->handle, Gap::PERIPHERAL, peerAddrType, cc->peer_bdaddr, addr_type, bleAddr, (const BlueNRGGap::ConnectionParams_t *)&connectionParams); } break; } @@ -303,9 +303,9 @@ case EVT_VENDOR: { evt_blue_aci *blue_evt = (evt_blue_aci*)event_pckt->data; + //DEBUG("EVT_VENDOR %d\n", blue_evt->ecode); + switch(blue_evt->ecode){ - - DEBUG("EVT_VENDOR %d\n", blue_evt->ecode); case EVT_BLUE_GATT_READ_PERMIT_REQ: { @@ -348,9 +348,9 @@ (GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE_WITHOUT_RESPONSE| GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE))) { - GattCharacteristicWriteCBParams writeParams; - writeParams.charHandle=evt->attr_handle; - writeParams.op=GattCharacteristicWriteCBParams::GATTS_CHAR_OP_WRITE_REQ;//Where to find this property in BLUENRG? + GattWriteCallbackParams writeParams; + writeParams.handle=evt->attr_handle; + writeParams.writeOp=GattWriteCallbackParams::OP_WRITE_REQ;//Where to find this property in BLUENRG? writeParams.len=evt->data_length; writeParams.data=evt->att_data; #ifdef BLUENRG_MS @@ -361,8 +361,10 @@ //BlueNRGGattServer::getInstance().handleEvent(GattServerEvents::GATT_EVENT_DATA_WRITTEN, evt->attr_handle); //Write the actual Data to the Attr Handle? (uint8_1[])evt->att_data contains the data if ((p_char->getValueAttribute().getValuePtr() != NULL) && (p_char->getValueAttribute().getInitialLength() > 0)) { - BlueNRGGattServer::getInstance().updateValue(p_char->getValueAttribute().getHandle(), - p_char->getValueAttribute().getValuePtr(), p_char->getValueAttribute().getInitialLength(), false /* localOnly */); + BlueNRGGattServer::getInstance().write(p_char->getValueAttribute().getHandle(), + p_char->getValueAttribute().getValuePtr(), + p_char->getValueAttribute().getInitialLength(), + false /* localOnly */); } } }