Flex, get the USB ID of the connected USB device

I am developing an Adobe Flex application.

I need to detect gps devices when connected. This is currently a poor heuristic detection that is being used (it is trying to find specific files / directories). It uses StorageVolumeInfo to discover connected devices.

So, I would like to know if there is a way to get the USB ID using Flex.

thanks in advance

+6
source share
2 answers

Right now, no, you cannot do this initially in the air. However, you could use a third-party utility application to communicate with the device (java, C ++, etc.). USB Air USB controls will eventually come after Adobe has made a demonstration of using the xbox controller for the game.

I tried looking for a release date, but to no avail.

+5
source

I believe that the functionality you are looking for is only available in AIR. The following example shows all the names of connected devices at startup, and adds an event listener for devices connected at run time.

import mx.events.FlexEvent; private function onCreationComplete(e:FlexEvent):void{ StorageVolumeInfo.storageVolumeInfo.addEventListener(StorageVolumeChangeEvent.STORAGE_VOLUME_MOUNT,onMount); showCurrentlyConnectedVolumes(); } private function onMount(event:StorageVolumeChangeEvent):void{ trace(event.storageVolume.name); } private function showCurrentlyConnectedVolumes():void{ for each(var volume:StorageVolume in StorageVolumeInfo.storageVolumeInfo.getStorageVolumes()){ trace(volume.name); } } 

Greetings

+1
source

Source: https://habr.com/ru/post/888467/


All Articles