UART to SPP bridge: how to send data from UART to SPP?
Posted: Wed Apr 25, 2018 7:44 am
Hi,
I need to exchange data from PC (by UART) to smartphone over SPP.
Data from UARTmust be send to SPP and SSP data to UART.
Rout SPP-> UART works fine (thanks to loboris for assist ), but I have trouble with handling esp_spp_write function in route UART -> SPP.
Here is prototype:
I'm not sure which arguments I should send to esp_spp_write in case it is calling in custom functions (not from esp_spp_cb):
Is it corret way to send data outside of spp callbacks?
I need to exchange data from PC (by UART) to smartphone over SPP.
Data from UARTmust be send to SPP and SSP data to UART.
Rout SPP-> UART works fine (thanks to loboris for assist ), but I have trouble with handling esp_spp_write function in route UART -> SPP.
Here is prototype:
Code: Select all
/**
* @brief This function closes an SPP connection.
*
* @param[in] handle: The connection handle.
* @param[in] len: The length of the data written.
* @param[in] p_data: The data written.
*
* @return
* - ESP_OK: success
* - other: failed
*/
esp_err_t esp_spp_write(uint32_t handle, int len, uint8_t *p_data);
Code: Select all
void custom_UART_to_SPP_write(???)
{
//prepare data to MyData structure
// ...
esp_spp_write(???, MyData.UART_data_len, MyData.UART_buffer);
}