esp8266: minor, improve API

This commit is contained in:
King Kévin 2021-09-15 18:35:28 +02:00
parent 017c649842
commit 8bd98693f6
2 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ volatile bool radio_esp8266_success = false;
* @param[in] data data to transmit
* @param[in] length length of data to transmit
*/
static void radio_esp8266_transmit(uint8_t* data, uint8_t length) {
static void radio_esp8266_transmit(const uint8_t* data, uint8_t length) {
while (tx_used || !usart_get_flag(USART(RADIO_ESP8266_USART), USART_SR_TXE)) { // wait until ongoing transmission completed
usart_enable_tx_interrupt(USART(RADIO_ESP8266_USART)); // enable transmit interrupt
__WFI(); // sleep until something happened
@ -116,7 +116,7 @@ void radio_esp8266_open(const char* host, uint16_t port, bool tcp)
}
}
void radio_esp8266_send(uint8_t* data, uint8_t length)
void radio_esp8266_send(const uint8_t* data, uint8_t length)
{
char command[16 + 1] = {0}; // string to create command
int command_length = snprintf(command, LENGTH(command), "AT+CIPSEND=%u\r\n", length); // create AT command to send data

View File

@ -28,7 +28,7 @@ void radio_esp8266_open(const char* host, uint16_t port, bool tcp);
* @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);
void radio_esp8266_send(const uint8_t* data, uint8_t length);
/** close established connection
* @note wait for activity to get success status
*/