eclipse / mraa

Linux Library for low speed IO Communication in C with bindings for C++, Python, Node.js & Java. Supports generic io platforms, as well as Intel Edison, Intel Joule, Raspberry Pi and many more.

Home Page:http://mraa.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mraa_uart_write(): off by one while writing arrays

ric96 opened this issue · comments

hi,
I have a uint8_t data[256] array.
If I read into it using mraa_uart_read(uart, data, 256); it works fine but if I write from it using mraa_uart_write(uart, data, 256); it seems to write from n-1, ie the first element being -1 and the last being 254.
however if i write from it in a loop like so, it works fine:

for(int i = 0; i < 256; i++)
    {
        mraa_uart_write(uart, &recv_data[i], 1);
    }

sorry for the noise, this behavior doesn't seem consistent so i'll lest it a bit more.