File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
features/FEATURE_BLE/targets/TARGET_CORDIO/source Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -196,22 +196,32 @@ ble_error_t GattServer::insert_characteristic(
196
196
197
197
// Create Characteristic Declaration Attribute
198
198
insert_characteristic_declaration_attribute (characteristic, attribute_it);
199
- insert_characteristic_value_attribute (characteristic, attribute_it);
199
+ ble_error_t err = insert_characteristic_value_attribute (characteristic, attribute_it);
200
+ if (err) {
201
+ return err;
202
+ }
203
+
200
204
201
205
// insert descriptors
202
206
bool cccd_created = false ;
203
207
for (size_t i = 0 ; i < characteristic->getDescriptorCount (); i++) {
204
- insert_descriptor (
208
+ err = insert_descriptor (
205
209
characteristic,
206
210
characteristic->getDescriptor (i),
207
211
attribute_it,
208
212
cccd_created
209
213
);
214
+ if (err) {
215
+ return err;
216
+ }
210
217
}
211
218
212
219
// insert implicit CCCD
213
220
if ((properties & UPDATE_PROPERTIES) && (cccd_created == false )) {
214
- insert_cccd (characteristic, attribute_it);
221
+ err = insert_cccd (characteristic, attribute_it);
222
+ if (err) {
223
+ return err;
224
+ }
215
225
}
216
226
217
227
return BLE_ERROR_NONE;
You can’t perform that action at this time.
0 commit comments