View Source KNXex.CEMIControlField (knxex v0.1.0)
KNX Common External Message Interface Control Field (cEMI).
The cEMI control field has the following structure and bit order:
+---------------------------------------+---------------------------------------+
| Control Field 1 | Control Field 2 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+The control field 1 has the following structure:
Bit |
------+---------------------------------------------------------------
15 | Frame Type - 0 = for extended frame
| 1 = for standard frame
------+---------------------------------------------------------------
14 | Reserved
|
------+---------------------------------------------------------------
13 | Repeat Flag - 0 = repeat frame on medium in case of an error (or on receive: repeated)
| 1 = do not repeat (or on receive: not repeated)
------+---------------------------------------------------------------
12 | System Broadcast - 0 = system broadcast
| 1 = broadcast
------+---------------------------------------------------------------
11 | Priority - 0 = system (reserved)
| 1 = normal (also called alarm priority)
------+ 2 = urgent (also called high priority)
10 | 3 = low
|
------+---------------------------------------------------------------
9 | Acknowledge Request - 0 = no ACK requested
| (L_Data.req) 1 = ACK requested
------+---------------------------------------------------------------
8 | Confirm - 0 = no error
| (L_Data.con) - 1 = error
------+---------------------------------------------------------------The control field 2 has the following structure:
Bit |
------+---------------------------------------------------------------
7 | Destination Address Type - 0 = individual address
| - 1 = group address
------+---------------------------------------------------------------
6-4 | Hop Count (0-7)
------+---------------------------------------------------------------
3-0 | Extended Frame Format - 0 = standard frame
------+---------------------------------------------------------------
Link to this section Summary
Functions
Explains the given control field. This returns an explain string.
You may want to pipe the string into IO.puts/2.
Checks if the given cEMI Control Field has the ACK rqeuested bit set. Only relevant for L_Data.req frames.
Checks if the given cEMI Control Field has the do not repeat flag bit set (do not repeat on medium error).
Checks if the given cEMI Control Field has the error bit set (confirm = 1 => error). Only relevant for L_Data.con frames.
Checks if the given cEMI Control Field has the broadcast bit set.
Checks if the given cEMI Control Field has the destination address type bit set to group.
Checks if the given cEMI Control Field has the destination address type bit set to individual.
Checks if the given cEMI Control Field has the extended frame bit set.
Link to this section Types
@type t() :: non_neg_integer()
The KNX cEMI control field. It is a bitfield. See the module doc.
Link to this section Functions
Explains the given control field. This returns an explain string.
You may want to pipe the string into IO.puts/2.
Example output:
Control Field 2:
Bit 0-3: Extended Frame Format: 0 (used for LTE)
Bit 4-6: Hop Count: 5
Bit 7: Destination Address Type: group
Control Field 1:
Bit 8: Confirm (L_Data.con): no error
Bit 9: ACK Requested: no ACK requested
Bit 10+11: Priority: low
Bit 12: System Broadcast: no
Bit 13: Do-Not-Repeat/Original Flag: yes
Bit 14: -- reserved --
Bit 15: Frame Type: standard
Checks if the given cEMI Control Field has the ACK rqeuested bit set. Only relevant for L_Data.req frames.
Checks if the given cEMI Control Field has the do not repeat flag bit set (do not repeat on medium error).
Checks if the given cEMI Control Field has the error bit set (confirm = 1 => error). Only relevant for L_Data.con frames.
Checks if the given cEMI Control Field has the broadcast bit set.
Checks if the given cEMI Control Field has the destination address type bit set to group.
Checks if the given cEMI Control Field has the destination address type bit set to individual.
Checks if the given cEMI Control Field has the extended frame bit set.