@alwith/module-device 0.5.3 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/rust/src/lib.rs +11 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwith/module-device",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "files": [
package/rust/src/lib.rs CHANGED
@@ -139,6 +139,17 @@ impl DeviceHost {
139
139
  .call_async("attach", json!({"owner": owner, "platform": platform, "udid": udid, "auto_boot": auto_boot}))
140
140
  .await
141
141
  }
142
+ /// The host opening a device: one another owner holds moves to `owner`, otherwise it attaches as usual.
143
+ pub async fn take_over(
144
+ &self, owner: Owner, platform: &str, udid: Option<&str>, auto_boot: bool,
145
+ ) -> Result<AttachmentInfo, String> {
146
+ self.0
147
+ .call_async(
148
+ "take_over",
149
+ json!({"owner": owner, "platform": platform, "udid": udid, "auto_boot": auto_boot}),
150
+ )
151
+ .await
152
+ }
142
153
  pub async fn detach(&self, udid: &str, owner: Option<Owner>) -> Result<(), String> {
143
154
  self.0.call_async("detach", json!({"udid": udid, "owner": owner})).await
144
155
  }