Page 1 of 1

Serial Write multiple consecutive bytes

Posted: 08 Feb 2017 12:05
by AlexCPU
Hi,

I've got a couple of questions about the serial UART of Z-Uno.

Firstly, how do I set the number of stop bits? Or as a minimum, what is it hard-coded to?

The serial write documentation (here: https://z-uno.z-wave.me/Reference/Serial/write/), states that the command takes a parameter 'val' which is a value to send as a single byte, however the serial write command returns the number of bytes written. Either this is always one, as it only accepts single bytes as an input, or the documentation doesn't include how to send multiple bytes.

Is there a way of sending multiple bytes? The Print(ln) commands are not what I am looking for as my data is binary, and should not be sent as ASCII.

Many thanks,
Alex

Re: Serial Write multiple consecutive bytes

Posted: 14 Feb 2017 02:21
by PoltoS
Indeed, it always returns 1. Please check here: https://github.com/Z-Wave-Me/Z-Uno-Core ... al.cpp#L85

You can make another C++ overload similiar to this:
https://github.com/Z-Wave-Me/Z-Uno-Core ... nt.cpp#L51 (except that instead of checking for \0 pass second parameter: length)