I want to put the subscribe data in to parameters in C,
and I already publish data and subscribe it which generate by idl.
For the publisher I can put value by " instance -> uploadtime(myparameter) = 20191106(value)"
```
How can I put the value which I subscribe into other field and do other process like the picture?
Attachment | Size |
---|---|
73216821_2579365998822202_7538182798692057088_n.png | 15.84 KB |
Hi Kay Wu,
I would like to confirm what you are trying to do.
Looking at the image you have attached, I think you want to know how you can access the data which is written on the publishing application, on your subscribing application?
There are two APIs to do this read and take. Before calling these APIs you will need to either use a listener, or a waitset, to be notified when there is new data available in your application.
If you haven't already I would suggest looking at a HelloWorld example. You can generate one using the
-example
flag to rtiddsgen (e.g.,rtiddsgen -example -language C ./WaterDispenser.idl
) - after running that command, check the WaterDispenser_subscriber.c file.Sam
Hi Sam,
Thank you very much for answering the question!
I read FooDataReader_take, but I have no idea how to use it,
For
DDS_ReturnCode_t FooDataReader_take ( FooDataReader * self,
struct FooSeq * received_data,
struct DDS_SampleInfoSeq * info_seq,
DDS_Long max_samples,
DDS_SampleStateMask sample_states,
DDS_ViewStateMask view_states,
DDS_InstanceStateMask instance_states
)
Can I ask a question,
where should I put in HelloWorld example and how to get the parameter which I set in .idl file.
I only find example for example : news
Once again, I apologize for the inconvenience.
--Kay