cross browser extension to take data from a usb and display - google-chrome-extension

I am starting to work on a browser extension that can take data from a usb and then display the data to the user. I am in early stages and researching about web to usb comms.
I am struggling to find out if I will be able to use webUSB API (as I want it to be used on most browsers) or if there are any alternatives. Any help or direction would be appreciated.
I have just been researching and unable to find any concrete answers

Related

Create MediaSource from AudioPlaybackConnection

I'm trying to make my windows computer a valid output for bluetooth audio from my phone. Enabling the actual audio was easy enough using the winrt AudioPlaybackConnection, but I'm trying to get metadata working and running into dead ends in the Windows UWP documentation. I'm familiar with the MediaPlayer class, but I can't see how to set the source to the AudioPlaybackConnection. My next thought was to create a MediaPlayer and handle the controls/metadata myself, but I can't see how to access the metadata for the AudioPlaybackConnection either. I tried getting the BluetoothDevice matching the same phone since I see the properties for the actual device list AVRCP Transport and A2DP SNK as two separate hardware "devices" making up the phone device, but I have no more luck accessing metadata with the BluetoothDevice. I know Windows 10 supports Bluetooth's AVRCP and can handle metadata/controls (source), but I'm beginning to think it's under a different device in winrt and I don't have the winrt know-how to track it down.
I've consulted the Bluetooth team about this. But currently, control like this is not supported in Windows at this time. You could submit a feature request about this in the Feedback Hub. Please select Developer Platform->API Feedback as the category when you submit your request. The related team will check the request.

webUSB Relay Driver hardware

Over the last couple of years I have been looking for an easy way to control a few relays from Javascript. I want to build a web App to control starting sequence horns for sailing races.
I recently discovered webUSB and it seems like exactly what I need. A direct connection from JS in chrome to the USB world. Simple coding in a language I already use.
On the hardware side I am having trouble finding a product that is compatible. Googling USB Relay finds 100's of products that all seem to rely on some proprietary SW for the OS. I can find lots of educational demo's that turn an LED on and off.
Does anyone have any ideas where to find such a product?
While I'm sure you will be able to find USB relays that can be controlled via WebUSB, most USB relays will probably come with some kind of serial port driver, e.g. https://numato.com/product/1-channel-usb-powered-relay-module uses a CDC serial port driver. These can be controlled using Web Serial, available in Chrome 77 and later behind a feature flag. For a tutorial, see https://codelabs.developers.google.com/codelabs/web-serial/
Explainer: https://github.com/WICG/serial/blob/gh-pages/EXPLAINER.md
API docs: https://wicg.github.io/serial/
If you search for "5V USB Relay Programmable Computer Control For Smart Home" on eBay, you will also find low-cost relays that use HID instead. The advantage of these is that you don't need any serial port or USB drivers, as it will use the operating system's built-in HID drivers. For that you can use WebHID. For more info, see https://github.com/robatwilliams/awesome-webhid.

NFC handover to Bluetooth or WiFi for data transfer

I'm currently working on a project for an interactive visitor centre in Laguna Beach, CA.
There are many touchscreen devices around the space, which we are developing some cool software for, however one of the client requests is to allow visitors to transfer image, pdf and video files from an interactive coffee table touchscreen onto their phone.
The client has seen this on YouTube/CES etc.. You know, where someone puts a phone on a the interactive surface and then magically swipes images onto the phone from the screen.
Of course, if the visitor had a custom app on their phone, and was already on the same WiFi this would not be so much of a problem. I suspect this is what happens on these magic demos that we see.
In our situation, we don't want the visitor to download an app really, we just want the easiest solution and experience for the visitor. We have a public WiFi available to us, and we can install an NFC device on the touchscreen and the touchscreen also has bluetooth.
My ideal scenario would be for the user to pop their NFC enabled phone on the table, the table recognises it, pairs with BT or WiFi and away we go! I'm not sure how practical this is though having researched around. Clearly thats not going to work on an iPhone. I don't mind a couple of mechanisms i.e. one for Android/other NFC phones and one for iPhone.
Does anyone have any experience of this kind of thing and suggestions of how to handle it?!
Here's a mock up of our 32" Coffee Table touchscreen just for some context
Thanks for reading through and having a think :-)
I know that there is standardized way to pair Bluetooth device using NFC tag. I think this is the best solution for you. The authority that is standardizing this format is called NFC Forum. You can find more info about the topic in this document: Bluetooth Secure Simple Pairing Using NFC

Record audio from various internal devices in Android (via undocumented API)

I was wondering whether it is possible to capture audio data from other sources like the system out, FM radio, bluetooth headset, etc. I'm particularly interested in capturing audio from the FM radio and already investigated all possibilities including trying to sniff the raw bluetooth communication between the phone and the radio device with no luck. It's too bad Android only allows recording audio from the MIC.
I've looked at the Android source code and couldn't find a backdoor to allow me to do that without rooting the device. Do you, at least, have any idea how to use other devices (maybe access somehow /dev/audio) say via NDK or even better - Java (maybe Reflection?) to trick the system to capture the audio stream from say, the FM radio. (in my case I'm trying to develop the app for the HTC Desire)
PS. And for those of you who are against using undocumented APIs, please don't post here - I'm writing an app that will be for my personal use or even if I ever publish it I will warn the user of possible incompatibilities.
I've spent quite some time deciphering the audio stack, and I think you may try to hijack libaudio. You'll have trouble speaking directly to the hardware (/dev/*) because many devices use proprietary audio drivers. There's no rule in this regard.
However, the audio hardware abstraction layer (HAL) provided by /system/lib/libaudio.so should expose the API described at http://source.android.com/porting/audio.html
The Android system, and especially audioflinger, uses this libaudio HAL to find available devices, deal with routing, and of course to read/write PCM data.
So, you could hijack the interaction between audioflinger and libaudio, by renaming the later, and providing your own libaudio which decorates the real one. Doing so, you should be able to log what happens and very possibly intercept FM radio output, provided that this is not directly handled by the hardware.
Of course, all this requires rooting. Please comment if you manage to do this, that interests me.

Is there a way to enumerate the video devices on a Java ME phone?

I recently downloaded a barcode reading application for my phone, an LG KU990i (AKA the Viewty) However, there's a problem that renders the application nearly useless: the Viewty has 2 cameras -- the main one, and a secondary camera located on the face of the unit -- and it is the secondary camera that is unfortunately set as the phone's default video capture device. As you can't point the secondary at anything and see what it's pointing at at the same time, it makes it a bit difficult to snap a barcode!
According to the JSR-135 spec, it is possible to specify a video capture device other than the default... if you know the device name. This does not appear to be documented anywhere on LG's Web site, nor does the JSR-135 spec describe any way of enumerating the devices on a phone... or is there? Failing that, are there any naming conventions for video devices commonly in use that LG might be using?
I've logged a ticket with LG, but as it's an old device, I don't imagine them breaking their backs in getting back to me... I should also point out that this is purely for my own curiosity so no-one here should feel obliged to break their backs either!
As far as I know there is no way to get list of all available catpure:// urls.
All urls I know:
capture://image,
capture://video
capture://devcam0
capture://devcam1
Source:
http://www.forum.nokia.com/info/sw.nokia.com/id/bc00e4ce-7df3-4527-962c-d39843a808d0/MIDP_Mobile_Media_API_Support_In_Nokia_Devices_v1_0_en.pdf.html
LG responded to my support ticket. Apparently, it's not possible to access the primary camera on the Viewty from Java, making it pretty much useless for barcode scanning. Answer reproduced here for search engines.
You support ticket has been answered. Please visit the LG Mobile Developer Network and login to check the answer at [My Page > My Tickets].
KU990i default video capture device is the secondary camera
Answer :
Hi,
KU990i have to Two camera module
differently.
Main camera using Joran chipset and
sub(front camera) using Qualcomm
chipset.
Joran chip doesn’t supported JSR135.
Therefore, we couldn’t supported to
the JSR135 using for main camera.
(it is H/W limitation)
It was inform to operator already and
we remember operator was confirm it.
So that, we only supported sub camera
for JSR135.
BR,

Resources