Interface MessageProvider

Message interface that any device or mock device must fulfill to integrate with Client.

export
interface

MessageProvider

Hierarchy

  • MessageProvider

Implemented by

Index

Methods

Methods

receive

  • receive(callback: (message: Message<any>) => void): void
  • Register the callback for when events from the device are received.

    memberof

    MessageProvider

    Parameters

    • callback: (message: Message<any>) => void

      Function to be called whenever a message is received from the device. Function should take Message as a parameter to receive the contents of the message.

        • Parameters

          Returns void

    Returns void

send

  • Sends the command and payload to the device or service responsible for handling events.

    memberof

    MessageProvider

    Parameters

    • command: string

      Command name used to route events to the correct device or service handler.

    • Optional payload: any

      Data to be used with the command by the device or service.

    Returns Promise<MessageSendResponse>

    A promise that contains the send message result once resolved.

2019, Amazon.com, Inc. or its affiliates. All Rights Reserved.