Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Python, and never detaches the `uvcvideo` driver.
| model | USB id | status |
|-------|--------|--------|
| Insta360 Link 2 | `2e1a:4c04` | validated on real hardware |
| Insta360 Link 2C | `2e1a:4c03` | recognised, **not tested** |
| Insta360 Link (original) | `2e1a:4c01` | recognised, **not tested** |

## Features
Expand Down
3 changes: 2 additions & 1 deletion contrib/99-insta360-link.rules
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# Install: sudo cp contrib/99-insta360-link.rules /etc/udev/rules.d/
# sudo udevadm control --reload && sudo udevadm trigger
#
# Insta360 Link 2 (validated) and original Link (recognised, untested).
# Insta360 Link 2 (validated); Link 2C and original Link (recognised, untested).
SUBSYSTEM=="video4linux", ATTRS{idVendor}=="2e1a", ATTRS{idProduct}=="4c04", TAG+="uaccess", GROUP="video", MODE="0660"
SUBSYSTEM=="video4linux", ATTRS{idVendor}=="2e1a", ATTRS{idProduct}=="4c03", TAG+="uaccess", GROUP="video", MODE="0660"
SUBSYSTEM=="video4linux", ATTRS{idVendor}=="2e1a", ATTRS{idProduct}=="4c01", TAG+="uaccess", GROUP="video", MODE="0660"
9 changes: 9 additions & 0 deletions src/camera/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ use std::fmt;
pub const INSTA360_VID: u16 = 0x2e1a;
/// USB product id of the Insta360 Link 2 (validated on real hardware).
pub const LINK2_PID: u16 = 0x4c04;
/// USB product id of the Insta360 Link 2C (recognised, **not** tested).
pub const LINK2C_PID: u16 = 0x4c03;
/// USB product id of the original Insta360 Link (recognised, **not** tested).
pub const LINK_PID: u16 = 0x4c01;

Expand All @@ -15,6 +17,8 @@ pub const LINK_PID: u16 = 0x4c01;
pub enum Model {
/// Insta360 Link 2 — the primary, hardware-validated target.
Link2,
/// Insta360 Link 2C — same control surface as the Link 2; untested.
Link2C,
/// Original Insta360 Link — recognised by VID/PID only; untested.
Link,
}
Expand All @@ -27,6 +31,7 @@ impl Model {
}
match pid {
LINK2_PID => Some(Model::Link2),
LINK2C_PID => Some(Model::Link2C),
LINK_PID => Some(Model::Link),
_ => None,
}
Expand All @@ -36,6 +41,7 @@ impl Model {
pub fn name(&self) -> &'static str {
match self {
Model::Link2 => "Insta360 Link 2",
Model::Link2C => "Insta360 Link 2C",
Model::Link => "Insta360 Link",
}
}
Expand All @@ -59,6 +65,7 @@ mod tests {
#[test]
fn matches_known_ids() {
assert_eq!(Model::from_usb_ids(0x2e1a, 0x4c04), Some(Model::Link2));
assert_eq!(Model::from_usb_ids(0x2e1a, 0x4c03), Some(Model::Link2C));
assert_eq!(Model::from_usb_ids(0x2e1a, 0x4c01), Some(Model::Link));
assert_eq!(Model::from_usb_ids(0x2e1a, 0x0000), None);
assert_eq!(Model::from_usb_ids(0x046d, 0x4c04), None);
Expand All @@ -67,7 +74,9 @@ mod tests {
#[test]
fn only_link2_is_tested() {
assert!(Model::Link2.is_tested());
assert!(!Model::Link2C.is_tested());
assert!(!Model::Link.is_tested());
assert_eq!(Model::Link2.name(), "Insta360 Link 2");
assert_eq!(Model::Link2C.name(), "Insta360 Link 2C");
}
}
6 changes: 3 additions & 3 deletions src/commands/tracking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ fn emit(ctx: &Context, state: link2::TrackingState, warning: Option<String>) {
);
}

/// Make sure the device really is a Link 2 whose unit 11 carries the AI GUID.
/// Make sure the device really is a Link 2 / 2C whose unit 11 carries the AI GUID.
fn check_unit(cam: &Camera) -> Result<()> {
let info = cam.info();
if info.model != Model::Link2 {
if !matches!(info.model, Model::Link2 | Model::Link2C) {
return Err(Error::Vendor(format!(
"tracking is only implemented for the Insta360 Link 2 (found {})",
"tracking is only implemented for the Insta360 Link 2 / Link 2C (found {})",
info.model
)));
}
Expand Down