Message

class canlib.kvadblib.Message(db, handle, name=None, id=None, flags=None, dlc=None, comment=None)[source]

Database message, holds signals.

asframe()[source]

Creates a Frame object with empty data matching this message

attributes()[source]

Return a generator over all message attributes.

bind(frame=None)[source]

Bind this message to a frame

Creates a new BoundMessage object representing this message bound to the given Frame object, or a new Frame object if frame is None.

comment

Comment message

Type:str
delete_attribute(name)[source]

Delete attribute from message.

delete_signal(signal)[source]

Delete signal from message.

Parameters:signal (Signal) – signal to be deleted
dlc

The message dlc

Type:int
flags

The message flags

Type:MessageFlag
get_attribute_value(name)[source]

Return attribute value

If the attribute is not set on the message, we return the attribute definition default value.

Changed in version 1.18: When an EnumAttribute is not set, the default value will now be returned as int (instead of EnumValue with empty name).

get_signal(name)[source]

Find signal in message by name.

get_signal_by_name(name)[source]

Find signal in message by name.

id

The message identifier

Type:int
name

The message name

Type:str
new_signal(name, type=<SignalType.UNSIGNED: 2>, byte_order=<SignalByteOrder.INTEL: 0>, mode=<SignalMultiplexMode.SIGNAL: 0>, representation=None, size=None, scaling=ValueScaling(factor=1, offset=0), limits=None, unit=None, comment=None, enums={})[source]

Create and add a new signal to the message.

qualified_name

The qualified message name

Returns database and message names separated by a dot.

Type:str
send_node

The send node for this message.

Type:Node
set_attribute_value(name, value)[source]

Set value of attribute ‘name’ on message.

If no attribute called ‘name’ is set on message, attach a message attribute from the database attribute definition first.

signals()[source]

Return a generator of all signals in message.