Skip to content

Commit 3ca57bc

Browse files
committed
xous-api-names: add TryConnect
This is a non-blocking version of Connect that is fallible. Signed-off-by: Sean Cross <[email protected]>
1 parent 1bc39cd commit 3ca57bc

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

api/xous-api-names/src/api.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,34 @@ pub enum Opcode {
5252
/// }
5353
/// ```
5454
BlockingConnect = 6,
55+
56+
/// Connect to a Server, returning the connection ID or an authentication request if
57+
/// it exists, and returning ServerNotFound if it does not exist.
58+
///
59+
/// # Message Types
60+
///
61+
/// * MutableLend
62+
///
63+
/// # Arguments
64+
///
65+
/// The memory being pointed to should be a &str, and the length of the string should
66+
/// be specified in the `valid` field.
67+
///
68+
/// # Return Values
69+
///
70+
/// Memory is overwritten to contain a return value. This return value can be defined
71+
/// as the following enum:
72+
///
73+
/// ```rust
74+
/// #[repr(C)]
75+
/// #[non_exhaustive]
76+
/// enum ConnectResult {
77+
/// Success(xous::CID /* connection ID */, [u32; 4] /* Disconnection token */),
78+
/// Error(u32 /* error code */),
79+
/// Unhandled, /* Catchall for future Results */
80+
/// }
81+
/// ```
82+
TryConnect = 7,
5583
}
5684

5785
#[derive(Debug, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)]

0 commit comments

Comments
 (0)