35 lines
1.1 KiB
C
35 lines
1.1 KiB
C
/** library to send data using ESP8266 WiFi SoC (API)
|
|
* @file
|
|
* @author King Kévin <kingkevin@cuvoodoo.info>
|
|
* @copyright SPDX-License-Identifier: GPL-3.0-or-later
|
|
* @date 2016
|
|
* @note peripherals used: USART @ref radio_esp8266_usart
|
|
*/
|
|
#pragma once
|
|
|
|
/** a response has been returned by the radio */
|
|
extern volatile bool radio_esp8266_activity;
|
|
/** the last command has succeeded */
|
|
extern volatile bool radio_esp8266_success;
|
|
|
|
/** setup peripherals to communicate with radio
|
|
* @note this is blocking to ensure we are connected to the WiFi network
|
|
*/
|
|
void radio_esp8266_setup(void);
|
|
/** establish TCP connection
|
|
* @param[in] host host to connect to
|
|
* @param[in] port TCP port to connect to
|
|
* @note wait for activity to get success status
|
|
*/
|
|
void radio_esp8266_tcp_open(char* host, uint16_t port);
|
|
/** send data (requires established connection)
|
|
* @param[in] data data to send
|
|
* @param[in] length size of data to send
|
|
* @note wait for activity to get success status
|
|
*/
|
|
void radio_esp8266_send(uint8_t* data, uint8_t length);
|
|
/** close established connection
|
|
* @note wait for activity to get success status
|
|
*/
|
|
void radio_esp8266_close(void);
|