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

at: adapt for isrpipe API type change

This commit is contained in:
Martine Lenders 2019-06-05 18:13:42 +02:00
parent 937d99b5c8
commit 8cf4bc178c

View File

@ -24,13 +24,13 @@
static void _isrpipe_write_one_wrapper(void *_isrpipe, uint8_t data)
{
isrpipe_write_one(_isrpipe, (char)data);
isrpipe_write_one(_isrpipe, data);
}
int at_dev_init(at_dev_t *dev, uart_t uart, uint32_t baudrate, char *buf, size_t bufsize)
{
dev->uart = uart;
isrpipe_init(&dev->isrpipe, buf, bufsize);
isrpipe_init(&dev->isrpipe, (uint8_t *)buf, bufsize);
return uart_init(uart, baudrate, _isrpipe_write_one_wrapper,
&dev->isrpipe);
@ -41,7 +41,7 @@ int at_expect_bytes(at_dev_t *dev, const char *bytes, uint32_t timeout)
while (*bytes) {
char c;
int res;
if ((res = isrpipe_read_timeout(&dev->isrpipe, &c, 1, timeout)) == 1) {
if ((res = isrpipe_read_timeout(&dev->isrpipe, (uint8_t *)&c, 1, timeout)) == 1) {
if (AT_PRINT_INCOMING) {
print(&c, 1);
}
@ -68,7 +68,8 @@ ssize_t at_recv_bytes(at_dev_t *dev, char *bytes, size_t len, uint32_t timeout)
while (len) {
int read_res;
if ((read_res = isrpipe_read_timeout(&dev->isrpipe, resp_pos, 1, timeout)) == 1) {
if ((read_res = isrpipe_read_timeout(&dev->isrpipe, (uint8_t *)resp_pos,
1, timeout)) == 1) {
resp_pos += read_res;
len -= read_res;
}
@ -89,7 +90,7 @@ int at_recv_bytes_until_string(at_dev_t *dev, const char *string,
while (*_string && len < *bytes_len) {
int res;
char c;
if ((res = isrpipe_read_timeout(&dev->isrpipe, &c, 1, timeout)) == 1) {
if ((res = isrpipe_read_timeout(&dev->isrpipe, (uint8_t *)&c, 1, timeout)) == 1) {
if (AT_PRINT_INCOMING) {
print(&c, 1);
}
@ -130,7 +131,7 @@ int at_send_cmd(at_dev_t *dev, const char *command, uint32_t timeout)
void at_drain(at_dev_t *dev)
{
char _tmp[16];
uint8_t _tmp[16];
int res;
do {
@ -288,7 +289,8 @@ ssize_t at_readline(at_dev_t *dev, char *resp_buf, size_t len, bool keep_eol, ui
while (len) {
int read_res;
if ((read_res = isrpipe_read_timeout(&dev->isrpipe, resp_pos, 1, timeout)) == 1) {
if ((read_res = isrpipe_read_timeout(&dev->isrpipe, (uint8_t *)resp_pos,
1, timeout)) == 1) {
if (AT_PRINT_INCOMING) {
print(resp_pos, read_res);
}