dbux v1.0.0 DBux.Message
Summary
Functions
Creates DBux.Message with attributes appropriate for error
Creates DBux.Message with attributes appropriate for method call
Creates DBux.Message with attributes appropriate for method return
Creates DBux.Message with attributes appropriate for signal
Serializes DBux.Message into bitstream using given endianness
Parses bitstream into DBux.Message
Types
message_type ::
:method_call |
:method_return |
:error |
:signal
t :: %DBux.Message{body: DBux.Value.list_of_values, destination: String.t, error_name: String.t, flags: number, interface: String.t, member: String.t, message_type: message_type, path: String.t, reply_serial: number, sender: String.t, serial: DBux.Serial.t, signature: String.t, unix_fds: number}
Functions
Creates DBux.Message with attributes appropriate for error.
Creates DBux.Message with attributes appropriate for method call.
Creates DBux.Message with attributes appropriate for method return.
Specs
build_signal(String.t, String.t, String.t, DBux.Value.list_of_values, DBux.Serial.t) :: %DBux.Message{body: term, destination: term, error_name: term, flags: term, interface: term, member: term, message_type: term, path: term, reply_serial: term, sender: term, serial: term, signature: term, unix_fds: term}
Creates DBux.Message with attributes appropriate for signal.
Specs
marshall(%DBux.Message{body: term, destination: term, error_name: term, flags: term, interface: term, member: term, message_type: term, path: term, reply_serial: term, sender: term, serial: term, signature: term, unix_fds: term}, :little_endian | :big_endian) :: Bitstring
Serializes DBux.Message into bitstream using given endianness.
TODO describe return values
Specs
unmarshall(Bitstring, boolean) ::
{:ok, %DBux.Message{body: term, destination: term, error_name: term, flags: term, interface: term, member: term, message_type: term, path: term, reply_serial: term, sender: term, serial: term, signature: term, unix_fds: term}, Bitstring} |
{:error, any}
Parses bitstream into DBux.Message.
First byte of the bitstream must be first byte of a message.
Returns {:ok, message, rest}
in case of success, where message is
a DBux.Message and rest is a remaining part of the given bitstream.
If not enough data was given it returns {:error, :bitstring_too_short}
.