forked from eclipse-iceoryx/iceoryx2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[eclipse-iceoryx#210] Let discovery C example print services
- Loading branch information
1 parent
442a5e9
commit 4452dd3
Showing
1 changed file
with
16 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,18 @@ | ||
use iceoryx2::prelude::*; | ||
|
||
#[no_mangle] | ||
pub extern "C" fn zero_copy_service_list() { | ||
println!("hello world"); | ||
pub extern "C" fn zero_copy_service_list() -> i32 { | ||
let services = zero_copy::Service::list(); | ||
|
||
if services.is_err() { | ||
return -1; | ||
} | ||
|
||
let services = services.unwrap(); | ||
|
||
for service in services { | ||
println!("\n{:#?}", &service); | ||
} | ||
|
||
return 0; | ||
} |