Skip to content

Commit 85e88cc

Browse files
committed
BLE NRF: Fix wrong usage of designed initializer in cpp code.
1 parent 1fd953e commit 85e88cc

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/source/nRF5xServiceDiscovery.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ nRF5xServiceDiscovery::launchCharacteristicDiscovery(Gap::Handle_t connectionHan
2424
characteristicDiscoveryStarted(connectionHandle);
2525

2626
ble_gattc_handle_range_t handleRange = {
27-
.start_handle = startHandle,
28-
.end_handle = endHandle
27+
(uint16_t) startHandle,
28+
(uint16_t) endHandle
2929
};
3030
uint32_t rc = sd_ble_gattc_characteristics_discover(connectionHandle, &handleRange);
3131
ble_error_t err = BLE_ERROR_NONE;
@@ -170,8 +170,8 @@ nRF5xServiceDiscovery::progressCharacteristicDiscovery(void)
170170

171171
if (startHandle < endHandle) {
172172
ble_gattc_handle_range_t handleRange = {
173-
.start_handle = startHandle,
174-
.end_handle = endHandle
173+
(uint16_t) startHandle,
174+
(uint16_t) endHandle
175175
};
176176
if (sd_ble_gattc_characteristics_discover(connHandle, &handleRange) != NRF_SUCCESS) {
177177
terminateCharacteristicDiscovery(BLE_ERROR_UNSPECIFIED);

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xServiceDiscovery.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ nRF5xServiceDiscovery::launchCharacteristicDiscovery(Gap::Handle_t connectionHan
2424
characteristicDiscoveryStarted(connectionHandle);
2525

2626
ble_gattc_handle_range_t handleRange = {
27-
.start_handle = startHandle,
28-
.end_handle = endHandle
27+
(uint16_t) startHandle,
28+
(uint16_t) endHandle
2929
};
3030
uint32_t rc = sd_ble_gattc_characteristics_discover(connectionHandle, &handleRange);
3131
ble_error_t err = BLE_ERROR_NONE;
@@ -170,8 +170,8 @@ nRF5xServiceDiscovery::progressCharacteristicDiscovery(void)
170170

171171
if (startHandle < endHandle) {
172172
ble_gattc_handle_range_t handleRange = {
173-
.start_handle = startHandle,
174-
.end_handle = endHandle
173+
(uint16_t) startHandle,
174+
(uint16_t) endHandle
175175
};
176176
if (sd_ble_gattc_characteristics_discover(connHandle, &handleRange) != NRF_SUCCESS) {
177177
terminateCharacteristicDiscovery(BLE_ERROR_UNSPECIFIED);
@@ -288,8 +288,8 @@ nRF5xServiceDiscovery::processDiscoverUUIDResponse(const ble_gattc_evt_t *p_gatt
288288
if (state == DISCOVER_SERVICE_UUIDS) {
289289
if ((response->count == 1) && (response->value_len == UUID::LENGTH_OF_LONG_UUID)) {
290290
UUID::LongUUIDBytes_t uuid;
291-
292-
#if (NRF_SD_BLE_API_VERSION >= 3)
291+
292+
#if (NRF_SD_BLE_API_VERSION >= 3)
293293
ble_gattc_handle_value_t iter;
294294
memset(&iter, 0, sizeof(ble_gattc_handle_value_t));
295295
(void) sd_ble_gattc_evt_char_val_by_uuid_read_rsp_iter(const_cast<ble_gattc_evt_t*>(p_gattc_evt), &iter);
@@ -308,7 +308,7 @@ nRF5xServiceDiscovery::processDiscoverUUIDResponse(const ble_gattc_evt_t *p_gatt
308308
} else if (state == DISCOVER_CHARACTERISTIC_UUIDS) {
309309
if ((response->count == 1) && (response->value_len == UUID::LENGTH_OF_LONG_UUID + 1 /* props */ + 2 /* value handle */)) {
310310
UUID::LongUUIDBytes_t uuid;
311-
311+
312312
#if (NRF_SD_BLE_API_VERSION >= 3)
313313
ble_gattc_handle_value_t iter;
314314
memset(&iter, 0, sizeof(ble_gattc_handle_value_t));
@@ -317,7 +317,7 @@ nRF5xServiceDiscovery::processDiscoverUUIDResponse(const ble_gattc_evt_t *p_gatt
317317
#else
318318
memcpy(uuid, &(response->handle_value[0].p_value[3]), UUID::LENGTH_OF_LONG_UUID);
319319
#endif
320-
320+
321321
unsigned charIndex = charUUIDDiscoveryQueue.dequeue();
322322
characteristics[charIndex].setupLongUUID(uuid, UUID::LSB);
323323

0 commit comments

Comments
 (0)