OS | Support |
---|---|
iOS | ✅ |
Android | ✅ |
Windows | ✅ |
Linux | ✅ |
Mac | ✅ |
libscanner_ble
library file for your operating system platform to your project.Initialize the SDK, callback
is the callback for device connection status.
registerEvent(`callback`)
Start scanning devices
startScan()
Stop scanning devices
stopScan()
Connect the device, mac
is the unique identifier of the device, callback
is the callback for scanning content of the connected device. The scanning content is encoded in UTF-8. If the scanning content is not encoded in UTF-8, it needs to be converted manually. For custom encoding, refer to the documentation.
connect(`mac`, `callback`)
Disconnect the device, mac
is the unique identifier of the device.
disconnect(`mac`)
Authorize the device, mac
is the unique identifier of the device. After successful device connection, the device needs to be authorized in order to use it properly.
auth(`mac`)
Get the battery level, mac
is the unique identifier of the device.
getBattery(`mac`)
Get the firmware version, mac
is the unique identifier of the device.
getFirmwareVersion(`mac`)
Get the software version, mac
is the unique identifier of the device.
getSoftwareVersion(`mac`)
Set the device name, mac
is the unique identifier of the device.
setName(`mac`, `name`)
Set the device time, mac
is the unique identifier of the device.
setTime(`mac`, `time`)
Reset to factory settings, mac
is the unique identifier of the device.
reset(`mac`)
Restart the device, mac
is the unique identifier of the device.
restart(`mac`)
Inventory mode settings, mac
is the unique identifier of the device.
// Clear inventory cache
inventoryClearCache(`mac`)
// Upload inventory data when connected via USB
inventoryUploadCache(`mac`)
// Upload the number of inventory cache when connected via USB
inventoryUploadCacheNumber(`mac`)
Barcode open settings, mac
is the unique identifier of the device.
// Open all barcodes
openAllCode(`mac`)
// Close all barcodes
closeAllCode(`mac`)
// Reset all barcodes to factory settings
resetAllCode(`mac`)
SDK Version
sdkVersion()
Set the configuration information, mac
is the unique identifier of the device, cmd
is a JSON string. For specific configuration information, refer to the documentation.
setSettingInfo(`mac`, `cmd`)
// Example
// Set the volume of the scanner
// `cmd` is a JSON string
setSettingInfo(`mac`, "[{ "value" : "0","area" : "3","name" : "volume" }]")
Get the configuration information, mac
is the unique identifier of the device.
getSettingInfo(`mac`)