SocketMobile / capturesdk_flutter

Public snapshot for flutter sdk
MIT License
3 stars 1 forks source link

Receive Data Device Info #3

Closed Thembelani closed 1 year ago

Thembelani commented 2 years ago

Hi.

We are not receiving device information when deviceData gets triggered. Could we please include the device information for the device that performs the scan.

Screenshot 2022-06-07 at 04 17 17
mcsocket commented 2 years ago

Hi @Thembelani,

Currently the handle is present in onCaptureEvent and when the event corresponds to decodedData, the handle is the handle of the scanning device. If you're storing the devices in your app you can map that handle to corresponding device in the list.

In the example, we store all connected devices in the state value List<DeviceInfo> _devices = [];. Devices are added to this list after each deviceArrival event. This can be found in _openDeviceHelper. Devices are removed from the list following each deviceRemoval event. This can be found in _closeDeviceHelper.

We plan to incorporate the option for the developer to make use of a deviceList endpoint in a future release which will retrieve all of the devices with their associated scans in the future.

Let me know if you need anything else!