Messages¶
Bus messages¶
Msg¶
- class knx_stack.Msg(iterable=(), /)¶
A bus message wrapper which is able to consume the message’s bytes in different ways: through an octect, through a short or through a long.
>>> import knx_stack >>> msg = knx_stack.Msg.make_from_str("112203AA0B0C0D") >>> (head, body) = msg.octect() >>> head 0x11 >>> body 2203AA0B0C0D >>> (head, body) = body.short() >>> head 0x2203 >>> body AA0B0C0D >>> (head, body) = body.long() >>> head 0xAA0B0C0D >>> body
- classmethod make_from_str(msg: str) knx_stack.Msg ¶
- static stringtooctects(msg: str) Iterable[knx_stack.msg.Octect] ¶
- octect() Tuple[knx_stack.msg.Octect, knx_stack.Msg] ¶
Consumes an Octect from the message’s byte list
- Returns
Tuple(Octect, the other bytes as a new Msg)
- short() Tuple[knx_stack.msg.Short, knx_stack.Msg] ¶
Consumes a Short from the message’s byte list
- Returns
Tuple(Short, the other bytes as a new Msg)
- long() Tuple[knx_stack.msg.Long, knx_stack.Msg] ¶
Consumes a Long from the message’s byte list
- Returns
Tuple(Long, the other bytes as a new Msg)
Octect¶
- class knx_stack.msg.Octect¶
A wrapper for a byte value with methods to access low and high nibbles.
>>> import knx_stack >>> o = knx_stack.msg.Octect(knx_stack.msg.Nibbles(high=1, low=0)) >>> o 0x10 >>> o.nibble.high 1 >>> o.nibble.low 0 >>> o.value 16
- nibble¶
Structure/Union member
- value¶
Structure/Union member
Short¶
- class knx_stack.msg.Short¶
A wrapper for a short value with methods to access MSB (most significant byte), LSB (less significant byte) and both its octects.
>>> import knx_stack >>> MSB = knx_stack.msg.Octect(knx_stack.msg.Nibbles(high=1, low=0)).value >>> LSB = knx_stack.msg.Octect(knx_stack.msg.Nibbles(high=0, low=1)).value >>> bytes = knx_stack.msg.Bytes(MSB=MSB, LSB=LSB) >>> short = knx_stack.msg.Short(bytes) >>> short 0x1001 >>> short.byte.MSB 16 >>> short.byte.LSB 1 >>> short.value 4097
- property MSB: knx_stack.msg.Octect¶
- property LSB: knx_stack.msg.Octect¶
- property octects: Iterable[knx_stack.msg.Octect]¶
- byte¶
Structure/Union member
- value¶
Structure/Union member
Long¶
- class knx_stack.msg.Long¶
A wrapper for a long value with methods to access its single bytes or octects.
>>> import knx_stack >>> long = knx_stack.msg.Long(value=0x91000008) >>> long.B1 0x08 >>> long.B2 0x00 >>> long.B3 0x00 >>> long.B4 0x91
- property B1: knx_stack.msg.Octect¶
- property B2: knx_stack.msg.Octect¶
- property B3: knx_stack.msg.Octect¶
- property B4: knx_stack.msg.Octect¶
- property octects: Iterable[knx_stack.msg.Octect]¶
- byte¶
Structure/Union member
- value¶
Structure/Union member
Application messages¶
ISO/OSI Stack layers¶
Application layer¶
A_Group_Value_Read¶
- class knx_stack.definition.layer.application.a_group_value_read.req.Msg(asap)¶
- property asap¶
Alias for field number 0
A_Group_Value_Response¶
A_Group_Value_Write¶
- class knx_stack.definition.layer.application.a_group_value_write.req.Msg(asap, dpt)¶
- property asap¶
Alias for field number 0
- property dpt¶
Alias for field number 1
A_Property_Value_Read¶
- class knx_stack.definition.layer.application.a_property_value_read.req.Msg(asap, object_index, property_id, number_of_elements, start_index)¶
- property asap¶
Alias for field number 0
- property object_index¶
Alias for field number 1
- property property_id¶
Alias for field number 2
- property number_of_elements¶
Alias for field number 3
- property start_index¶
Alias for field number 4
- class knx_stack.definition.layer.application.a_property_value_read.ind.Msg(asap, object_index, property_id, number_of_elements, start_index)¶
- property asap¶
Alias for field number 0
- property object_index¶
Alias for field number 1
- property property_id¶
Alias for field number 2
- property number_of_elements¶
Alias for field number 3
- property start_index¶
Alias for field number 4
- class knx_stack.definition.layer.application.a_property_value_read.con.Msg(asap, object_index, property_id, number_of_elements, start_index, status)¶
- property asap¶
Alias for field number 0
- property object_index¶
Alias for field number 1
- property property_id¶
Alias for field number 2
- property number_of_elements¶
Alias for field number 3
- property start_index¶
Alias for field number 4
- property status¶
Alias for field number 5
A_Property_Value_Response¶
- class knx_stack.definition.layer.application.a_property_value_response.ind.Msg(asap, object_index, property_id, number_of_elements, start_index, data)¶
- property asap¶
Alias for field number 0
- property object_index¶
Alias for field number 1
- property property_id¶
Alias for field number 2
- property number_of_elements¶
Alias for field number 3
- property start_index¶
Alias for field number 4
- property data¶
Alias for field number 5
- class knx_stack.definition.layer.application.a_property_value_response.con.Msg(asap, object_index, property_id, number_of_elements, start_index, data, status)¶
- property asap¶
Alias for field number 0
- property object_index¶
Alias for field number 1
- property property_id¶
Alias for field number 2
- property number_of_elements¶
Alias for field number 3
- property start_index¶
Alias for field number 4
- property data¶
Alias for field number 5
- property status¶
Alias for field number 6
A_Property_Value_Write¶
- class knx_stack.definition.layer.application.a_property_value_write.req.Msg(asap, object_index, property_id, number_of_elements, start_index, data)¶
- property asap¶
Alias for field number 0
- property object_index¶
Alias for field number 1
- property property_id¶
Alias for field number 2
- property number_of_elements¶
Alias for field number 3
- property start_index¶
Alias for field number 4
- property data¶
Alias for field number 5
- class knx_stack.definition.layer.application.a_property_value_write.ind.Msg(asap, object_index, property_id, number_of_elements, start_index, data)¶
- property asap¶
Alias for field number 0
- property object_index¶
Alias for field number 1
- property property_id¶
Alias for field number 2
- property number_of_elements¶
Alias for field number 3
- property start_index¶
Alias for field number 4
- property data¶
Alias for field number 5
- class knx_stack.definition.layer.application.a_property_value_write.con.Msg(asap, object_index, property_id, number_of_elements, start_index, data, status)¶
- property asap¶
Alias for field number 0
- property object_index¶
Alias for field number 1
- property property_id¶
Alias for field number 2
- property number_of_elements¶
Alias for field number 3
- property start_index¶
Alias for field number 4
- property data¶
Alias for field number 5
- property status¶
Alias for field number 6
KNXnet IP¶
Core¶
Connect¶
- class knx_stack.definition.knxnet_ip.core.connect.req.Msg(addr_control_endpoint, port_control_endpoint, addr_data_endpoint, port_data_endpoint)¶
- property addr_control_endpoint¶
Alias for field number 0
- property port_control_endpoint¶
Alias for field number 1
- property addr_data_endpoint¶
Alias for field number 2
- property port_data_endpoint¶
Alias for field number 3