diff --git a/README.md b/README.md index 9dbe0089..96854af7 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ First, you need to install [libusb][libusb-url] to communicate with `U3V` camera ```toml [dependencies] -cameleon = { version = 0.1, features = 'libusb'} +cameleon = { version = 0.1, features = 'libusb' } ``` You can enumerate all cameras connected to the host, and start streaming. @@ -59,8 +59,8 @@ camera.open().unwrap(); // Loads `GenApi` context. This is necessary for streaming. camera.load_context().unwrap(); -// Start streaming. -let payload_rx = camera.start_streaming(10).unwrap(); +// Start streaming. Channel capacity is set to 3. +let payload_rx = camera.start_streaming(3).unwrap(); let mut payload_count = 0; while payload_count < 10 { diff --git a/cameleon/Cargo.toml b/cameleon/Cargo.toml index 3669d3db..e0605b5f 100644 --- a/cameleon/Cargo.toml +++ b/cameleon/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cameleon" -version = "0.1.1" +version = "0.1.2" authors = ["Cameleon Project Developers"] edition = "2018" license = "MPL-2.0" @@ -24,7 +24,7 @@ async-std = { version = "1.9.0", features = ["unstable"] } futures = "0.3.14" tracing = "0.1.26" auto_impl = "0.4.1" -cameleon-device = { path = "../device", version = "0.1.0" } +cameleon-device = { path = "../device", version = "0.1.1" } cameleon-genapi = { path = "../genapi", version = "0.1.0" } rusb = { version = "0.8.1", optional = true } libusb1-sys = { version = "0.5.0", optional = true } diff --git a/cameleon/README.md b/cameleon/README.md index 569b5481..eb857204 100644 --- a/cameleon/README.md +++ b/cameleon/README.md @@ -59,8 +59,8 @@ camera.open().unwrap(); // Loads `GenApi` context. This is necessary for streaming. camera.load_context().unwrap(); -// Start streaming. -let payload_rx = camera.start_streaming(10).unwrap(); +// Start streaming. Channel capacity is set to 3. +let payload_rx = camera.start_streaming(3).unwrap(); let mut payload_count = 0; while payload_count < 10 { diff --git a/cameleon/examples/README.md b/cameleon/examples/README.md index f58a5873..5f26e8b8 100644 --- a/cameleon/examples/README.md +++ b/cameleon/examples/README.md @@ -1,7 +1,7 @@ # Examples ## [stream.rs](stream.rs) -Describes how to start streaming and reeceive payloads. +Describes how to start streaming and receive payloads. ```sh cargo run --example stream --features=libusb diff --git a/cameleon/examples/stream.rs b/cameleon/examples/stream.rs index eb5c926c..1e0d8001 100644 --- a/cameleon/examples/stream.rs +++ b/cameleon/examples/stream.rs @@ -22,8 +22,9 @@ fn main() { // Load `GenApi` context. camera.load_context().unwrap(); - // Start streaming. - let payload_rx = camera.start_streaming(10).unwrap(); + // Start streaming. Channel capacity is set to 3. + let payload_rx = camera.start_streaming(3).unwrap(); + let mut payload_count = 0; while payload_count < 10 { match payload_rx.try_recv() { diff --git a/cameleon/examples/u3v/README.md b/cameleon/examples/u3v/README.md new file mode 100644 index 00000000..69be810f --- /dev/null +++ b/cameleon/examples/u3v/README.md @@ -0,0 +1,8 @@ +# Examples + +## [register_map](register_mapl.rs) +Describes how to read/write `U3V` camera's specific registers. + +```sh +cargo run --example u3v_register_map --features=libusb +``` diff --git a/cameleon/examples/u3v/register_map.rs b/cameleon/examples/u3v/register_map.rs index 0fba88fd..18231e02 100644 --- a/cameleon/examples/u3v/register_map.rs +++ b/cameleon/examples/u3v/register_map.rs @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +//! This example describes how to read/write `U3V` camera's specific registers. + use cameleon::u3v::enumerate_cameras; fn main() { @@ -89,7 +91,7 @@ fn main() { // // Read SBRM. - println!("\n### Technology Specifig Boot Register Map ###\n"); + println!("\n### Technology Specific Boot Register Map ###\n"); let sbrm = ctrl.sbrm().unwrap(); println!("u3v_version: {}", sbrm.u3v_version(ctrl).unwrap()); diff --git a/cameleon/src/camera.rs b/cameleon/src/camera.rs index 954335cb..6d1c79d7 100644 --- a/cameleon/src/camera.rs +++ b/cameleon/src/camera.rs @@ -24,8 +24,8 @@ //! // Loads `GenApi` context. This is necessary for streaming. //! camera.load_context().unwrap(); //! -//! // Start streaming. -//! let payload_rx = camera.start_streaming(10).unwrap(); +//! // Start streaming. Channel capacity is set to 3. +//! let payload_rx = camera.start_streaming(3).unwrap(); //! //! let mut payload_count = 0; //! while payload_count < 10 { @@ -85,8 +85,8 @@ use super::{ /// // Loads `GenApi` context. This is necessary for streaming. /// camera.load_context().unwrap(); /// -/// // Start streaming. -/// let payload_rx = camera.start_streaming(10).unwrap(); +/// // Start streaming. Channel capacity is set to 3. +/// let payload_rx = camera.start_streaming(3).unwrap(); /// /// let mut payload_count = 0; /// while payload_count < 10 { @@ -270,8 +270,8 @@ impl Camera { /// camera.open().unwrap(); /// camera.load_context().unwrap(); /// - /// // Start streaming, the capacity of the receiver is 10. - /// let payload_rx = camera.start_streaming(10).unwrap(); + /// // Start streaming. Channel capacity is set to 3. + /// let payload_rx = camera.start_streaming(3).unwrap(); /// // The streamed payload can be received like below: /// // payload_rx.recv().await.unwrap() or /// // payload.rx.try_recv().unwrap(); @@ -337,8 +337,9 @@ impl Camera { /// // Loads `GenApi` context. This is necessary for streaming. /// camera.load_context().unwrap(); /// - /// // Start streaming, the capacity of the receiver is 10. - /// let payload_rx = camera.start_streaming(10).unwrap(); + /// // Start streaming. Channel capacity is set to 3. + /// let payload_rx = camera.start_streaming(3).unwrap(); + /// /// camera.stop_streaming().unwrap(); /// ``` #[tracing::instrument(skip(self), diff --git a/cameleon/src/lib.rs b/cameleon/src/lib.rs index 544eec3f..6234051a 100644 --- a/cameleon/src/lib.rs +++ b/cameleon/src/lib.rs @@ -47,8 +47,8 @@ //! // Loads `GenApi` context. This is necessary for streaming. //! camera.load_context().unwrap(); //! -//! // Start streaming. -//! let payload_rx = camera.start_streaming(10).unwrap(); +//! // Start streaming. Channel capacity is set to 3. +//! let payload_rx = camera.start_streaming(3).unwrap(); //! //! let mut payload_count = 0; //! while payload_count < 10 { diff --git a/device/Cargo.toml b/device/Cargo.toml index 0b4c3770..5a87597e 100644 --- a/device/Cargo.toml +++ b/device/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cameleon-device" -version = "0.1.0" +version = "0.1.1" edition = "2018" authors = ["Cameleon Project Developers"] license = "MPL-2.0"