Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: libnsdl_m0 BLE_API Base64 nRF51822 SplitterAssembler
Revision 30:13f78e38fae8, committed 2015-07-23
- Comitter:
- ansond
- Date:
- Thu Jul 23 20:28:37 2015 +0000
- Parent:
- 29:dee977f648e9
- Child:
- 31:0290f56da60c
- Commit message:
- updates for STM portability
Changed in this revision
--- a/bt_network/BleUartRPC/Dispatcher.cpp Wed May 13 14:15:42 2015 +0000
+++ b/bt_network/BleUartRPC/Dispatcher.cpp Thu Jul 23 20:28:37 2015 +0000
@@ -33,14 +33,9 @@
// constructor
Dispatcher::Dispatcher(BLEDevice &ble) : m_uart(ble), m_splitter(), m_splitter_count(0), m_splitter_index(0) {
ble.onDataWritten(this,&Dispatcher::onDataWritten);
- ble.onDataSent(this,&Dispatcher::onDataSent);
memset(this->m_send_packet,0,MAX_PACKET_LENGTH+1);
}
- void Dispatcher::onDataSent(unsigned count) {
- //DBG("onDataSent: count=%d\r\n",count);
- }
-
void Dispatcher::onDataWritten(const GattCharacteristicWriteCBParams *params) {
int length = (int)params->len;
uint8_t *data = (uint8_t *)params->data;
--- a/bt_network/BleUartRPC/Dispatcher.h Wed May 13 14:15:42 2015 +0000
+++ b/bt_network/BleUartRPC/Dispatcher.h Thu Jul 23 20:28:37 2015 +0000
@@ -55,7 +55,6 @@
int dispatch(uint8_t fn_id,uint8_t *args,int args_length,uint8_t *response,int response_length);
private:
- void onDataSent(unsigned count);
void onDataWritten(const GattCharacteristicWriteCBParams *params);
int uart_write(bool send_ack = false);
--- a/network_stubs/network_stubs.cpp Wed May 13 14:15:42 2015 +0000
+++ b/network_stubs/network_stubs.cpp Thu Jul 23 20:28:37 2015 +0000
@@ -76,8 +76,12 @@
}
}
+#if defined(TARGET_STM32F411RE) || defined(TARGET_STM32F401RE)
+void ble_connect_callback(Gap::Handle_t handle, const Gap::ConnectionParams_t *reason)
+#else
// BLE Connection callback
void ble_connect_callback(Gap::Handle_t handle, Gap::addr_type_t peerAddrType, const Gap::address_t peerAddr, Gap::addr_type_t ownAddrType, const Gap::address_t ownAddr, const Gap::ConnectionParams_t *params)
+#endif
{
DBG("ble_connect_callback: BLE connected!...\r\n");
if (__registered == false) {
@@ -112,7 +116,11 @@
ble.accumulateAdvertisingPayload(GapAdvertisingData::SHORTENED_LOCAL_NAME,(const uint8_t *)endpoint_name, strlen((char *)endpoint_name));
ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_16BIT_SERVICE_IDS,(uint8_t *)deviceInfoServiceUUID, sizeof(deviceInfoServiceUUID));
ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_128BIT_SERVICE_IDS,(const uint8_t *)UARTServiceUUID, sizeof(UARTServiceUUID));
- ble.setAdvertisingInterval(Gap::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(1000));
+#if defined(TARGET_STM32F411RE) || defined(TARGET_STM32F401RE)
+ ble.setAdvertisingInterval(1000);
+#else
+ ble.setAdvertisingInterval(Gap::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(1000));
+#endif
ble.startAdvertising();
}