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

Is this the function that sends characters to the application?

I'm working on the UART with BLE application example. I'm trying to see into which struct does the characters entered on the screen gets saved. From the documentation, the function advertising_start() seems the be the one that sends character over. However, when I look at the function

static void advertising_start(void)
{
    uint32_t             err_code;
    ble_gap_adv_params_t adv_params;
    
    // Start advertising.
    memset(&adv_params, 0, sizeof(adv_params));
    
    adv_params.type        = BLE_GAP_ADV_TYPE_ADV_IND;
    adv_params.p_peer_addr = NULL;
    adv_params.fp          = BLE_GAP_ADV_FP_ANY;
    adv_params.interval    = APP_ADV_INTERVAL;
    adv_params.timeout     = APP_ADV_TIMEOUT_IN_SECONDS;

    err_code = sd_ble_gap_adv_start(&adv_params);
    APP_ERROR_CHECK(err_code);

    err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);
    APP_ERROR_CHECK(err_code);
}

I cannot find a variable that is associate "&adv_params" with scanf function. Thus, I want to see whether this function sends characters to the applications? If it does, which of the parameters in the function definition are being used to save characters entered on the screen.

THank you

Parents
  • No that's not the function - that function just advertises the service, after connection the characters are transferred back and forth. If the difference between advertising and connection isn't clear, you should do a little background reading on the various states of a BTLE connection, it helps.

    All the sending/receiving functions are in ble_nus.c

    And there's no sscanf() in the code, characters either come over the UART or they come over the connection from the app running on iOS or android or whatever.

  • Thank you for your response. Could you be a little bit more specific about the "various states of a BTLE connection" ? I have searched for the phrase but wasn't able to find a right website to start from. I would appreciate if you could introduce some websites. Many Regards

Reply Children
No Data
Related