This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to run proxy and Nus at the same time

Hi all, 

when I insert ble_nus into mesh_gatt . I realized there are two pulse functions with the same function: 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void ble_nus_on_ble_evt(ble_evt_t const * p_ble_evt, void * p_context)
{
if ((p_context == NULL) || (p_ble_evt == NULL))
{
return;
}
ble_nus_t * p_nus = (ble_nus_t *)p_context;
switch (p_ble_evt->header.evt_id)
{
case BLE_GAP_EVT_CONNECTED:
on_connect(p_nus, p_ble_evt);
break;
case BLE_GATTS_EVT_WRITE:
on_write(p_nus, p_ble_evt);
break;
case BLE_GATTS_EVT_HVN_TX_COMPLETE:
on_hvx_tx_complete(p_nus, p_ble_evt);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

and 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void mesh_gatt_on_ble_evt(const ble_evt_t * p_ble_evt, void * p_context)
{
switch (p_ble_evt->header.evt_id)
{
case BLE_GAP_EVT_CONNECTED:
connect_evt_handle(p_ble_evt);
break;
case BLE_GAP_EVT_DISCONNECTED:
disconnect_evt_handle(p_ble_evt);
break;
case BLE_GATTS_EVT_WRITE:
write_evt_handle(p_ble_evt);
break;
case BLE_GATTS_EVT_HVN_TX_COMPLETE:
tx_complete_handle(p_ble_evt->evt.gatts_evt.conn_handle);
break;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

if they let them coexist , when I use nrf_connect connect and use mesh_app connect , It jump to 2 function , and I only want , if I connect to nus , it jump to ble_nus_on_ble_evt , If I connect to proxy , It jump to mesh_gatt_on_ble_evt . Is this feasible? Can you give me advice ? Thank !!!