29
29
namespace {
30
30
31
31
static const ble_gatts_rw_authorize_reply_params_t write_auth_queue_full_reply = {
32
- .type = BLE_GATTS_AUTHORIZE_TYPE_WRITE,
33
- .params = {
34
- .write = {
35
- .gatt_status = BLE_GATT_STATUS_ATTERR_PREPARE_QUEUE_FULL
32
+ /* .type = */ BLE_GATTS_AUTHORIZE_TYPE_WRITE,
33
+ /* .params = */ {
34
+ /* .write = */ {
35
+ /* .gatt_status = */ BLE_GATT_STATUS_ATTERR_PREPARE_QUEUE_FULL
36
36
}
37
37
}
38
38
};
39
39
40
40
static const ble_gatts_rw_authorize_reply_params_t write_auth_invalid_offset_reply = {
41
- .type = BLE_GATTS_AUTHORIZE_TYPE_WRITE,
42
- .params = {
43
- .write = {
44
- .gatt_status = BLE_GATT_STATUS_ATTERR_INVALID_OFFSET
41
+ /* .type = */ BLE_GATTS_AUTHORIZE_TYPE_WRITE,
42
+ /* .params = */ {
43
+ /* .write = */ {
44
+ /* .gatt_status = */ BLE_GATT_STATUS_ATTERR_INVALID_OFFSET
45
45
}
46
46
}
47
47
};
48
48
49
49
static const ble_gatts_rw_authorize_reply_params_t write_auth_succes_reply = {
50
- .type = BLE_GATTS_AUTHORIZE_TYPE_WRITE,
51
- .params = {
52
- .write = {
53
- .gatt_status = BLE_GATT_STATUS_SUCCESS,
54
- .update = 0
50
+ /* .type = */ BLE_GATTS_AUTHORIZE_TYPE_WRITE,
51
+ /* .params = */ {
52
+ /* .write = */ {
53
+ /* .gatt_status = */ BLE_GATT_STATUS_SUCCESS,
54
+ /* .update = */ 0
55
55
}
56
56
}
57
57
};
58
58
59
59
static const ble_gatts_rw_authorize_reply_params_t write_auth_invalid_reply = {
60
- .type = BLE_GATTS_AUTHORIZE_TYPE_WRITE,
61
- .params = {
62
- .write = {
63
- .gatt_status = BLE_GATT_STATUS_ATTERR_INVALID
60
+ /* .type = */ BLE_GATTS_AUTHORIZE_TYPE_WRITE,
61
+ /* .params = */ {
62
+ /* .write = */ {
63
+ /* .gatt_status = */ BLE_GATT_STATUS_ATTERR_INVALID
64
64
}
65
65
}
66
66
};
@@ -260,9 +260,9 @@ ble_error_t nRF5xGattServer::read(GattAttribute::Handle_t attributeHandle, uint8
260
260
ble_error_t nRF5xGattServer::read (Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP)
261
261
{
262
262
ble_gatts_value_t value = {
263
- .len = *lengthP,
264
- .offset = 0 ,
265
- .p_value = buffer,
263
+ /* .len = */ *lengthP,
264
+ /* .offset = */ 0 ,
265
+ /* .p_value = */ buffer,
266
266
};
267
267
268
268
ASSERT_TRUE ( ERROR_NONE ==
@@ -302,9 +302,9 @@ ble_error_t nRF5xGattServer::write(Gap::Handle_t connectionHandle, GattAttribute
302
302
ble_error_t returnValue = BLE_ERROR_NONE;
303
303
304
304
ble_gatts_value_t value = {
305
- .len = len,
306
- .offset = 0 ,
307
- .p_value = const_cast <uint8_t *>(buffer),
305
+ /* .len = */ len,
306
+ /* .offset = */ 0 ,
307
+ /* .p_value = */ const_cast <uint8_t *>(buffer),
308
308
};
309
309
310
310
if (localOnly) {
@@ -611,14 +611,14 @@ void nRF5xGattServer::hwCallback(ble_evt_t *p_ble_evt)
611
611
612
612
// success, signal it to the softdevice
613
613
ble_gatts_rw_authorize_reply_params_t reply = {
614
- .type = BLE_GATTS_AUTHORIZE_TYPE_WRITE,
615
- .params = {
616
- .write = {
617
- .gatt_status = BLE_GATT_STATUS_SUCCESS,
618
- .update = 1 ,
619
- .offset = input_req.offset ,
620
- .len = input_req.len ,
621
- .p_data = input_req.data
614
+ /* .type = */ BLE_GATTS_AUTHORIZE_TYPE_WRITE,
615
+ /* .params = */ {
616
+ /* .write = */ {
617
+ /* .gatt_status = */ BLE_GATT_STATUS_SUCCESS,
618
+ /* .update = */ 1 ,
619
+ /* .offset = */ input_req.offset ,
620
+ /* .len = */ input_req.len ,
621
+ /* .p_data = */ input_req.data
622
622
}
623
623
}
624
624
};
@@ -639,12 +639,12 @@ void nRF5xGattServer::hwCallback(ble_evt_t *p_ble_evt)
639
639
}
640
640
641
641
GattWriteAuthCallbackParams cbParams = {
642
- .connHandle = conn_handle,
643
- .handle = req->attr_handle ,
644
- .offset = req->offset ,
645
- .len = req->length ,
646
- .data = req->data ,
647
- .authorizationReply = AUTH_CALLBACK_REPLY_SUCCESS /* the callback handler must leave this member
642
+ /* .connHandle = */ conn_handle,
643
+ /* .handle = */ req->attr_handle ,
644
+ /* .offset = */ req->offset ,
645
+ /* .len = */ req->length ,
646
+ /* .data = */ req->data ,
647
+ /* .authorizationReply = */ AUTH_CALLBACK_REPLY_SUCCESS /* the callback handler must leave this member
648
648
* set to AUTH_CALLBACK_REPLY_SUCCESS if the client
649
649
* request is to proceed. */
650
650
};
@@ -661,9 +661,9 @@ void nRF5xGattServer::hwCallback(ble_evt_t *p_ble_evt)
661
661
662
662
// FIXME can't use ::write here, this function doesn't take the offset into account ...
663
663
ble_gatts_value_t value = {
664
- .len = req->length ,
665
- .offset = req->offset ,
666
- .p_value = req->data
664
+ /* .len = */ req->length ,
665
+ /* .offset = */ req->offset ,
666
+ /* .p_value = */ req->data
667
667
};
668
668
uint32_t update_err = sd_ble_gatts_value_set (conn_handle, req->attr_handle , &value);
669
669
if (update_err) {
@@ -688,25 +688,25 @@ void nRF5xGattServer::hwCallback(ble_evt_t *p_ble_evt)
688
688
}
689
689
690
690
GattWriteAuthCallbackParams cbParams = {
691
- .connHandle = gattsEventP->conn_handle ,
692
- .handle = handle_value,
693
- .offset = gattsEventP->params .authorize_request .request .write .offset ,
694
- .len = gattsEventP->params .authorize_request .request .write .len ,
695
- .data = gattsEventP->params .authorize_request .request .write .data ,
696
- .authorizationReply = AUTH_CALLBACK_REPLY_SUCCESS /* the callback handler must leave this member
691
+ /* .connHandle = */ gattsEventP->conn_handle ,
692
+ /* .handle = */ handle_value,
693
+ /* .offset = */ gattsEventP->params .authorize_request .request .write .offset ,
694
+ /* .len = */ gattsEventP->params .authorize_request .request .write .len ,
695
+ /* .data = */ gattsEventP->params .authorize_request .request .write .data ,
696
+ /* .authorizationReply = */ AUTH_CALLBACK_REPLY_SUCCESS /* the callback handler must leave this member
697
697
* set to AUTH_CALLBACK_REPLY_SUCCESS if the client
698
698
* request is to proceed. */
699
699
};
700
700
701
701
ble_gatts_rw_authorize_reply_params_t reply = {
702
- .type = BLE_GATTS_AUTHORIZE_TYPE_WRITE,
703
- .params = {
704
- .write = {
705
- .gatt_status = p_characteristics[characteristicIndex]->authorizeWrite (&cbParams),
706
- .update = 1 ,
707
- .offset = cbParams.offset ,
708
- .len = cbParams.len ,
709
- .p_data = cbParams.data
702
+ /* .type = */ BLE_GATTS_AUTHORIZE_TYPE_WRITE,
703
+ /* .params = */ {
704
+ /* .write = */ {
705
+ /* .gatt_status = */ p_characteristics[characteristicIndex]->authorizeWrite (&cbParams),
706
+ /* .update = */ 1 ,
707
+ /* .offset = */ cbParams.offset ,
708
+ /* .len = */ cbParams.len ,
709
+ /* .p_data = */ cbParams.data
710
710
}
711
711
}
712
712
};
@@ -740,21 +740,21 @@ void nRF5xGattServer::hwCallback(ble_evt_t *p_ble_evt)
740
740
}
741
741
case GattServerEvents::GATT_EVENT_READ_AUTHORIZATION_REQ: {
742
742
GattReadAuthCallbackParams cbParams = {
743
- .connHandle = gattsEventP->conn_handle ,
744
- .handle = handle_value,
745
- .offset = gattsEventP->params .authorize_request .request .read .offset ,
746
- .len = 0 ,
747
- .data = NULL ,
748
- .authorizationReply = AUTH_CALLBACK_REPLY_SUCCESS /* the callback handler must leave this member
743
+ /* .connHandle = */ gattsEventP->conn_handle ,
744
+ /* .handle = */ handle_value,
745
+ /* .offset = */ gattsEventP->params .authorize_request .request .read .offset ,
746
+ /* .len = */ 0 ,
747
+ /* .data = */ NULL ,
748
+ /* .authorizationReply = */ AUTH_CALLBACK_REPLY_SUCCESS /* the callback handler must leave this member
749
749
* set to AUTH_CALLBACK_REPLY_SUCCESS if the client
750
750
* request is to proceed. */
751
751
};
752
752
753
753
ble_gatts_rw_authorize_reply_params_t reply = {
754
- .type = BLE_GATTS_AUTHORIZE_TYPE_READ,
755
- .params = {
756
- .read = {
757
- .gatt_status = p_characteristics[characteristicIndex]->authorizeRead (&cbParams)
754
+ /* .type = */ BLE_GATTS_AUTHORIZE_TYPE_READ,
755
+ /* .params = */ {
756
+ /* .read = */ {
757
+ /* .gatt_status = */ p_characteristics[characteristicIndex]->authorizeRead (&cbParams)
758
758
}
759
759
}
760
760
};
0 commit comments