SumeetSingh19 commented on code in PR #1426: URL: https://github.com/apache/mynewt-nimble/pull/1426#discussion_r1149006790
########## nimble/host/src/ble_gattc.c: ########## @@ -4212,6 +4223,61 @@ ble_gatts_notify_custom(uint16_t conn_handle, uint16_t chr_val_handle, return rc; } +int +ble_gatts_multi_notify_custom(uint16_t conn_handle, uint16_t * att_handles, + struct os_mbuf ** notif_values, uint16_t num_handles) +{ +#if !MYNEWT_VAL(BLE_GATT_MULTI_NOTIFY) + return BLE_HS_ENOTSUP; +#endif + + int i; + int rc; + + STATS_INC(ble_gattc_stats, multi_notify); + ble_gattc_log_multi_notify(att_handles, num_handles); + + for (i = 0; i < num_handles; i++) { + if (notif_values[i] == NULL) { + /* No custom attribute data; read the value from the specified + * attribute + */ + notif_values[i] = ble_hs_mbuf_att_pkt(); + if (notif_values[i] == NULL) { + rc = BLE_HS_ENOMEM; + goto done; + } + rc = ble_att_svr_read_handle(BLE_HS_CONN_HANDLE_NONE, + att_handles[i], 0, notif_values[i], NULL); + if (rc != 0) { + /* Fatal error; application disallowed attribute read. */ + rc = BLE_HS_EAPP; + goto done; + } + } + } + + rc = ble_att_clt_tx_multi_notify(conn_handle, att_handles, + notif_values, num_handles); + if (rc != 0) { Review Comment: Check is removed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org