-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into fix-licensekey-remo…
…ve-clone * upstream/main: chore: Document status of all C API bindings (#162) feat: Add parameter wrapper and example (#161) fix(mdb)!: Give callbacks references to errors (#116) refactor(axevent): Wrap borrowed `KeyValueSet` in `ManuallyDrop` (#159) fix(axevent): Allow undeclaring without callback (#157) fix(axevent): Free `KeyValueSet` when creating `Event` (#156) fix(axevent)!: Take ownership of returned value in `get_string` (#149) chore: Document how to use address sanitizer (#152) refactor(mdb): Move error to separate module (#155) feat(mdb): Improve ergonomics for consumer (#115) chore: Update acap-native-sdk to 12.1.0 (#154) chore: Run FFI patterns under Miri (#140)
- Loading branch information
Showing
36 changed files
with
1,864 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
9d66c3ff02cf209762e13cd5d7cd5d91b6da23c2 target-aarch64/acap/Challenge_Build_Tools_1_0_0_all.eap | ||
1fe87dc90ee1fefce2c3bd8f4d6d9ecfdc82b84b target-aarch64/acap/axparameter_example_0_0_0_aarch64.eap | ||
12a30609c7fa463e1e8d0405665d2aa17d4349c4 target-aarch64/acap/axstorage_example_0_0_0_aarch64.eap | ||
6db963922ca2ceb25715bbdb6445b504c307d432 target-aarch64/acap/bounding_box_example_0_0_0_aarch64.eap | ||
f99e344e5bf6fc4cd59715b9a4b784a83df27342 target-aarch64/acap/consume_analytics_metadata_0_0_0_aarch64.eap | ||
893f45edfd097fe6f6ffc4ba2210160a32600a6d target-aarch64/acap/consume_analytics_metadata_0_0_0_aarch64.eap | ||
ad1142937ed6e2d4f2a1f4cb0fdae721a0744750 target-aarch64/acap/embedded_web_page_0_0_0_aarch64.eap | ||
f47872232e0f2cd4ace9e2e77b07cafb431cbe73 target-aarch64/acap/hello_world_0_0_0_aarch64.eap | ||
75818664787ff2ff7dbdd32fadfe20c23974c867 target-aarch64/acap/inspect_env_0_0_0_aarch64.eap | ||
9d205dbde1b7144d30fb4c5a45fcaef93cb12810 target-aarch64/acap/licensekey_handler_0_0_0_aarch64.eap | ||
ed84b4b9ae09256dcef1a7287cd802e39c8b6a92 target-aarch64/acap/reverse_proxy_0_0_0_aarch64.eap | ||
aee472d1e21f50694fc495c3483ba3dc7bae21e7 target-aarch64/acap/send_event_1_0_0_aarch64.eap | ||
6d3ebfbd5a42e864faf970c7595309c78b0a00c9 target-aarch64/acap/send_event_1_0_0_aarch64.eap | ||
e8bfb22e1b1416bff9d33980839ccbc8ce4b9d16 target-aarch64/acap/using_a_build_script_0_0_0_aarch64.eap | ||
5a533b71d01edb65d15751dd93fa153f5ef343ea target-aarch64/acap/vapix_access_0_0_0_aarch64.eap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "axparameter_example" | ||
version = "0.0.0" | ||
edition.workspace = true | ||
publish = false | ||
|
||
[dependencies] | ||
glib = { workspace = true } | ||
log = { workspace = true } | ||
|
||
acap-logging = { workspace = true } | ||
axparameter = { workspace = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"schemaVersion": "1.7.0", | ||
"acapPackageConf": { | ||
"setup": { | ||
"appName": "axparameter_example", | ||
"embeddedSdkVersion": "2.0", | ||
"vendor": "Axis Communications", | ||
"runMode": "never", | ||
"version": "0.0.0" | ||
}, | ||
"configuration": { | ||
"paramConfig": [ | ||
{ | ||
"name": "TestParameter", | ||
"default": "TestValue2", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "w", | ||
"default": "initial_value", | ||
"type": "string" | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
use axparameter::{error::ParameterError, parameter::Parameter, types::ControlWord}; | ||
use log::{error, info}; | ||
|
||
const APP_NAME: &str = "axparameter_example"; | ||
|
||
fn main() { | ||
acap_logging::init_logger(); | ||
|
||
let main_loop = glib::MainLoop::new(None, false); | ||
glib::unix_signal_add_once(15, { | ||
let main_loop = main_loop.clone(); | ||
move || main_loop.quit() | ||
}); | ||
glib::unix_signal_add_once(2, { | ||
let main_loop = main_loop.clone(); | ||
move || main_loop.quit() | ||
}); | ||
|
||
info!("Starting {APP_NAME}"); | ||
|
||
let parameter = Parameter::new(APP_NAME).unwrap(); | ||
|
||
if let Err(err) = parameter.add("Parameter", None, "param".to_string()) { | ||
if !err.matches::<ParameterError>(ParameterError::ParamAdded) { | ||
error!("Failed {}", err); | ||
return; | ||
} | ||
} | ||
|
||
if let Err(err) = parameter.add("ParameterTwo", None, "param_two".to_string()) { | ||
if !err.matches::<ParameterError>(ParameterError::ParamAdded) { | ||
error!("Failed {}", err); | ||
return; | ||
} | ||
} | ||
|
||
if let Err(err) = parameter.add("ParameterThree", None, "param_three".to_string()) { | ||
if !err.matches::<ParameterError>(ParameterError::ParamAdded) { | ||
error!("Failed {}", err); | ||
return; | ||
} | ||
} | ||
|
||
if let Err(err) = parameter.add( | ||
"ParameterFour", | ||
Some(ControlWord::ReadOnly), | ||
"param_four".to_string(), | ||
) { | ||
if !err.matches::<ParameterError>(ParameterError::ParamAdded) { | ||
error!("Failed {}", err); | ||
return; | ||
} | ||
} | ||
|
||
let value: String = match parameter.get("Parameter") { | ||
Ok(value) => value, | ||
Err(err) => { | ||
error!("Failed {}", err); | ||
return; | ||
} | ||
}; | ||
|
||
info!("The value of \"Parameter\" is \"{}\"", value); | ||
|
||
let value: String = match parameter.get("ParameterFour") { | ||
Ok(value) => value, | ||
Err(err) => { | ||
error!("Failed {}", err); | ||
return; | ||
} | ||
}; | ||
|
||
info!("The value of \"ParameterFour\" is \"{}\"", value); | ||
|
||
if let Err(err) = parameter.remove("ParameterThree") { | ||
error!("Failed {}", err); | ||
return; | ||
} | ||
|
||
if let Err(err) = parameter.set("Parameter", "param_set".to_string(), true) { | ||
error!("Failed {}", err); | ||
return; | ||
} | ||
|
||
if let Ok(()) = parameter.set("ParameterFour", "param_four_set".to_string(), true) { | ||
error!("Failed ParameterFour should be ReadOnly"); | ||
return; | ||
} | ||
|
||
if let Ok(list) = parameter.list() { | ||
for param in list { | ||
info!("Parameter in list: \"{}\"", param); | ||
} | ||
} else { | ||
error!("Failed {}", value); | ||
return; | ||
} | ||
|
||
if let Err(err) = parameter.register_callback("Parameter", |_name, _value| { | ||
info!("In Parameter callback"); | ||
}) { | ||
error!("Failed {}", err); | ||
return; | ||
} | ||
|
||
main_loop.run(); | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests; |
Oops, something went wrong.