edgeport - v1.0.3
    Preparing search index...

    Function encodeUnsubscribe

    • Encodes an UNSUBSCRIBE packet.

      Begins with the packet identifier, then a list of topic filters to remove. The fixed-header flags nibble is the spec-mandated 0x2.

      Parameters

      • packetId: number

        A non-zero packet identifier the matching UNSUBACK will echo.

      • topicFilters: string[]

        One or more topic filters to unsubscribe from.

      Returns Uint8Array

      The UNSUBSCRIBE bytes.

      If no topic filters are supplied.

      1.0.0

      import { encodeUnsubscribe } from 'edgeport/mqtt';

      const bytes = encodeUnsubscribe(2, ['sensors/+/temp']);