Skip to content

Latest commit

 

History

History
184 lines (104 loc) · 5.43 KB

dbus_peer_connection.md

File metadata and controls

184 lines (104 loc) · 5.43 KB

Module dbus_peer_connection

Peer connections.

Copyright (c) 2015 Jean Parpaillon

Behaviours: dbus_connection, gen_fsm.

Authors: Jean Parpaillon (jean.parpaillon@free.fr).

Function Index

auth/1Launch authentication on this connection No message can be sent before authentication.
authenticated/3
call/2Synchronously send a message.
cast/2Asynchronously send a message.
close/1Close the connection.
code_change/4
connected/3Default is to use EXTERNAL mechanism first.
handle_event/3
handle_info/3
handle_sync_event/4
init/1
set_controlling_process/2Change controlling process for the connection.
start_link/1Equivalent to start_link(BusId, [list, {packet, 0}]).
start_link/2Start a connection to a peer.
terminate/3
waiting_for_agree/3
waiting_for_data/3
waiting_for_ok/3
waiting_for_reject/3

Function Details

auth/1


auth(Conn::pid()) -> {ok, ConnexionId::undefined | binary()} | {error, term()}

Launch authentication on this connection No message can be sent before authentication.

authenticated/3

authenticated(Evt, From, State) -> any()

call/2


call(Conn::pid(), Dbus_message::dbus_message()) -> {ok, term()} | {error, term()}

Synchronously send a message

cast/2


cast(Conn::pid(), Dbus_message::dbus_message()) -> ok | {error, term()}

Asynchronously send a message

close/1


close(Conn::pid()) -> ok

Close the connection

code_change/4

code_change(OldVsn, StateName, State, Extra) -> any()

connected/3

connected(Evt, From, State) -> any()

Default is to use EXTERNAL mechanism first. If it fails, server will answer with list of possible authentications. Mimic C implementation

handle_event/3

handle_event(Evt, StateName, State) -> any()

handle_info/3

handle_info(Evt, StateName, State) -> any()

handle_sync_event/4

handle_sync_event(Evt, From, StateName, State) -> any()

init/1

init(X1) -> any()

set_controlling_process/2


set_controlling_process(Connection::pid(), Client::pid()) -> ok | {error, unauthorized}

Change controlling process for the connection.

If called by someone else than current owner, {error, unauthorized} is returned.

start_link/1


start_link(BusId::bus_id()) -> {ok, dbus_connection()} | {error, term()}

Equivalent to start_link(BusId, [list, {packet, 0}]).

start_link/2


start_link(BusId::bus_id(), Options::list()) -> {ok, dbus_connection()} | {error, term()}

Start a connection to a peer

terminate/3

terminate(Reason, StateName, State) -> any()

waiting_for_agree/3

waiting_for_agree(Evt, From, State) -> any()

waiting_for_data/3

waiting_for_data(Evt, From, State) -> any()

waiting_for_ok/3

waiting_for_ok(Evt, From, State) -> any()

waiting_for_reject/3

waiting_for_reject(Evt, From, State) -> any()