Bridge connection between Hololens, Android and Haptic Vest to send events? - c#

I have an issue connecting my Unity application on Hololens to a (haptic vest) Bluetooth. The problem is there is no SDK for Hololens to connect to the Haptic vest.
**- I want to maintain a connection between my HoloLens unity app and the haptic vest but cannot figure out how.
There is an Android SDK for the Vest but I am confused about how to use it with my application. For example, I connect my Hololens to Android, and then I send events from my unity application to android to play a specific pattern because the android Bluetooth pairs with it only.
I read about sockets TCP or UDP connection but I have no idea how this can be achieved. I am not an advanced-level programmer but just a rookie.**
Please help me regarding this issue, been stuck now for a month...

Does the haptic vest only provide Android SDK? It is easier if there is an C# SDK.
However, it is possible If you want to have an Android device to host the bridge between HoloLens and the vest.
You may simply add a TCP/UDP Client on HoloLens. For the Android project, basically there are 2 things to do. Adding a TCP/UDP Server and implementing the haptic vest SDK. There are plenty of steps to build the system and the configuration steps for players may take long. The player needs to open Android app to pair the vest, then start TCP/UDP server. Then the player open HoloLens App, find the TCP/UDP server in the local network (maybe manually input IP address). The game starts when the connection is established.

Apar from HID and Audio devices, HoloLens 2 supports the following Bluetooth APIs:
GATT
Server and Client
RFCOMM
If your vest doesn't support accessing via the above APIs, you may need to refer to the previous answer to set up the connection. If you have further questions on HoloLens Bluetooth, you may submit a support ticket via http://aka.ms/hololenssupport

Related

Connecting two devices with different scenes

I'm implementing a game in Unity and I have a problem that I need advise for. I want to connect a tablet and a computer. The scene that is on the computer is supposed so send an event once an object is collected so that a special scene can be shown on the tablet. So based on what is happening on the computer there is a different scene shown on the tablet.
I only have no idea how to achieve that.
First, you need to create 2 different applications (for desktop and mobile). Second, you need to determine what protocol you want to connect desktop app and mobile app. The easiest way to implement this I think by using WebSocket/internet but not HTTP. Yes, you need to write code for the backend so it likes creating 3 different apps. But you can use firebase to simplify this process.
I recommended you use firestore from firebase. Connect booth app to firestore. When desktop app sends data to firestore, firebase will automatically notify mobile app and send that data. But you need to figure out yourself how to pair a desktop app and a mobile app otherwise, your firestore will receive data from all connected desktop app and send the same data to all connected mobile app.
This tutorial to use firestore:
https://www.youtube.com/watch?v=b5h1bVGhuRk
But before that, you need to add firebase to your project before you add firestore:
https://firebase.google.com/docs/unity/setup
You can use any wireless protocol available. You can even use Bluetooth if you want your app offline. But I don't know how to use Bluetooth...

Discover Nearby Smartphone Devices on Android

Problem Statement
I am trying to make an application for Android that can detect nearby smartphone devices. I need to discover smartphone devices regardless of their connection to a WLAN or their operating system. The only requirement is that their bluetooth or wifi setting is enabled. I am trying to capture the MAC Address and maybe RSSI of these devices. An example of an application I am trying to emulate is Meshlium.
Methods Already Considered
Android Classic Bluetooth:
I have followed the guide to discover devices that aren't currently paired with my device.
The smartphones I am trying to discover need to be in "discovery" mode in order to be found. For most modern phones that means they need to be on their bluetooth settings page.
Android P2P (Wifi Direct):
I have followed the guide again and can't discover smartphones nearby.
Similar to bluetooth, both devices (mine and the device I am trying to find) need to be both trying to discover wifi direct devices.
Also it seems iOS doesn't support wifi direct anyways.
Google Nearby:
Nearby Connections works only with devices running an application that is using the nearby connections api. So only devices with the app currently running the advertising or discovery feature will be available for detection.
Wifi Network Service Discovery:
This lets me see devices that are currently advertising services on a network and not the actual devices themselves.
Device Specifications
The device I am using is running android version 6.0.1 and Model number rk3368-box. The device also has root permissions.
Question
Is there a way on my android device to discover the nearby smartphones with the only requirement being their wifi or bluetooth is enabled? Perhaps packet sniffing the probe requests of the devices? I have researched packet sniffing but can't find any solid resources for Android. Also I would love to be able to do so in c# and Xamarin.Android if possible.
Update
Is a custom ROM an option? I am not looking to make an application for the play store, but one for custom hardware. Perhaps when I enable the wifi hotspot on the device it logs the probe requests from the devices nearby and saves as a file to export later?
There is no way to do this. And there shouldn't be- unless I'm working with you (in which case multiple of the above will work) its a massive invasion of my privacy for you to be able to detect my device.
If you are able to find mac address for WLAN adaptor of a device than try to search for bluetooth devices having mac address same as WLAN adaptor but last digit changed by 1.
This way you can find a Bluetooth device even if it's visibility is hidden

Windows iot/apps Programmatic Bluetooth Pairing

I'm trying to broadcast a bluetooth signal from a Raspberry Pi 2 running Windows Iot Core so that I can connect to it from smartphones and other devices, but I've been stuck for the last couple days on actually receiving a pairing signal.
Using the Windows Bluetooth docs I am able to broadcast the signal and I can see it from my desktop as well as from my phone.
However, this is as far as I can get. I want to be able to pair without a PIN (the device will not have a screen), but the pairing fails any time the device is selected.
I am using
SocketProtectionLevel.BluetoothEncryptionAllowNullAuthentication
and
DevicePairingKinds.None
But the connection callback is never hit. I have looked at many similar questions that are either unanswered or do not have the appropriate information since I am using an RPI2 and not a desktop app.
I am not looking to pair via the web interface, but simply through code
.
[UPDATE]
I've tried the 32feet.NET library but it appears to be too old to support the PI2.
I also tried a few NuGet packages, nothing seems to work yet.
I am not master in IoT but recently, I have started exploring it so I know Raspberry Pi 2 is hardware and we can use it to develop some basic IoT device/concepts. I can not help you with the code but may be with some idea.
I remember, for making any embedded system, we used serial port of pc and transferred command to devices. Something similar I found in one of the tutorial from David Jones. It is about to connect Bluetooth to windows 10 using serial port.
In both the explanations, SPP (Serial Port Profile) is used and also Universal Windows App is referenced. May be you get some start point or spark to comlete you work.
Check this and this. It also uses RPi 2.

Bluetooth connection with Unity 3D c#

For a medical application I have sensors that can send (HEX) data over Bluetooth. I would like to use this data in Unity to give visual feedback to users. I already have a working Bluetooth connection via Serial Port but the Program should search and connect the device dynamically. I also build a Visual Studio application by using the 32feet.net API and it works fine. But it should work with Unity in C#. Is there an API like the 32feet.net in VS for Unity? I am not sure if the 32feet.net API runs with Unity as well, but I was not able to make it work. If there is a documentation how to implement 32feet in Unity it would be great. Otherwise I need another opportunity to communicate with my bluetooth device (except using serial port).
EDIT: SocketException: An address incompatible with the requested protocol was used.

can c# be used for communicating mobile and pc?

As a minor project in my degree I would like to communicate mobile and pc .I am interested to communicate through bluetooth is it possible to do so in c#?
If possible please provide me list of application or hardware i would requiere in order to do so.
thanks in advance
If (and it's a big if based on the lack of information in your question) you mean "How do I write an app on my PC, using C#, that can communicate with a Windows Mobile device that is connected to my PC via ActiveSync or WMDC" then the answer is RAPI. A free, open-source managed wrapper for it is here.
Yes its possible if its with windows mobile phone or pocket pc with bluetooth. You need a bluetooth enabled computer and mobile phone. For dev you need to download the windows mobile 6 sdk.
Then developing of the communication between desktop app and mobile phone app, you can use the 32feet.Net is open source.
When you download it and installs (well it unpacks to program files folder) you will have the dll that you make reference to in Visual Studio. Also you will get some sample apps. One of them is a Bluetooth Chat that works in Desktop, Pocket PC and SmartPhone.
Another option you could use is set up a web service that acts like an intermediary between the device and your machine. One huge benefit of this is that no longer are you bound by the distance requirements of bluetooth.
Of course if you're trying to build some sort of proximity service (do z when item x is 3 meters from item y) then bluetooth is probably the way to go.

Categories