UART for BLE Mesh Model

Hi Team,

I am working on NRF52832 based on the BLE mesh protocol

here I am using the Light_switch example of SDK - nrf5sdkformeshv500src

Here I need to send the message data that received by Light_switch - Server, to UART.
for that I am not sure but  used to take some funtions like  uart_init() and nus_data_handler from ble_app_uart_coexist example

Here my probllem is

1. what are the funtion need to intergrate from ble_app_uart_coexist example?

uint32_t err_code;
ble_nus_init_t nus_init;

err_code = nrf_ble_qwr_init(&m_qwr, &qwr_init);
APP_ERROR_CHECK(err_code);

// Initialize NUS.
memset(&nus_init, 0, sizeof(nus_init));

nus_init.data_handler = nus_data_handler;

2. where i want to pass the nus_init.data_handler because in ble_app_uart_coexist  example they passed to ble_nus_init


err_code = ble_nus_init(&m_nus, &nus_init);
APP_ERROR_CHECK(err_code);

In my case where i want to pass the &m_nus, &nus_init

3. How to pass the received data to UART?

Thanks in Advance

Best Regards,
Venkatraaman J S.
Parents
  • firstly I am trying to send a custom data to uart like

    int main(void)
    {

    initialize();
    start();
    uart_init();
    uint32_t err_code;

    do
    {
    err_code = app_uart_put('p');
    if ((err_code != NRF_SUCCESS) && (err_code != NRF_ERROR_BUSY))
    {
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- UART initiated successfully -----\n");

    //NRF_LOG_ERROR("Failed receiving NUS message. Error 0x%x. ", err_code);
    APP_ERROR_CHECK(err_code);
    }
    } while (err_code == NRF_ERROR_BUSY);

    in nrf_mesh light_switch example

    But i cant able to see any data in my terminal ( I am using tera term with 115200 baud rate)

    kindly help me

    Best regards

    venkatraaman

Reply
  • firstly I am trying to send a custom data to uart like

    int main(void)
    {

    initialize();
    start();
    uart_init();
    uint32_t err_code;

    do
    {
    err_code = app_uart_put('p');
    if ((err_code != NRF_SUCCESS) && (err_code != NRF_ERROR_BUSY))
    {
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- UART initiated successfully -----\n");

    //NRF_LOG_ERROR("Failed receiving NUS message. Error 0x%x. ", err_code);
    APP_ERROR_CHECK(err_code);
    }
    } while (err_code == NRF_ERROR_BUSY);

    in nrf_mesh light_switch example

    But i cant able to see any data in my terminal ( I am using tera term with 115200 baud rate)

    kindly help me

    Best regards

    venkatraaman

Children
Related