radio_esp8266.c File Reference

library to send data using ESP8266 WiFi SoC (code) More...

Go to the source code of this file.

## Macros

#define | RADIO_ESP8266_USART 2
| USART peripheral.

## Functions

static void | radio_esp8266_transmit (uint8_t *data, uint8_t length)
| transmit data to radio More...
void | radio_esp8266_setup (void)
| setup peripherals to communicate with radio More...
void | radio_esp8266_tcp_open (char *host, uint16_t port)
| establish TCP connection More...
void | radio_esp8266_send (uint8_t *data, uint8_t length)
| send data (requires established connection) More...
void | radio_esp8266_close (void)
| close established connection More...
void USART_ISR() | RADIO_ESP8266_USART (void)
| USART interrupt service routine called when data has been transmitted or received.

## Variables

static uint8_t | rx_buffer [24] = {0}
| buffer for received data (we only expect AT responses)
static volatile uint16_t | rx_used = 0
| number of byte in receive buffer
static uint8_t | tx_buffer [256] = {0}
| buffer for data to transmit
static volatile uint16_t | tx_used = 0
| number of bytes used in transmit buffer
volatile bool | radio_esp8266_activity = false
| a response has been returned by the radio
volatile bool | radio_esp8266_success = false
| the last command has succeeded

## Detailed Description

library to send data using ESP8266 WiFi SoC (code)

Author
  King Kévin kingk.nosp@m.evin.nosp@m.@cuvo.nosp@m.odoo.nosp@m..info

Date
  2016

Note
  peripherals used: USART USART peripheral used for communication with radio

Definition in file radio_esp8266.c.

## Function Documentation

## radio_esp8266_close()

void radio_esp8266_close | ( | void |  | ) |

close established connection

Note
  wait for activity to get success status

Definition at line 142 of file radio_esp8266.c.

## radio_esp8266_send()

void radio_esp8266_send | ( | uint8_t * | data,
|  | uint8_t | length
| ) |  |

send data (requires established connection)

Parameters

  [in] | data | data to send
  [in] | length | size of data to send

Note
  wait for activity to get success status

Definition at line 126 of file radio_esp8266.c.

## radio_esp8266_setup()

void radio_esp8266_setup | ( | void |  | ) |

setup peripherals to communicate with radio

Note
  this is blocking to ensure we are connected to the WiFi network

Definition at line 72 of file radio_esp8266.c.

## radio_esp8266_tcp_open()

void radio_esp8266_tcp_open | ( | char * | host,
|  | uint16_t | port
| ) |  |

establish TCP connection

Parameters

  [in] | host | host to connect to
  [in] | port | TCP port to connect to

Note
  wait for activity to get success status

Definition at line 117 of file radio_esp8266.c.

## radio_esp8266_transmit()

static void radio_esp8266_transmit | ( | uint8_t * | data,
|  | uint8_t | length
| ) |  |

static

transmit data to radio

Parameters

  [in] | data | data to transmit
  [in] | length | length of data to transmit

Definition at line 57 of file radio_esp8266.c.