Constructor
new Message(options)
Construct a new Message
to send on the bus.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | Options to construct this Properties
|
Members
body :Array
The body arguments for this message. Must match the signature.
Type:
- Array
- Source:
destination :string
The address on the bus to send the message to.
Type:
- string
- Source:
errorName :string
The name of the error if this is a message of type
ERROR
. Must be a valid interface name.
Type:
- string
- Source:
flags :MessageFlags
The flags for this message.
Type:
- MessageFlags
- Source:
interface :string
The destination interface for this message.
Type:
- string
- Source:
member :string
The destination member on the interface for this message.
Type:
- string
- Source:
path :string
The name of the object path for the message. Required for method calls and signals.
Type:
- string
- Source:
replySerial :int
The serial for the message this is in reply to. Set for
types ERROR
and METHOD_RETURN
.
Type:
- int
- Source:
sender :string
The name of the bus from which this message was sent. Set by the MessageBus.
Type:
- string
- Source:
serial :int
The serial of the message to track through the bus. You must use MessageBus#newSerial to get this serial. If not set, it will be set automatically when the message is sent.
Type:
- int
- Source:
signature :string
The type signature for the body args.
Type:
- string
- Source:
type :MessageType
The type of message this is.
Type:
- Source:
Methods
(static) newError(msg, errorName, errorTextopt)
Construct a new Message
of type ERROR
in reply to the given Message
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
msg |
Message | The |
||
errorName |
string | The name of the error. Must be a valid interface name. |
||
errorText |
string |
<optional> |
'An error occurred.' | An error message for the error. |
- Source:
(static) newMethodReturn(msg, signature, body)
Construct a new Message
of type METHOD_RETURN
in reply to the given
message.
Parameters:
Name | Type | Description |
---|---|---|
msg |
Message | The |
signature |
string | The signature for the message body. |
body |
Array | The body of the message as an array of arguments. Must match the signature. |
- Source:
(static) newSignal(path, iface, signature, {Array)
Construct a new Message
of type SIGNAL
to broadcast on the bus.
Parameters:
Name | Type | Description |
---|---|---|
path |
string | The object path of this signal. |
iface |
string | The interface of this signal. |
signature |
string | The signature of the message body. |
{Array |
body - The body of the message as an array of arguments. Must match the signature. |
- Source: