Options
All
  • Public
  • Public/Protected
  • All
Menu

External module scripts/bg/msgClient

Manage messaging endpoint of the the GAE server

Index

Variables

Const ERR_NO_DEVICES

ERR_NO_DEVICES: "No other devices are registered" = "No other devices are registered"

Starting portion of server error indicating no other registered devices

Const MAX_MSG_LEN

MAX_MSG_LEN: 4096 = 4096

Max message length. Server may reduce it more

Const MAX_NO_DEVICES_CT

MAX_NO_DEVICES_CT: 10 = 10

Max number of no device errors before turning off push to devices

Const URL_BASE

URL_BASE: string = `${Gae.GAE_ROOT}/messaging/v1/send/`

Base path of MessagingEndpoint

Functions

getData

  • getData(action: string, body: string): IGaeMsg

getDevice

  • getDevice(): object

sendClipItem

  • sendClipItem(clipItem: ClipItem): Promise<void>

sendDeviceAdded

  • sendDeviceAdded(): Promise<void>

sendDeviceRemoved

  • sendDeviceRemoved(): Promise<void>

sendFailed

  • sendFailed(err: Error): void

sendMessage

  • Send the message to the server for delivery to our remote {@link Devices}

    throws

    If an error occurred

    Parameters

    • data: IGaeMsg

      data packet

    • notify: boolean

      display notification if true

    • Default value type: INotifyType | null = null

      notification type

    Returns Promise<void>

sendPing

  • sendPing(): Promise<void>

sendPingResponse

  • sendPingResponse(srcRegId: string): Promise<void>

Object literals

Const ACTION

ACTION: object

Message actions

DEVICE_ADDED

DEVICE_ADDED: string = "add_our_device"

Remove our Device

DEVICE_REMOVED

DEVICE_REMOVED: string = "remove_our_device"

Add our our Device

MESSAGE

MESSAGE: string = "m"

A message saw sent

PING

PING: string = "ping_others"

Pinged remote Device's

PING_RESPONSE

PING_RESPONSE: string = "respond_to_ping"

Respond to PING action

Const BODY

BODY: object

Message responses

DEVICE_ADDED

DEVICE_ADDED: string = "New device added"

DEVICE_REMOVED

DEVICE_REMOVED: string = "Device removed"

PING

PING: string = "Contacting other devices..."

PING_RESPONSE

PING_RESPONSE: string = "Device is online"

Generated using TypeDoc