Skip to main content

Scanner Events

Overview​

AladdinSDS 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 barcode scan events from connected devices.

The host and port follow the [http] section of the service configuration, see HTTP API Server. When TLS is enabled on the HTTP API, use the wss:// scheme instead of ws://.

Barcode Message Format​

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

Barcode Fields​

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 device status updates, including connection status and command execution results.

Status Message Format​

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

Status Fields​

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

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.