edgeport - v1.0.3
    Preparing search index...

    Type Alias DecodedPacket

    DecodedPacket:
        | {
            cleanSession: boolean;
            clientId: string;
            keepAliveSeconds: number;
            password?: Uint8Array;
            protocolLevel: number;
            protocolName: string;
            type: CONNECT;
            username?: string;
        }
        | { returnCode: number; sessionPresent: boolean; type: CONNACK }
        | {
            dup: boolean;
            packetId?: number;
            payload: Uint8Array;
            qos: 0 | 1 | 2;
            retain: boolean;
            topic: string;
            type: PUBLISH;
        }
        | { packetId: number; type: PUBACK }
        | { packetId: number; type: PUBREC }
        | { packetId: number; type: PUBREL }
        | { packetId: number; type: PUBCOMP }
        | { packetId: number; subscriptions: Subscription[]; type: SUBSCRIBE }
        | { packetId: number; returnCodes: number[]; type: SUBACK }
        | { packetId: number; topicFilters: string[]; type: UNSUBSCRIBE }
        | { packetId: number; type: UNSUBACK }
        | { type: PINGREQ }
        | { type: PINGRESP }
        | { type: DISCONNECT }

    A decoded MQTT control packet, as a tag-on-type discriminated union.

    decodePacket returns one of these; branch on type (a PacketType) to read the packet-specific fields. Packets with no body beyond the fixed header (PINGREQ, PINGRESP, DISCONNECT) carry only their type.

    1.0.0