Function sovrin::api::agent::sovrin_agent_connect
[−]
[src]
#[no_mangle]pub extern "C" fn sovrin_agent_connect(
command_handle: i32,
wallet_handle: i32,
sender_did: *const c_char,
receiver_did: *const c_char,
connection_cb: Option<extern "C" fn(_: i32, _: ErrorCode, _: i32)>,
message_cb: Option<extern "C" fn(_: i32, _: ErrorCode, _: *const c_char)>
) -> ErrorCode
Establishes agent to agent connection.
Information about sender Identity must be saved in the wallet with sovrin_create_and_store_my_did call before establishing of connection.
Information about receiver Identity can be saved in the wallet with sovrin_store_their_did call before establishing of connection. If there is no corresponded wallet record for receiver Identity than this call will lookup Identity Ledger and cache this information in the wallet.
Note that messages encryption/decryption will be performed automatically.
Params
command_handle: Command handle to map callback to caller context. wallet_handle: Wallet handle (created by open_wallet). sender_did: Id of sender Identity stored in secured Wallet. receiver_did: Id of receiver Identity. connection_cb: Callback that will be called after establishing of connection or on error. message_cb: Callback that will be called on receiving of an incomming message.
Returns
Error code connection_cb: - xcommand_handle: command handle to map callback to caller context. - err: Error code. - connection_handle: Connection handle to use for messages sending and mapping of incomming messages to this connection. message_cb: - xconnection_handle: Connection handle. Indetnifies connection. - err: Error code. - message: Received message.