Am 21.11.2011 15:41, schrieb Carson Dunbar:
What I am wondering is, what is the relation between dtn::data::Bundle, and dtn::api::Bundle.
dtn::api::Bundle ist just a wrapper for lightweight handling of dtn::data::Bundle. The daemon itself do not work with instances of dtn::api::Bundle. You will need to work with dtn::data::Bundle objects if you want to add new functionality to the daemon.
Since received.bundle is a object of type dtn::data::Bundle you could do exactly what I have written before to get the payload of the bundle.
dtn::data::PayloadBlock &payload = received.bundle.getBlockdtn::data::PayloadBlock();
To get the data itself you need to allocate and lock the stream associated with it...
// get BLOB reference ibrcommon::BLOB::Reference ref = b.getData();
// lock the stream - while we are between the curlies, the stream is locked. { ibrcommon::BLOB::iostream stream = ref.iostream(); [ ... read from / write to the stream .... ] }
Johannes