1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/at: make EOL char configurable

This commit is contained in:
Vincent Dupont 2017-07-13 18:43:42 +02:00 committed by Kaspar Schleiser
parent 9c9fad6da5
commit ee29b76c89
2 changed files with 7 additions and 2 deletions

View File

@ -59,13 +59,13 @@ int at_send_cmd(at_dev_t *dev, const char *command, uint32_t timeout)
unsigned cmdlen = strlen(command);
uart_write(dev->uart, (const uint8_t *)command, cmdlen);
uart_write(dev->uart, (const uint8_t *)"\n", 1);
uart_write(dev->uart, (const uint8_t *)AT_END_OF_LINE, sizeof(AT_END_OF_LINE) - 1);
if (at_expect_bytes(dev, command, cmdlen, timeout)) {
return -1;
}
if (at_expect_bytes(dev, "\r\n", 2, timeout)) {
if (at_expect_bytes(dev, AT_END_OF_LINE "\r\n", sizeof(AT_END_OF_LINE) + 1, timeout)) {
return -2;
}

View File

@ -42,6 +42,11 @@
extern "C" {
#endif
#ifndef AT_END_OF_LINE
/** End of line character to send after the AT command */
#define AT_END_OF_LINE "\r"
#endif
/**
* @brief AT device structure
*/