@staticmethod<EOL><INDENT>def create(packet_type, rorg, rorg_func, rorg_type, direction=None, command=None,<EOL>destination=None,<EOL>sender=None,<EOL>learn=False, **kwargs):<DEDENT>
if packet_type != PACKET.RADIO_ERP1:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if rorg not in [RORG.RPS, RORG.BS1, RORG.BS4, RORG.VLD]:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if destination is None:<EOL><INDENT>Packet.logger.warning('<STR_LIT>')<EOL>destination = [<NUM_LIT>, <NUM_LIT>, <NUM_LIT>, <NUM_LIT>]<EOL><DEDENT>if sender is None:<EOL><INDENT>Packet.logger.warning('<STR_LIT>')<EOL>sender = [<NUM_LIT>, <NUM_LIT>, <NUM_LIT>, <NUM_LIT>]<EOL><DEDENT>if not isinstance(destination, list) or len(destination) != <NUM_LIT:4>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if not isinstance(sender, list) or len(sender) != <NUM_LIT:4>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>packet = Packet(packet_type, data=[], optional=[])<EOL>packet.rorg = rorg<EOL>packet.data = [packet.rorg]<EOL>packet.select_eep(rorg_func, rorg_type, direction, command)<EOL>if rorg in [RORG.RPS, RORG.BS1]:<EOL><INDENT>packet.data.extend([<NUM_LIT:0>])<EOL><DEDENT>elif rorg == RORG.BS4:<EOL><INDENT>packet.data.extend([<NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>packet.data.extend([<NUM_LIT:0>] * int(packet._profile.get('<STR_LIT>', '<STR_LIT:1>')))<EOL><DEDENT>packet.data.extend(sender)<EOL>packet.data.extend([<NUM_LIT:0>])<EOL>packet.optional = [<NUM_LIT:3>] + destination + [<NUM_LIT>] + [<NUM_LIT:0>]<EOL>if command:<EOL><INDENT>kwargs['<STR_LIT>'] = command<EOL><DEDENT>packet.set_eep(kwargs)<EOL>if rorg in [RORG.BS1, RORG.BS4] and not learn:<EOL><INDENT>if rorg == RORG.BS1:<EOL><INDENT>packet.data[<NUM_LIT:1>] |= (<NUM_LIT:1> << <NUM_LIT:3>)<EOL><DEDENT>if rorg == RORG.BS4:<EOL><INDENT>packet.data[<NUM_LIT:4>] |= (<NUM_LIT:1> << <NUM_LIT:3>)<EOL><DEDENT><DEDENT>packet.data[-<NUM_LIT:1>] = packet.status<EOL>packet = Packet.parse_msg(packet.build())[<NUM_LIT:2>]<EOL>packet.rorg = rorg<EOL>packet.parse_eep(rorg_func, rorg_type, direction, command)<EOL>return packet<EOL>
Creates an packet ready for sending.
Uses rorg, rorg_func and rorg_type to determine the values set based on EEP.
Additional arguments (**kwargs) are used for setting the values.

Currently only supports:
    - PACKET.RADIO_ERP1
    - RORGs RPS, BS1, BS4, VLD.

TODO:
    - Require sender to be set? Would force the "correct" sender to be set.
    - Do we need to set telegram control bits?
      Might be useful for acting as a repeater?