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

Combine proxy_server and ble_app_blinky_c to work together !

Hello,

I would like to use proxy_server(example of light_switch) and ble_app_blinky_c, to make these two functions work together in one card. So this card can be controlled by proxy_cilent in mesh net-work after it is provisioned , and the order from proxy_client will active the function to illume the LED2 in ble_app_blinky_peripheral.

And the document who introduce the technology of BLE show that : The most important thing to keep in mind with GATT and connections is that connections are exclusive. What is meant by that is that a BLE peripheral can only be connected to one central device (a mobile phone, etc.) at a time!

I have already realized individually each of these two function to work well in the same program. But these two function will cause the conflict when they work together. And I think the problem comes from the event who takes place during the interruption of each function?  These events come from these two functions below?

static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context): from ble_app_blinky_c

static void gatt_evt_handler(const mesh_gatt_evt_t * p_evt, void * p_context): from light_switch_proxy_server

So, I would like to ask if it is possible to make these two functions work together without conflict, If yes, how to do it?

Thank you very much.

Parents
  • Hi Simon, 

     

    You are trying to add a central role into mesh proxy node. So we are talking about 3 roles here, mesh role, proxy (peripheral) role, and central role. They would affect the performance of each other. The question is why do you want to have both proxy role and central role ? Can you simply add the blinky GATT client on the proxy role, just adding the client service into the attribute table. And then use a central that has a blinky server to connect to the proxy node. 

    By theory it's possible to make all three role to works. But you need to fine tune so they don't occupy the timeslot too much. 

    Regarding the event handler, you need to call NRF_SDH_BLE_OBSERVER() to declare it as the ble event handler, same as NRF_SDH_BLE_OBSERVER(m_gatt_obs, NRF_MESH_GATT_BLE_OBSERVER_PRIO, mesh_gatt_on_ble_evt, &m_gatt); in the proxy example 

Reply
  • Hi Simon, 

     

    You are trying to add a central role into mesh proxy node. So we are talking about 3 roles here, mesh role, proxy (peripheral) role, and central role. They would affect the performance of each other. The question is why do you want to have both proxy role and central role ? Can you simply add the blinky GATT client on the proxy role, just adding the client service into the attribute table. And then use a central that has a blinky server to connect to the proxy node. 

    By theory it's possible to make all three role to works. But you need to fine tune so they don't occupy the timeslot too much. 

    Regarding the event handler, you need to call NRF_SDH_BLE_OBSERVER() to declare it as the ble event handler, same as NRF_SDH_BLE_OBSERVER(m_gatt_obs, NRF_MESH_GATT_BLE_OBSERVER_PRIO, mesh_gatt_on_ble_evt, &m_gatt); in the proxy example 

Children
No Data
Related