Serial Write multiple consecutive bytes

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
AlexCPU
Posts: 1
Joined: 08 Feb 2017 11:56

Serial Write multiple consecutive bytes

Post 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
User avatar
PoltoS
Posts: 7562
Joined: 26 Jan 2011 19:36

Re: Serial Write multiple consecutive bytes

Post 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)
Post Reply