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

Nordic SDK Central and peripheral Uart Service

Hello.

I am about to receive the Uart service for the Nordic SDK Central and peripheral.

I Use nrf 52832.

In the peripheral example, we used 'ble_nus_data_send'.fuction.

However, the function Ble_nus_data_send is missing in central and peripheral.


Let me know if you know a similar function or another way.

Parents
  • SDK v15.3.0

    Central - in ble_nus_c.h:

    /**@brief Function for sending a string to the server.
     *
     * @details This function writes the RX characteristic of the server.
     *
     * @param[in] p_ble_nus_c Pointer to the NUS client structure.
     * @param[in] p_string    String to be sent.
     * @param[in] length      Length of the string.
     *
     * @retval NRF_SUCCESS If the string was sent successfully. Otherwise, an error code is returned.
     */
    uint32_t ble_nus_c_string_send(ble_nus_c_t * p_ble_nus_c, uint8_t * p_string, uint16_t length);

    don't be put off by the "string" in the name; that's misleading - it actually just sends any arbitrary data.

    https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_nus_c.html

    Peripheral - in ble_nus.h:

    /**@brief   Function for sending a data to the peer.
     *
     * @details This function sends the input string as an RX characteristic notification to the
     *          peer.
     *
     * @param[in]     p_nus       Pointer to the Nordic UART Service structure.
     * @param[in]     p_data      String to be sent.
     * @param[in,out] p_length    Pointer Length of the string. Amount of sent bytes.
     * @param[in]     conn_handle Connection Handle of the destination client.
     *
     * @retval NRF_SUCCESS If the string was sent successfully. Otherwise, an error code is returned.
     */
    uint32_t ble_nus_data_send(ble_nus_t * p_nus,
                               uint8_t   * p_data,
                               uint16_t  * p_length,
                               uint16_t    conn_handle);

    https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_nus_eval.html

Reply
  • SDK v15.3.0

    Central - in ble_nus_c.h:

    /**@brief Function for sending a string to the server.
     *
     * @details This function writes the RX characteristic of the server.
     *
     * @param[in] p_ble_nus_c Pointer to the NUS client structure.
     * @param[in] p_string    String to be sent.
     * @param[in] length      Length of the string.
     *
     * @retval NRF_SUCCESS If the string was sent successfully. Otherwise, an error code is returned.
     */
    uint32_t ble_nus_c_string_send(ble_nus_c_t * p_ble_nus_c, uint8_t * p_string, uint16_t length);

    don't be put off by the "string" in the name; that's misleading - it actually just sends any arbitrary data.

    https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_nus_c.html

    Peripheral - in ble_nus.h:

    /**@brief   Function for sending a data to the peer.
     *
     * @details This function sends the input string as an RX characteristic notification to the
     *          peer.
     *
     * @param[in]     p_nus       Pointer to the Nordic UART Service structure.
     * @param[in]     p_data      String to be sent.
     * @param[in,out] p_length    Pointer Length of the string. Amount of sent bytes.
     * @param[in]     conn_handle Connection Handle of the destination client.
     *
     * @retval NRF_SUCCESS If the string was sent successfully. Otherwise, an error code is returned.
     */
    uint32_t ble_nus_data_send(ble_nus_t * p_nus,
                               uint8_t   * p_data,
                               uint16_t  * p_length,
                               uint16_t    conn_handle);

    https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_nus_eval.html

Children
No Data
Related