Skip to content

Events

The following events will be sent over the socket.

Connect Event

Sent when a device was successfully connected.

  • reconnect (boolean) True if this is a reconnect, false otherwise
{
    "type": "EVENT",
    "device": "E1:98:8B:41:2A:70",
    "event": {
        "name": "ConnectEvent",
        "data": {
          "reconnect": false
        }
    }
}

Disconnect Event

Disconnect events occur when a NIMMSTA Smart Watch gets disconnected for whatever reason. The returned event contains the reason of the disconnect.

  • reason (string) Reason for the disconnect.
{
  "type": "EVENT",
  "device": "E1:98:8B:41:2A:70",
  "event": {
    "name": "DisconnectEvent",
    "data": {
      "reason": "USER_INITIATED"
    }
  }
}

Device Found Event

Sent when scanning for devices is activated via the SearchForNimmstaDevices Request and a device has been found.

  • deviceName (string) HS 50
  • isConnectable (boolean) If you can connect to this device.
  • rssi (number) Signal strength
  • connectionCode (string) Connection code to connect to this device. Does not include connection prefix.
  • timeFound (string) UTC timestamp when this device was found.
{
    "type": "EVENT",
    "device": "E1:98:8B:41:2A:70",
    "event": {
        "name": "DeviceFound",
        "data": {
            "deviceName": "HS 50",
            "isConnectable": true,
            "rssi": -58,
            "connectionCode": "G2GZ9",
            "timeFound": "Tue, 23 Feb 2021 09:17:10 UTC"
        }
    }
}

Scan Event

Scan events happen when a user scans a barcode with the NIMMSTA Smart Watch. The event contains the scanned barcode string after rules are applied, if there are any.

Please be aware that barcodes are interpreted as WINDOWS-1252 by default. If you need another encoding, you have to decode the base64 string using the encoding your barcode uses.

  • barcode (string) Scanned barcode.
  • barcodeBytes (string) Base64 encoded barcode (can be of any encoding)
{
    "type": "EVENT",
    "device": "E1:98:8B:41:2A:70",
    "event": {
        "name": "ScanEvent",
        "data": {
            "barcode": "test123",
            "barcodeBytes": "dGVzdDEyMw=="
        }
    }
}

Touch Event

Touch events occur if a user touches the display of the NIMMSTA Smart Watch. The event contains the x and y coordinates of the touch location.

  • x (number) X coordinate.
  • y (number) Y coordinate.
{
  "type": "EVENT",
  "device": "E1:98:8B:41:2A:70",
  "event": {
    "name": "TouchEvent",
    "data": {
      "x": 0.0,
      "y": 0.0
    }
  }
}

Button Event

Button events occur if a user touches a button on the display of the NIMMSTA Smart Watch. The event contains the title of the button.

  • value (string) Name of the button that was clicked.
{
  "type": "EVENT",
  "device": "E1:98:8B:41:2A:70",
  "event": {
    "name": "ButtonEvent",
    "data": {
      "value": "button1"
    }
  }
}

Battery Level Changed Event

Battery Level Changed events occur if the percentage of the battery of the NIMMSTA Smart Watch changed.

  • batteryLevel (number) Current (new) battery level.
{
  "type": "EVENT",
  "device": "E1:98:8B:41:2A:70",
  "event": {
    "name": "BatteryLevelChanged",
    "data": {
      "batteryLevel": 99
    }
  }
}

Start Charging Event

Start Charging Events are triggered if the device is starting to charge the battery, for example if it has been placed on a charging pad.

  • batteryLevel (number) Current battery level.
{
  "type": "EVENT",
  "device": "E1:98:8B:41:2A:70",
  "event": {
    "name": "StartChargingEvent",
    "data": {
      "batteryLevel": 99
    }
  }
}

Stop Charging Event

Stop Charging Events are triggered if the device is stops charging the battery, for example if it has been removed from a charging pad.

  • batteryLevel (number) Current battery level.
{
  "type": "EVENT",
  "device": "E1:98:8B:41:2A:70",
  "event": {
    "name": "StopChargingEvent",
    "data": {
      "batteryLevel": 99
    }
  }
}

Trigger Event

Trigger Events occur when the user presses the trigger on the device (the trigger is the button used to scan barcodes).

{
  "type": "EVENT",
  "device": "E1:98:8B:41:2A:70",
  "event": {
    "name": "TriggerEvent"
  }
}

Double Trigger Event

Double Trigger Events occur when the user presses the trigger on the device twice in quick succession (the trigger is the button used to scan barcodes).

Note

Before receiving a DoubleTriggerEvent, you will always receive a TriggerEvent.

{
  "type": "EVENT",
  "device": "E1:98:8B:41:2A:70",
  "event": {
    "name": "DoubleTriggerEvent"
  }
}

Triple Trigger Event

Triple Trigger Events occur when the user presses the trigger on the device three times in quick succession (the trigger is the button used to scan barcodes).

Note

Before receiving a TripleTriggerEvent, you will always receive first a TriggerEvent and then a DoubleTriggerEvent.

{
  "type": "EVENT",
  "device": "E1:98:8B:41:2A:70",
  "event": {
    "name": "TripleTriggerEvent"
  }
}

Software Update Progress Event

If you start a software update with the Perform Software Update request, you will receive constant progress updates with this event.

Returns

  • isSending (boolean) True if the update is still sending, false otherwise.
  • progressPercent (number) Progress in percent (0-100).
  • remainingTimeInSec (number) Estimated remaining time in sec.
  • type (string) Software update type.
  • complete (boolean) True if the software update is complete, false otherwise.
{
  "type": "EVENT",
  "device": "E1:98:8B:41:2A:70",
  "event": {
    "name": "SoftwareUpdateProgress",
    "data": {
      "isSending": true,
      "progressPercent": 33,
      "remainingTimeInSec": 120,
      "type": "Bootloader",
      "complete": false
    }
  }
}