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

nRF Mesh and uart

hi..... everyone 

I want to send the data from one node  to particular node and that same data should want to print in termite using uart . so i checked the ble_uart coexist example .so how to do this task . in this case which example i should use to pass the data from one to another node .

anyone can explain me clearly how do achieve this ?

Parents Reply Children
  • As per you said client can send a message to server then server print out the message via uart . In this case what you are Mean to message. I have understood message mean like hi hello strings right ? Exactly same thing i wanT to do ... how to Send the message from one node to another and print via uart what function i have to use To pass the string message

  • The message that is sent in the example, is data and not a string. In the light switch example, a message is sent from client to server. You have to add UART to the server node if you want to print out the message.

  • Thanks . Which function is used to pass the data from client to server . 

  • access_model_publish(...) is used to send data from client to server on the access layer. Have a look at this function on the application layer generic_onoff_client_set(...).

  •  here i have set my message , is it correct pls check here

    static void button_event_handler(uint32_t button_number)
    {
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Button %u pressed\n", button_number);
    
        uint32_t status = NRF_SUCCESS;
        generic_onoff_set_params_t set_params;
        model_transition_t transition_params;
        static uint8_t tid = 0;
    
        /* Button 1: On, Button 2: Off, Client[0]
         * Button 2: On, Button 3: Off, Client[1]
         */
     char arr[5] = "code";
     char ara[5] = "set";
     
        switch(button_number)
        {
            case 0:
            case 2:
                set_params.on_off = arr;
                break;
    
            case 1:
            case 3:
                set_params.on_off = Ara;
                break;
        }
    
        set_params.tid = tid++;
        transition_params.delay_ms = APP_CONFIG_ONOFF_DELAY_MS;
        transition_params.transition_time_ms = APP_CONFIG_ONOFF_TRANSITION_TIME_MS;
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Sending msg: ONOFF SET %d\n", set_params.on_off);
    
    
        set_params.tid = tid++;
        transition_params.delay_ms = APP_CONFIG_ONOFF_DELAY_MS;
        transition_params.transition_time_ms = APP_CONFIG_ONOFF_TRANSITION_TIME_MS;
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Sending msg: ONOFF SET %d\n", set_params.on_off);
    

Related