Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naive GigE implementation #198

Draft
wants to merge 69 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
dbf129a
Define gige error type
Y-Nak Jul 4, 2021
b9c0d39
Implement gige command packet
Y-Nak Jul 4, 2021
5d2008f
Use `write_all` instead of `write` in `impl::bytes_io`
Y-Nak Jul 5, 2021
0e4f231
Add some getters to gige `CommandPacket`
Y-Nak Jul 5, 2021
a1fd692
Implement gige ack packet
Y-Nak Jul 5, 2021
45312f0
Define types of gige register
Y-Nak Jul 6, 2021
d2b2c05
Implement `BytesConvertible` for `Ipv4Addr`
Y-Nak Jul 6, 2021
94301ad
Define gige register maps
Y-Nak Jul 7, 2021
7facebc
Implement gige `ControlChannel`
Y-Nak Jul 9, 2021
af40fed
Define `BitOp` trait
Y-Nak Jul 9, 2021
e2af942
Define `ControlChannelPriviledgeRegister`
Y-Nak Jul 9, 2021
54e17bd
Implement gige device enumeration
Y-Nak Jul 27, 2021
4ac553c
Make clippy satisfy
Y-Nak Jul 27, 2021
9cb8f09
Move some register types to `cameleon-device`
Y-Nak Jul 27, 2021
f2273b7
Add `read_reg` and `write_reg` to `DeviceControl`
Y-Nak Jul 28, 2021
e94f510
Add `utils` module
Y-Nak Jul 28, 2021
92a3e6e
Remove redundant error kind
Y-Nak Jul 28, 2021
51ac7a4
Define error conversions
Y-Nak Jul 28, 2021
f087075
Change `*_reg` methods definitions
Y-Nak Jul 28, 2021
0d73f71
Fix typo of error message
Y-Nak Jul 28, 2021
1345164
Improve gige protocol usability
Y-Nak Jul 28, 2021
2bb2178
Implement basic IO operations on gige `ControlHandle`
Y-Nak Jul 28, 2021
c6c3a69
Add GVCP capability register definition
Y-Nak Jul 29, 2021
e4c327e
Change `*_reg` declarations to allow write_reg fallback
Y-Nak Jul 29, 2021
61d768e
Re-export u3v register structs
Y-Nak Jul 29, 2021
0917522
Name cleanup
Y-Nak Jul 29, 2021
f7f6db0
Implement `BytesConvertible` for `[u8; N]`
Y-Nak Jul 29, 2021
c774dd5
Implement `StaticString`
Y-Nak Jul 30, 2021
66918dc
Implement GigE bootstrap register
Y-Nak Jul 30, 2021
e76fd96
Define message channel registers
Y-Nak Jul 30, 2021
ab984a0
Implement GigE stream register
Y-Nak Jul 30, 2021
ff81539
Implement GigE xml url parser
Y-Nak Aug 2, 2021
943b710
Define manifest entry
Y-Nak Aug 2, 2021
1778c87
Integrate gige manifest related register types to `cameleon`
Y-Nak Aug 3, 2021
be9329e
Implement read_reg fallback
Y-Nak Aug 3, 2021
fb5d448
Implement write_reg fallback
Y-Nak Aug 3, 2021
84cd1d8
Remove unnecessary field from
Y-Nak Aug 4, 2021
d48f470
Implement open/close for GigE control channel
Y-Nak Aug 4, 2021
e52912f
Implement wrapper for `ManifestEntry`
Y-Nak Aug 4, 2021
95a2e2c
Implement `DynamicString`
Y-Nak Aug 4, 2021
dfb6c2d
Add `ureq` dependency
Y-Nak Aug 4, 2021
d65c2bc
Add error kind
Y-Nak Aug 4, 2021
c72501f
Implement `genapi` method for gige `ControlHandle`
Y-Nak Aug 4, 2021
182fbb5
Rename `read/write` to `read_mem/write_mem`
Y-Nak Aug 5, 2021
0841605
Add `StreamHandle` placeholder
Y-Nak Aug 5, 2021
db35c45
Remove `futures-executor` dependency
Y-Nak Aug 6, 2021
f1a3df0
Remove dependencies
Y-Nak Aug 6, 2021
70ba848
Implement `HeartbeatLoop`
Y-Nak Aug 6, 2021
decfa2d
Fix GigE protocol bugs
Y-Nak Aug 7, 2021
932bbe3
Implement `gige::enumerate_cameras`
Y-Nak Aug 7, 2021
ebbcd8d
Remove unnecessary import
Y-Nak Aug 7, 2021
a24e97b
Parse float exponents in formula correctly
Y-Nak Aug 7, 2021
a51655c
Move `PacketStatus` to `gige::protocol` root
Y-Nak Aug 13, 2021
7baea64
Fix typo
Y-Nak Aug 13, 2021
cd9e435
Implement GigE stream header
Y-Nak Aug 13, 2021
11aacf5
Implement GigE PayloadType
Y-Nak Aug 13, 2021
60a3d25
Implement GigE ImageLeader
Y-Nak Aug 13, 2021
982df62
Merge remote-tracking branch 'origin/main' into gige
WhiteBlackGoose Sep 27, 2024
7d0e5cb
WIP
WhiteBlackGoose Nov 19, 2024
f115105
WIP
WhiteBlackGoose Nov 20, 2024
c42c3f5
WIP
WhiteBlackGoose Nov 20, 2024
a158b44
WIP
WhiteBlackGoose Nov 20, 2024
599dad1
actually works
WhiteBlackGoose Nov 20, 2024
46447b5
warnings
WhiteBlackGoose Nov 20, 2024
417c204
Minor fixes
WhiteBlackGoose Nov 20, 2024
58bfb8a
debug garbage removed
WhiteBlackGoose Nov 20, 2024
fd58232
Merge remote-tracking branch 'upstream/main' into gige
WhiteBlackGoose Nov 20, 2024
ad73d09
unfuck deps
WhiteBlackGoose Nov 20, 2024
62efdb2
bug with disabling streaming fixed
WhiteBlackGoose Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cameleon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@ thiserror = "1.0.24"
semver = "1.0.0"
zip = { version = "0.6.0", default-features = false, features = ["deflate"] }
sha-1 = "0.10.0"
async-std = "1.7.0"
async-channel = "1.7.0" # 1.7.0 has added recv_blocking()
futures-channel = "0.3.16"
futures-util = { version = "0.3.16", features = ["async-await"] }
tracing = "0.1.26"
auto_impl = "1.0.1"
cameleon-device = { path = "../device", version = "0.1.13" }
cameleon-genapi = { path = "../genapi", version = "0.1.13" }
cameleon-impl = { path = "../impl", version = "0.1.0" }
anyhow = "1.0.40"
ureq = "2.1"

[dev-dependencies]
trybuild = "1.0.42"
Expand Down
10 changes: 8 additions & 2 deletions cameleon/src/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,16 @@ pub trait DeviceControl {
/// Reads data from the device's memory.
///
/// Reads length is same as `buf.len()`.
fn read(&mut self, address: u64, buf: &mut [u8]) -> ControlResult<()>;
fn read_mem(&mut self, address: u64, buf: &mut [u8]) -> ControlResult<()>;

/// Reads 4 bytes data from the address.
fn read_reg(&mut self, address: u64) -> ControlResult<[u8; 4]>;

/// Writes data to the device's memory.
fn write(&mut self, address: u64, data: &[u8]) -> ControlResult<()>;
fn write_mem(&mut self, address: u64, data: &[u8]) -> ControlResult<()>;

/// Writes 4 bytes data to the address.
fn write_reg(&mut self, address: u64, data: [u8; 4]) -> ControlResult<()>;

/// Returns `GenICam` xml string.
fn genapi(&mut self) -> ControlResult<String>;
Expand Down
15 changes: 4 additions & 11 deletions cameleon/src/genapi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ pub use cameleon_genapi::{
GenApiError, RegisterDescription, ValueCtxt,
};

pub use cameleon_device::CompressionType;

/// Manages context of parameters of the device.
///
/// # Examples
Expand Down Expand Up @@ -414,15 +416,6 @@ impl From<DefaultGenApiCtxt> for SharedNoCacheGenApiCtxt {
}
}

/// Represents `CompressionType` of `GenICam` XML file on the device's memory.
#[derive(Debug, Clone, Copy)]
pub enum CompressionType {
/// Uncompressed `GenICam` XML file.
Uncompressed,
/// ZIP containing a single `GenICam` XML file.
Zip,
}

struct GenApiDevice<'a, T> {
inner: &'a mut T,
}
Expand All @@ -447,7 +440,7 @@ where
"invalid address: the given address has negative value".into(),
)
})?;
Ok(self.inner.read(address, data)?)
Ok(self.inner.read_mem(address, data)?)
}

fn write_mem(
Expand All @@ -460,6 +453,6 @@ where
"invalid address: the given address has negative value".into(),
)
})?;
Ok(self.inner.write(address, data)?)
Ok(self.inner.write_mem(address, data)?)
}
}
Loading
Loading