Homepage GitHub

Union in Request


#1

Hi!

Perhaps I misunderstood the specification, but is it allowed to use union directly in a service request as follows:

# My servcie

@union

uint8 value1
uint16 value2
MyType value3

---

uint8 RespCode

If this is possible, how do I setup the Request Tag?

Or do I have to up the union inside its own type as in uavcan Value type used in GetSet servcie?

Kind Regards


#2

As a try to answer my own question, is this corrent?

MyServcie::Request reg;
uint16 new_value = 47;
req.to<MyServcie::Request::Tag::Type::value2>() = new_value;

?


(Pavel Kirienko) #3

Yes.

Yes.


#4

Sweet!

Thanks