Skip to content

timzaak/desktop-message

Repository files navigation

desktop message

PC <- deskmsg -> devices, support Rust, C, C++ and Node.js.

deskmsg = mqtt server + http static file server + mdns-sd or ble service discovery.

mqtt server used rmqtt.

mdns-sd used mdns-sd.

ble used btleplug.

how to use it with desktop software

It provides rust static library, C dynamic library and node.js module.

c examples is an example about C to use it.

rust examples is an example about Rust to use it.

electron example is an example about Electron to use it.

USB Serial Communication

For USB serial communication, you can use the usbd-serial crate. It provides a simple and efficient way to communicate with USB serial devices.

To add it to your project, include the following in your Cargo.toml:

[dependencies]
usbd-serial = "0.1.1"

For more details, refer to the usbd-serial documentation.

Building and Using deskmsg_c (for C/C++ Projects)

The deskmsg_c library provides a C-compatible API for the core Rust functionality. It can be integrated into C/C++ projects using CMake.

Prerequisites:

  • Rust (latest stable, with Cargo)
  • CMake (version 3.15 or higher)
  • C compiler (e.g., GCC, Clang, MSVC)

Building deskmsg_c:

  1. Navigate to the deskmsg_c directory.
  2. Run cargo build (for debug build) or cargo build --release (for release build). This will compile the Rust library and generate the C header file (deskmsg_c/include/deskmsg_c.h) and shared library via cbindgen.

Integrating with a C/C++ CMake Project: Refer to examples/c_example of how to link and use the library.

TODO:

  • Release deskmsg_napi to npm
  • Release deskmsg lib to crates.io

About

mqtt + static file http server + service discovery for desktop app, to interact with devices.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published