I make some project to using nRF52833 by CPP.
I need to add NUS(Nordic Uart Service) in my project. But I have some problem.
Nrf library NUS using ble_nus.c file. I try to build by CPP compiler but some error occur.
Error message is this. Error[Pe167]: argument of type "void *" is incompatible with parameter of type "void **" C:\git\heden_ble\src\components\ble\ble_services\ble_nus\ble_nus.c 139
ble_nus.c file has four error points.
How can I casting void * to void **
ble_nus_client_context_t * p_client = NULL;
err_code = blcm_link_ctx_get(p_nus->p_link_ctx_storage, p_ble_evt->evt.gap_evt.conn_handle, (void *) &p_client);
ret_code_t blcm_link_ctx_get(blcm_link_ctx_storage_t const * const p_link_ctx_storage, uint16_t const conn_handle, void ** const pp_ctx_data)
Using CPP static_cast, reinterpret_cast. I expect to build ble_nus.c
p_clientis already a pointer. When you takes it address, e.g.&p_clientthe type isble_nus_client_context_t**. Your cast with(void *) &p_clientis casting tovoid*(legal in C), notble_nus_client_context_t**- so you must account for the additional level of indirection when you cast back fromvoid*.ble_nus_client_context_t**? Or is that an alias?ble_nus.c. Please provide A Minimal Complete Reproducable Example to help clear up the confusion.