Can you manipulate web bluetooth chooser that shows after calling requestDevice()? - web-bluetooth

Can you manipulate web bluetooth chooser that shows after calling requestDevice()? Like getting the error message or the text displayed?

The chooser can only be manipulated by configuring the filter which controls which devices are shown to the user. The chooser serves as a security and privacy barrier, preventing a site from learning about the devices in the user's vicinity without their explicit permission. The one additional signal which is provided and may be useful for your application is navigator.bluetooth.getAvailability(). This method returns whether the user's device is capable of connecting to Bluetooth devices, but not whether the Bluetooth capability is turned on or there are any devices nearby. If the device is capable of connecting to Bluetooth devices but the adapter is disabled then the browser will guide the user through enabling it as part of the chooser prompt.

Related

Web page beacon

I would like to send a BLE Eddystone beacon from a web page. My application requires to send SSID info to a BLE listener. My thought is to have a user load a URL on a smartphone that would run JS to send periodic BLE Eddystone-UID beacons with SSID info embedded. I need the web page to work on both Android and iOS phones. Is there a simple way to do this using Javascript?
I looked into physical web but it did not seem to provide this capability.
thanks,
Ian
The current version of the Web Bluetooth API specification allows websites, running in the Central role, to connect to remote GATT Servers over a BLE connection. What you're looking for is a way to run in the Server role to advertise your data.
In your case, I'd recommend you have a look at https://www.npmjs.com/package/#abandonware/bleno

Windows does not answer BLE parameter update request

I have a custom embedded device with a Bluetooth low energy stack. The device is advertising itself until a connection is requested, I pair and connect to it via the Bluetooth menu in Windows 10, I can read/write to my custom GATT services using the following BLE GATT functions from the Win32 API.
For my application I need to receive high frequency data using notifications on a characteristic so I enable it using the same API as stated above and receive the correct data but too slow. The default connection parameters Windows is using is not enough and I want to update them so I can receive notification events at higher frequency, but Windows API does not provide such function. I had the same problem when connection to an Android phone, and I solved it by requesting connection parameters update from the device (the slave in the connection) and the Android phone accepted it and everything worked as expected.
The only problem is when I'm trying to ask for a connection parameter update from the device when connected to a Windows master, I don't receive any response (no accept nor reject), meanwhile I still receive notification events so I know the connection is still active. And the weird thing is that if I hold the device closer to the computer's Bluetooth antenna it does receive a response and update the connection parameters like intended.
Any idea what's going on? Is it a bug in Windows stack?
The fact that holding device closer to antenna helps should be verified. Try it multiple times in a different way.
You mentioned Android, does holding device further from Android also prevent connection parameters update?
If this proves true, I'd say the device is faulty. I would compare the behavior between different devices, better if they are from different manufacturers or at least models.

External Protocol Handlers and Modern Browsers

I've noticed that GitHub launched a new "Clone in Mac" button a couple of months ago, which - when clicked - perform an external protocol request:
github-mac://openRepo/REPOURL
Assuming I want to implement a similar feature for my application, I wonder:
how do buttons degrade if the user browser doesn't support external protocols
how to register the protocol handler without requiring user action. In other words, how do you tell browser X to use application GitHub.app in case of protocol github-mac, without asking the user to tweak the browser settings?
I can see in the above URL an openRepo action, which inform the application about the action to perform. What are the common strategies/patterns to dispatch these requests for a Mac application, so that github-mac://first does something different from github-mac://second?
Browsers differ in the way they handle new protocols.
Check documentation here where they have documented various Operating Systems.
http://kb.mozillazine.org/Register_protocol
Its actually trivial to register a new protocol in Windows and hook it to a executable. I have done this for some apps:
http://msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx
Also see
register a protocol on mac osx?

Send data from WP7 phone to PC via USB cable

I’d be interested in show data from wp7 sensors on a PC screen. Is it possible to send data back to the PC via the USB cable?
When the phone is plugged in via USB it appears as an Ethernet network connection to the device. This means it is easy enough to send data back to a service running on your machine using standard HTTP calls.
This is easily done by setting up a simple web service on your PC and generating a WCF proxy around it in Silverlight. You can then simply use it as you would any other web service.
If you are looking for lower level serial access to the USB itself, then unfortunately no the phone APIs don't expose that functionality.

disconnect to wifi programmatically

Could I disconnect to wifi programmatically in Cocoa?
For the Mac, see the CoreWLAN Framework. Specifically the disassociate method of CWInterface. On the iPhone (since you tagged this cocoa-touch), I believe this operation is restricted (ie, no supported API exists for applications to configure network connectivity).

Resources