Closed timbo100 closed 4 weeks ago
First of all, you should never use things from the detail
namespace directly. Namespace structure of generated headers is described here. You should use three_arg_msg1::messages::msg1
type.
About size_bytes_checked
, yes, there's a mistake on examples page (they've never been compiled) but if you open its own documentation, you'll see that it has 2 parameters, the second one is the buffer size. Actually, compiler error tells you the same, candidate expects 2 arguments, 1 provided
.
Examples are pretty artificial, their intent is just to provide an overview of how the generated code can be used. It's better to check individual documentation pages or look how they are used in test files.
@OleksandrKvl
I've been trying to put an example together that uses my simple case, but the examples have gaps in explanation, IMO and I would appreciate your help.
I'm following very carefully the example
within one program I'm trying to use my message scheme (3 fields) to encode into buffer and then decode from address and size generated.
============= my Schema ============= My message schema: file: timesmsg1.xml
============= my generated files ============= that were copied into my project three_arg_msg1.zip
============= my test program ============= My message schema: file: msg1.xml
============= compile errors when I uncomment below "// <<<<<< here is where I have a problem compiling" =============
I believe line 46 ...
46: auto r = sbepp::make_const_view<three_arg_msg1::detail::messages::message_1>(addr, msg_size);
is the problem but the examples have gaps and I can't figure what is the proper namespace path and object to put here.Is there another complete example somewhere I can study?
Thanks