mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
rkyv-test-server: support multiple callbacks for one client
There doesn't seem to be a compelling reason to limit clients to just one callback. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
c1fe20c06b
commit
f58f82a40d
1 changed files with 6 additions and 8 deletions
|
|
@ -142,14 +142,12 @@ fn test_main() -> ! {
|
||||||
{
|
{
|
||||||
let sid = xous::SID::from_u32(arg1 as _, arg2 as _, arg3 as _, arg4 as _);
|
let sid = xous::SID::from_u32(arg1 as _, arg2 as _, arg3 as _, arg4 as _);
|
||||||
let cb_conn = Some(xous::connect(sid).unwrap());
|
let cb_conn = Some(xous::connect(sid).unwrap());
|
||||||
// Add this callback connection to the list of callbacks if it doesn't
|
// Add this callback connection to the list of callbacks. If `AddLogStringCallback`
|
||||||
// already exist.
|
// is called multiple times, then it will receive multiple callbacks.
|
||||||
if !logstring_callback_connections.contains(&cb_conn) {
|
for entry in logstring_callback_connections.iter_mut() {
|
||||||
for entry in logstring_callback_connections.iter_mut() {
|
if *entry == None {
|
||||||
if *entry == None {
|
*entry = cb_conn;
|
||||||
*entry = cb_conn;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue