def decode_tx_packet(packet: str) -> dict:
node_id, protocol, attrs = packet.split(DELIM, <NUM_LIT:2>)<EOL>data = cast(Dict[str, Any], {<EOL>'<STR_LIT>': PacketHeader(node_id).name,<EOL>})<EOL>data['<STR_LIT>'] = protocol.lower()<EOL>for i, attr in enumerate(filter(None, attrs.strip(DELIM).split(DELIM))):<EOL><INDENT>if i == <NUM_LIT:0>:<EOL><INDENT>data['<STR_LIT:id>'] = attr<EOL><DEDENT>if i == <NUM_LIT:1>:<EOL><INDENT>data['<STR_LIT>'] = attr<EOL><DEDENT>if i == <NUM_LIT:2>:<EOL><INDENT>data['<STR_LIT>'] = attr<EOL><DEDENT><DEDENT>if data.get('<STR_LIT>', '<STR_LIT>') == '<STR_LIT>' and len(data['<STR_LIT:id>']) != <NUM_LIT:6>:<EOL><INDENT>data['<STR_LIT:id>'] = '<STR_LIT>' + data['<STR_LIT:id>']<EOL><DEDENT>return data<EOL>
Break packet down into primitives, and do basic interpretation.

    >>> decode_packet('10;Kaku;ID=41;SWITCH=1;CMD=ON;') == {
    ...     'node': 'gateway',
    ...     'protocol': 'kaku',
    ...     'id': '000041',
    ...     'switch': '1',
    ...     'command': 'on',
    ... }
    True