Is it possible to connect to multiple BLE devices using web-bluetooth? - web-bluetooth

The specification for the web-bluetooth is not clear in indicating whether it is possible to connect to multiple devices simultaneously.
The navigator.bluetooth.requestDevice() accepts set of filters and returns a promise when one of the device is selected from the pop-up.
I couldnt find a way to silently connect and listen to all devices matching the given filter.
Does anybody know if this is possible and if yes, could point me to some example?

From my experience, it is possible to connect multiple BLE devices with web-bluetooth. However, it is impossible to connect to a BLE device silently or connect to multiple BLE devices simultaneously. You have to connect to them one by one.
There is a link on web-bluetooth sources discussing about that:
https://github.com/WebBluetoothCG/web-bluetooth/issues/42
Hope I answered your question.

Related

Route websocket data through USB link to PC client (Android)

I have an issue where WiFi is not available on an Android device. We want to stream image data from the device using a websocket server (written using WebSocket++) through to the PC. However, I'm not sure if this is possible without operational WiFi. So, the position we are in is that we may only have the USB link available.
Someone today suggested we might be able to get Websockets working using adb port forwarding (see https://developer.android.com/studio/command-line/adb#forwardports), but I'm not sure if that's correct. Could this work, and what would that solution look like?
Are there any other reasonable options. I'm not certain if tethering is available on the device and if that could be another solution?

How can I find, is any wifi router connected in my network

I am trying to develop an application for network monitoring. A part of this application is to detect "is any wifi router connected to any switches ports".
Basically, I have a mysql database table where I have all the mac addresses of devices(pc,wifi router,..) connected to each switch port(by SNMP). As far I know, first three bytes of mac address (Organizationally Unique Identifier - OUI) represent the vendor/manufacturer of the device. So, I want to make a list of all known vendors who manufacture wifi routers (Linksys,TP-LINK,Netgear,SMC,..) and make a match with the OUI to the mac addresses stored in database.
Q1. Is the solution correct? or what would be the appropriate way to solve this problem.
It would be a great help if any one suggest me what should be the appropriate way.
Thanks in advance
No, this is not an appropriate solution. For example, macOS allows a Macintosh to act as a Wi-Fi router via the Internet Sharing feature, but its Ethernet MAC address will still just have a regular Apple vendor prefix.
As already stated by Gordon Davisson you will be missing "Internet sharing"-constructions, so your results will be incomplete (i.e. False Negatives).
Another source of False Negatives could be wireless routers using NICs from a large generic vendor (think Intel).
Besides that; the OUI will tell you what the device's vendor is, but NOT what kind of device it is. It could, for instance, be a WIRED router, leading to results which are not, in fact, wireless routers (i.e. False Positives).
The big pain in the behind for your problem is that what you are trying to detect; a (wireless) router; shields certain data-traffic from clients behind from means of identification that would aid you in your query.

iBeacon: can broadcaster iOS device get notified if client receives a beacon or enters its region?

I have two iOS devices; one is sending beacons using peripheralManager, beaconPeripheralData, etc. The second, a receiver device, is currently scanning for regions and beacons of the same UUID using didEnterRegion, didRangeBeacons, etc.
Is there any method or callback for the -broadcaster- side to know if the scanning side has entered its region or received its beacon? Something similar to "didEnterRegion", but for the broadcaster.
Thanks.
Simple answer - no.
Not so simple answer - clients don't connect to the "broadcaster", they just listen for advertisements, so there is no way for "broadcasters" to identify who has "heard" them.
Vladimir's answer is correct. However, you can set up your "broadcaster" (advertiser, in BLE terms) to also listen for other BLE devices that are advertising services, or sending out iBeacon broadcasts.
Then you would set up the remote receiving iOS app to execute special code when it gets a didEnterRegion call. That code could start advertising a pre-defined BLE service that your "broadcaster" is already listening for, and the two devices could then enter into a 2-way BLE conversation.
More simply, your receiver could simply start sending it's own beacon signal when it gets a didEnterRegion message as a result of detecting the "broadcaster"'s beacon signal.
You can do this is you just use CoreBluetooth CBCentral and CBPeripheral rather than trying to be an iBeacon (which encourages non-connectability).
While there is no standard way for a broadcaster or peripheral to automatically know who's found it you can do this by having an service and characteristic on your iOS peripheral. You could have your central scan for a particular UUID and when it finds it, have it connect and write an attribute, and then disconnect. This would give your peripheral information about who saw it.
This avoids the issue where you try to toggle between one device being a broadcaster and a central, since you can't be both of them at the same time.

How to detect Network type on Win Mobile

I spend lot of time searching how to determine the current network type such as WIFI, 3G, Ethernet.
But I cannot find any information online in windows platform.
I want to detect the Ethernet network type, but I cannot find any API that can retrieve the network type.
I've find Connection Manager for keyword but there's less information.
Did anyone have any idea?
Please help me...I was blocked by this for 2 weeks.
Thanks.
Look in the registry key HKLM\system\state\connections, there is are entries for each of the possible network types, for instance:
When connected to a wireless network:
[HKLM\system\state\Connections\Network]
Adapters="BCMSDDHD1"
Count=dword:00000001
Descriptions="Business World"
when connected to activesync:
[HKLM\system\state\Connections\Desktop]
Adapters=""
Count=dword:00000001
Descriptions="CurrentDTPTNetwork"
The Count value under HKLM\system\state\connections gives you the total number of active connections.
In HKLM\system\state\Hardware you can find the current power state of the various devices.
There is an API on Windows Mobile that makes it easier to access these values vs. going directly to the registry. See the SystemState class documentation, specifically the ConnectionsNetworkCount and ConnectionsCount properties.

Looking for a GSM modem advice

My application communicates with several GSM electric controllers, that means that I have to send anywhere between one to twenty messages every few hours. right now I'm working with HUAWEI Mobile Connect - 3G. it is a USB device that uses a comm port for the pc communication and I'm using GSMComm to send messages and read/delete messages from the device.
Every two seconds I'm checking the device's storage, and if there is any message, I will then read it and store it locally and then clear the device's storage. I'm not sure if I'm working correctly, but it seems to me as if it is a very unreliable device:
Every time I boot my machine, I must remove the device from the USB or my machine will get stuck at the BIOS start up screen (or whatever the name is).
Very frequently the comm port can become unavailable for some reason. I have to close and re open the port, and at times that may not even help.
In the production machine of my client, when he uses one of his software's that utilize the first comm port, he will get a warning message from the software about problems in the port if the device is plugged in (the device port is around 28 or something).
If you've been using a device which you consider reliable, or have been working with the same device as I work with, or you just think that I'm doing it wrong, I'd like to get an advice from you.
Thanks.
This sounds like an issue with your modem. Have you tried any other models? Consumer USB models tend to be unreliable. The preferred method, though slightly more expensive, is using a commercial grade modem in situations where you need the reliability.
Some modems to look at:
Wavecom Fastrack
Sierra Wireless Airlink
These use a serial port or ethernet to communicate with the host which is far more reliable. Serial ports may not be available in your particular situation but even a USB to RS232 adapter will be more reliable.
One further option is to use a smartphone, there are several applications that you can act as a gateway through HTTP.
SMS Gateway for Android:
https://market.android.com/details?id=eu.apksoft.android.smsgateway&hl=en
i have not used this method, but it seems like some people are having luck with it. it may not be any more reliable then your USB modem though.
Hope that answers your question.
I have used WaveCom's modem for sending messages in bulks and found it to be reliable. One difference though, in my implementation was i used Kannel as an SMSC, so my queues were automatically handled by Kannel. But sending multiple requests like 40+ per minute didnt pose any problems for me.
Hope this helps.

Resources