Giter VIP home page Giter VIP logo

cyclonedds-rs's Introduction

Sojan James

  • ๐Ÿ”ญ Iโ€™m currently working on building the Sabaton Automotive Software platform
  • ๐Ÿค” Iโ€™m looking for help with improving test-cases for https://github.com/sjames/cyclonedds-rs
  • ๐Ÿ’ฌ Ask me about Sailing in India, Rust programming, C programming, Linux, STM32, FreeRTOS, threadx
  • ๐Ÿ“ซ How to reach me: email, linkedIn, twitter
  • ๐Ÿ˜„ Pronouns: He/him
  • โšก Fun fact:

System and Software Architect for Embedded and Automotive systems, Amateur Radio Enthusiast (VU3CIN) and Sailor in training. An electronics and communication engineer who switched to writing embedded software as a career choice, but keeps in touch with electronics and communication by making it a hobby.

I use my personal github to publish my hobby projects and experiments in the hope that this will be useful for someone.

I'm currently trying to see where all I can program using the Rust programming language. I've taken a year off from the Corporate world to build something new, the Sabaton Platform. See https://developer.sabaton.dev

cyclonedds-rs's People

Contributors

sjames avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cyclonedds-rs's Issues

failed to build

cargo:warning=Iceoryx headers not found
cargo:warning=Iceoryx headers not found

--- stderr
/usr/local/include/dds/ddsi/ddsi_shm_transport.h:24:10: fatal error: 'iceoryx_binding_c/chunk.h' file not found
/usr/local/include/dds/ddsi/ddsi_shm_transport.h:24:10: fatal error: 'iceoryx_binding_c/chunk.h' file not found, err: true
thread 'main' panicked at 'Unable to generate bindings: ()', /home/kong/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclonedds-sys-0.1.6/build.rs:594:14
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

I fixed this by :

sudo ln -sf /usr/local/include/iceoryx/v2.90.0/iceoryx_binding_c /usr/local/include/iceoryx_binding_c

and some more error :
Compiling cyclonedds-sys v0.1.6
Compiling cyclonedds-rs v0.4.7

error[E0609]: no field iox_sizeon typecyclonedds_sys::ddsi_sertype--> src/serdes.rs:129:29 | 129 | sertype.iox_size = std::mem::size_of::<T>() as u32; | ^^^^^^^^ unknown field | = note: available fields are:ops, serdata_ops, serdata_basehash, _bitfield_1, allowed_data_representation` ... and 5 others

error[E0609]: no field iox_subscriber on type cyclonedds_sys::ddsi_serdata
--> src/serdes.rs:677:25
|
677 | if !serdata.serdata.iox_subscriber.is_null() {
| ^^^^^^^^^^^^^^ unknown field
|
= note: available fields are: ops, hash, refc, kind, type_ ... and 3 others

error[E0609]: no field iox_subscriber on type cyclonedds_sys::ddsi_serdata
--> src/serdes.rs:678:62
|
678 | let iox_subscriber: *mut iox_sub_t = serdata.serdata.iox_subscriber as *mut iox_sub_t;
| ^^^^^^^^^^^^^^ unknown field
|
= note: available fields are: ops, hash, refc, kind, type_ ... and 3 others

error[E0609]: no field iox_chunk on type cyclonedds_sys::ddsi_serdata
--> src/serdes.rs:679:42
|
679 | let chunk = &mut serdata.serdata.iox_chunk;
| ^^^^^^^^^ unknown field
|
= note: available fields are: ops, hash, refc, kind, type_ ... and 3 others

error[E0609]: no field iox_chunk on type cyclonedds_sys::ddsi_serdata
--> src/serdes.rs:883:35
|
883 | let ret = if !serdata.serdata.iox_chunk.is_null() {
| ^^^^^^^^^ unknown field
|
= note: available fields are: ops, hash, refc, kind, type_ ... and 3 others

error[E0609]: no field iox_chunk on type cyclonedds_sys::ddsi_serdata
--> src/serdes.rs:885:61
|
885 | let hdr = iceoryx_header_from_chunk(serdata.serdata.iox_chunk);
| ^^^^^^^^^ unknown field
|
= note: available fields are: ops, hash, refc, kind, type_ ... and 3 others

error[E0609]: no field iox_chunk on type cyclonedds_sys::ddsi_serdata
--> src/serdes.rs:888:70
|
888 | let reader = std::slice::from_raw_parts(serdata.serdata.iox_chunk as *const u8, (*hdr).data_size as usize);
| ^^^^^^^^^ unknown field
|
= note: available fields are: ops, hash, refc, kind, type_ ... and 3 others`

I am not sure if my version is right.

Thanks

Instance (keyed data types) support

I notice there are no references to register_instance in this library. Are instances (and instance handles) supported by this wrapper currently? Specifically "deleting" a sample from the DDS data space (dispose_instance_handle).

I notice in dds_derive we have:

fn is_key(field : &Field) -> bool {
    for attr in &field.attrs {
        if let Some(ident) = attr.path.get_ident() {
            if ident == "topic_key" || ident == "topic_key_enum"{
                return true
            }
        } 
    }
    false
}

implying that they might be supported for well-known field names only. If that's the case, is there any way to customize serialized field names? Which is relevant for hashed autoid field names

Build problem on debian docker

When i build on a debian docker container i get the following errors

_Compiling cyclonedds-sys v0.1.2 (/workspaces/positiondetection/tmp/cyclonedds-sys)
Compiling cyclonedds-rs v0.3.1 (/workspaces/positiondetection/tmp/cyclonedds-rs)
error[E0560]: struct cyclonedds_sys::ddsi_sertype_ops has no field named typeid_hash
--> /workspaces/positiondetection/tmp/cyclonedds-rs/src/serdes.rs:777:9
|
777 | typeid_hash: None,
| ^^^^^^^^^^^ cyclonedds_sys::ddsi_sertype_ops does not have this field
|
= note: available fields are: version, arg, free, zero_samples, realloc_samples ... and 10 others

error[E0560]: struct cyclonedds_sys::ddsi_sertype_ops has no field named serialized_size
--> /workspaces/positiondetection/tmp/cyclonedds-rs/src/serdes.rs:778:9
|
778 | serialized_size: None,
| ^^^^^^^^^^^^^^^ help: a field with a similar name exists: get_serialized_size

error[E0560]: struct cyclonedds_sys::ddsi_sertype_ops has no field named serialize
--> /workspaces/positiondetection/tmp/cyclonedds-rs/src/serdes.rs:779:9
|
779 | serialize: None,
| ^^^^^^^^^ cyclonedds_sys::ddsi_sertype_ops does not have this field
|
= note: available fields are: version, arg, free, zero_samples, realloc_samples ... and 10 others

error[E0560]: struct cyclonedds_sys::ddsi_sertype_ops has no field named deserialize
--> /workspaces/positiondetection/tmp/cyclonedds-rs/src/serdes.rs:780:9
|
780 | deserialize: None,
| ^^^^^^^^^^^ cyclonedds_sys::ddsi_sertype_ops does not have this field
|
= note: available fields are: version, arg, free, zero_samples, realloc_samples ... and 10 others

When i do a small local fix of the 4 points above i get the following error:

Compiling cyclonedds-sys v0.1.2 (/workspaces/positiondetection/tmp/cyclonedds-sys)
Compiling cyclonedds-rs v0.3.1 (/workspaces/positiondetection/tmp/cyclonedds-rs)
error[E0063]: missing fields derive_sertype, get_serialized_size, serialize_into and 3 other fields in initializer of cyclonedds_sys::ddsi_sertype_ops
--> /workspaces/positiondetection/tmp/cyclonedds-rs/src/serdes.rs:768:14
|
768 | Box::new(ddsi_sertype_ops {
| ^^^^^^^^^^^^^^^^ missing derive_sertype, get_serialized_size, serialize_into and 3 other fields_

Performance and comparison

Hi Sojan, have you run some comparison with RustDDS and FastDDS?
How about compatibility and completeness wrt the open standard?

Thanks

failed to build, version mismatch

Compiling cyclonedds-sys v0.2.1
Compiling cyclonedds-rs v0.6.5
error[E0609]: no field iox_size on type cyclonedds_sys::ddsi_sertype
--> /home/usr/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclonedds-rs-0.6.5/src/serdes.rs:126:29
|
126 | sertype.iox_size = std::mem::size_of::() as u32;
| ^^^^^^^^ unknown field
|
= note: available fields are: ops, serdata_ops, serdata_basehash, _bitfield_1, allowed_data_representation ... and 5 others

error[E0609]: no field iox_subscriber on type cyclonedds_sys::ddsi_serdata
--> /home/usr/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclonedds-rs-0.6.5/src/serdes.rs:687:25
|
687 | if !serdata.serdata.iox_subscriber.is_null() {
| ^^^^^^^^^^^^^^ unknown field
|
= note: available fields are: ops, hash, refc, kind, type_ ... and 3 others

error[E0609]: no field iox_subscriber on type cyclonedds_sys::ddsi_serdata
--> /home/usr/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclonedds-rs-0.6.5/src/serdes.rs:688:62
|
688 | ...t = serdata.serdata.iox_subscriber as *mut iox_sub_t;
| ^^^^^^^^^^^^^^ unknown field
|
= note: available fields are: ops, hash, refc, kind, type_ ... and 3 others

error[E0609]: no field iox_chunk on type cyclonedds_sys::ddsi_serdata
--> /home/usr/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclonedds-rs-0.6.5/src/serdes.rs:689:42
|
689 | let chunk = &mut serdata.serdata.iox_chunk;
| ^^^^^^^^^ unknown field
|
= note: available fields are: ops, hash, refc, kind, type_ ... and 3 others

...

...
error[E0560]: struct cyclonedds_sys::ddsi_serdata_ops has no field named from_iox_buffer
--> /home/usr/.cargo/registry/src/github.com-1ecc6299db9ec823/cyclonedds-rs-0.6.5/src/serdes.rs:1140:9
|
1140 | from_iox_buffer: Some(from_iox_buffer::),
| ^^^^^^^^^^^^^^^ cyclonedds_sys::ddsi_serdata_ops does not have this field
|
= note: available fields are: eqkey, get_size, from_ser, from_ser_iov, from_keyhash ... and 10 others

Some errors have detailed explanations: E0560, E0609.
For more information about an error, try rustc --explain E0560.
error: could not compile cyclonedds-rs due to 14 previous errors

I am not sure where the version mismatch comes from. Do the versions of cyclonedds-rs (v0.6.5) and cyclonedds-sys (v0.2.1) from crates.io (used here) match the latest code pushed to github? The latest code pushed to github cyclonedds-sys seems to have the missing fields.

Thanks!
Best regards,
Franzi

Build errors for 32bit target

When building on Raspberry PI with the standard (Raspberry Pi OS with desktop) i get the following errors:

Compiling cdds_derive v0.1.0 (/home/pi/Documents/cyclonedds-rs/dds_derive)
Compiling thiserror v1.0.30
Compiling cyclonedds-sys v0.1.2 (/home/pi/Documents/cyclonedds-sys)
Compiling cyclonedds-rs v0.3.1 (/home/pi/Documents/cyclonedds-rs)
error[E0308]: mismatched types
--> src/dds_reader.rs:207:73
|
207 | dds_take(entity.entity(), voidpp , info_ptr as *mut _, buf.len() as u64, buf.len() as u32)
| ^^^^^^^^^^^^^^^^ expected u32, found u64
|
help: you can convert a u64 to a u32 and panic if the converted value doesn't fit
|
207 | dds_take(entity.entity(), voidpp , info_ptr as *mut _, (buf.len() as u64).try_into().unwrap(), buf.len() as u32)
| + +++++++++++++++++++++

error[E0308]: mismatched types
--> src/dds_reader.rs:209:73
|
209 | dds_read(entity.entity(), voidpp , info_ptr as *mut _, buf.len() as u64, buf.len() as u32)
| ^^^^^^^^^^^^^^^^ expected u32, found u64
|
help: you can convert a u64 to a u32 and panic if the converted value doesn't fit
|
209 | dds_read(entity.entity(), voidpp , info_ptr as *mut _, (buf.len() as u64).try_into().unwrap(), buf.len() as u32)
| + +++++++++++++++++++++

error[E0308]: mismatched types
--> src/dds_waitset.rs:80:17
|
80 | capacity as u64,
| ^^^^^^^^^^^^^^^ expected u32, found u64
|
help: you can convert a u64 to a u32 and panic if the converted value doesn't fit
|
80 | (capacity as u64).try_into().unwrap(),
| + +++++++++++++++++++++

error[E0308]: mismatched types
--> src/serdes.rs:635:27
|
635 | iov.iov_len = serdata.key_hash.len() as u64;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u32, found u64

error[E0308]: mismatched types
--> src/serdes.rs:663:31
|
663 | iov.iov_len = cdr.len() as u64;
| ^^^^^^^^^^^^^^^^ expected u32, found u64

error[E0308]: mismatched types
--> src/serdes.rs:773:28
|
773 | zero_samples: Some(zero_samples::),
| ^^^^^^^^^^^^^^^^^ expected u32, found u64
|
= note: expected fn pointer unsafe extern "C" fn(_, _, u32)
found fn item unsafe extern "C" fn(_, _, u64) {zero_samples::<T>}

error[E0308]: mismatched types
--> src/serdes.rs:774:31
|
774 | realloc_samples: Some(realloc_samples::),
| ^^^^^^^^^^^^^^^^^^^^ expected u32, found u64
|
= note: expected fn pointer unsafe extern "C" fn(_, _, _, u32, u32)
found fn item extern "C" fn(_, _, _, u64, u64) {realloc_samples::<T>}

error[E0308]: mismatched types
--> src/serdes.rs:775:28
|
775 | free_samples: Some(free_samples::),
| ^^^^^^^^^^^^^^^^^ expected u32, found u64
|
= note: expected fn pointer unsafe extern "C" fn(_, _, u32, _)
found fn item extern "C" fn(_, _, u64, _) {free_samples::<T>}

error[E0560]: struct cyclonedds_sys::ddsi_sertype_ops has no field named typeid_hash
--> src/serdes.rs:778:9
|
778 | typeid_hash: None,
| ^^^^^^^^^^^ cyclonedds_sys::ddsi_sertype_ops does not have this field
|
= note: available fields are: version, arg, free, zero_samples, realloc_samples ... and 10 others

error[E0560]: struct cyclonedds_sys::ddsi_sertype_ops has no field named serialized_size
--> src/serdes.rs:779:9
|
779 | serialized_size: None,
| ^^^^^^^^^^^^^^^ help: a field with a similar name exists: get_serialized_size

error[E0560]: struct cyclonedds_sys::ddsi_sertype_ops has no field named serialize
--> src/serdes.rs:780:9
|
780 | serialize: None,
| ^^^^^^^^^ cyclonedds_sys::ddsi_sertype_ops does not have this field
|
= note: available fields are: version, arg, free, zero_samples, realloc_samples ... and 10 others

error[E0560]: struct cyclonedds_sys::ddsi_sertype_ops has no field named deserialize
--> src/serdes.rs:781:9
|
781 | deserialize: None,
| ^^^^^^^^^^^ cyclonedds_sys::ddsi_sertype_ops does not have this field
|
= note: available fields are: version, arg, free, zero_samples, realloc_samples ... and 10 others

error[E0308]: mismatched types
--> src/serdes.rs:793:24
|
793 | from_ser: Some(serdata_from_fragchain::),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u32, found u64
|
= note: expected fn pointer unsafe extern "C" fn(_, _, _, u32) -> _
found fn item unsafe extern "C" fn(_, _, _, u64) -> _ {serdata_from_fragchain::<T>}

error[E0308]: mismatched types
--> src/serdes.rs:794:28
|
794 | from_ser_iov: Some(serdata_from_iov::),
| ^^^^^^^^^^^^^^^^^^^^^ expected u32, found u64
|
= note: expected fn pointer unsafe extern "C" fn(_, _, u32, _, u32) -> _
found fn item unsafe extern "C" fn(_, _, u64, _, u64) -> _ {serdata_from_iov::<T>}

error[E0308]: mismatched types
--> src/serdes.rs:797:22
|
797 | to_ser: Some(serdata_to_ser::),
| ^^^^^^^^^^^^^^^^^^^ expected u32, found u64
|
= note: expected fn pointer unsafe extern "C" fn(_, u32, u32, _)
found fn item unsafe extern "C" fn(_, u64, u64, _) {serdata_to_ser::<T>}

error[E0308]: mismatched types
--> src/serdes.rs:798:26
|
798 | to_ser_ref: Some(serdata_to_ser_ref::),
| ^^^^^^^^^^^^^^^^^^^^^^^ expected u32, found u64
|
= note: expected fn pointer unsafe extern "C" fn(_, u32, u32, _) -> _
found fn item unsafe extern "C" fn(_, u64, u64, _) -> _ {serdata_to_ser_ref::<T>}

error[E0308]: mismatched types
--> src/serdes.rs:804:21
|
804 | print: Some(print::),
| ^^^^^^^^^^ expected u32, found u64
|
= note: expected fn pointer unsafe extern "C" fn(_, _, _, u32) -> u32
found fn item unsafe extern "C" fn(_, _, _, u64) -> u64 {print::<T>}

Some errors have detailed explanations: E0308, E0560.
For more information about an error, try rustc --explain E0308.
error: could not compile cyclonedds-rs due to 17 previous errors
pi@raspberrypi:~/Documents/cyclonedds-rs $

Error in cargo build of the example

Hello when building the example publisher and subscriber I have the error:

--- stderr
Cloning into 'cyclonedds'...
CMake Warning at src/CMakeLists.txt:99 (message):
Copying deprecated ENABLE_SHM setting into ENABLE_ICEORYX

wrapper.h:4:10: fatal error: 'dds/ddsi/q_radmin.h' file not found
wrapper.h:4:10: fatal error: 'dds/ddsi/q_radmin.h' file not found, err: true
thread 'main' panicked at /home/pier/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cyclonedds-sys-0.2.1/build.rs:622:14:
Unable to generate bindings: ()
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.