Skip to main content

Scanner Events

Overview

Aladdin SDS provides real-time websocket endpoints for subscribing to device events. This allows applications to receive immediate notifications when barcodes are scanned or device status changes occur.

WebSocket Endpoints

Subscribe to Barcode Events

Endpoint: ws://localhost:9000/sub_barcode

Subscribe to this websocket endpoint to receive real-time barcode scan events from connected devices.

Message Format

{
"deviceID": "12345",
"content": "ABC123",
"message": "ABC123"
}

Fields Description

FieldTypeDescription
deviceIDstringUnique identifier of the device that scanned the barcode
contentstringThe actual barcode content that was scanned
messagestringHuman-readable message containing the barcode data

Subscribe to Status Events

Endpoint: ws://localhost:9000/sub_status

Subscribe to this WebSocket endpoint to receive real-time device status updates, including connection status and command execution results.

Message Format

{
"deviceID": "12345",
"message": "Device connected",
"value": {
"id": "12345",
"connected": true
},
"eventType": "DEVICE_CONNECTION_STATUS"
}

Fields Description

FieldTypeDescription
deviceIDstringUnique identifier of the device
messagestringHuman-readable status message
valueobjectStructured data containing status details
value.idstringDevice identifier
value.connectedbooleanDevice connection status
eventTypestringType of status event (see Event Types below)

Event Types

Event TypeDescription
UPDATE_STATUSGeneral status update from the device
DEVICE_CONNECTION_STATUSDevice connection/disconnection events

For more detailed information about the WebSocket API specification, see the Aladdin SDS WebSocket AsyncAPI documentation.