Bypassing connect bluetooth device permission in c# with windows 10 - c#

Context: I'm working on a Windows 10 app that will allow users to quickly connect to a Bluetooth device. Because the native API is difficult to work with, I'm using the 'In The Hand' library. Anyway, back to the point: whenever I make a connect request. Before allowing me to connect, I receive this Pair a device notification.
I'm wondering if I can set Windows to automatically accept this permission for connecting the device. Is there a method in the Windows API that I can use to accomplish this?
Here is the link to the code: https://github.com/hasham7861/bluetooth-le-experiment/blob/master/Program.cs
In the picture I make a connect request to a bluetooth headset and then I get the notification on the bottom right, and only if I click allow to pair device then it pairs the device.

I hope this link helps you.
I apologize in advance if I misunderstood the question or if the data were meaningless
Windows 10 Connect to Bluetooth Classic Device without Pairing
https://github.com/microsoft/Windows-universal-samples/blob/main/Samples/DeviceEnumerationAndPairing/cs/Scenario9_CustomPairDevice.xaml.cs

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...

Start inbuilt windows MobileHotspot when not connected to a WiFi network

I am trying to spin up mobile hotspot on a windows 10 laptop using a c# program.The requirement is similar to this, but I wont be able to use the NetworkOperatorTetheringManager class since it needs the device to be connected to a wifi network. The ConnectionProfile returned in the below program will be null if not connected to a network.
ConnectionProfile connectionProfile = Windows.Networking.Connectivity.NetworkInformation.GetInternetConnectionProfile();
NetworkOperatorTetheringManager tetheringManager = NetworkOperatorTetheringManager.CreateFromConnectionProfile(connectionProfile);
I know it is possible since there is an app on windows store, called Hotspot Lite which does this. It is possible to start a mobile hotspot using this app without having to be connected to a wifi network.
I am looking for a solution using the windows apis, more specifically using the Windows WiFiDirect api. Appreciate any answer pointing in the right direction.

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.

Serial Port Comm with Arduino Device from Windows Store C# App

I'm currently working on getting a Leonardo device recognized and communicating with my app over a serial port in C# for the Windows 8 App Store. I'm using http://msdn.microsoft.com/en-us/library/windows/hardware/dn312121(v=vs.85).aspx#step2 as a guide, in conjunction with http://code.msdn.microsoft.com/windowsapps/USB-CDC-Control-sample-5ba19caa to guide me.
I'm having problems however in the sense that my Arduino device isn't showing up despite me entering my PID/VID and Class/Subclass/Protocol so I feel I'm missing some steps and was hoping someone that has experience with this could point me to a more specific/granular example.
My device is an Arduino Leonardo and I'm running windows 8.1 using Visual Studio 2013 Ultimate, code is in C#
Any help is appreciated!
Just general thoughts on regular windows applications (not aware of W8 AppStore):
Might help or might not, in the second case, sorry for wasting your time...
To get a "regular COM" device in Windows, without any additional drivers, you should make the device appear as USB Communication Device Class (aka CDC) - this is, among others, done via the appropriate class/subclass/protocol. The VID/PID don't care. This means the device should provide CDC/ACM USB descriptors to the enumerating USB host (windows) and implement the required endpoints and commands - supposedly there is already something existing for your board and you downloaded the firmware to it, right? You might want to try to connect such configured device to windows and after successful enumeration, new COM port should appear. If you program regular application, you just connect to such COM port via SerialPort class instance, no matter it is provided via USB subsystem... If this works, you should be able to start the AppStore part (where I have no clue how to help).
I'm just going to answer this as not currently possible. I ended up writing a desktop WPF application using metro UI/UX guidelines. Between that and ClickOnce deployment the store app feel is fairly well recreated, despite the store being ideal.
I sincerely hope that Microsoft decides to support this in the near future, the Metro SDK is really nice and I would love to eventually port it.

Can I use the Bluetooth serial port in Windows Phone 7.1 and up?

I want to develop an app for the Windows Phone app store that communicates with my car's OBD2 port via Bluetooth.
Long story short, the app will use the bluetooth serial port to send a hex value and retrieve the corresponding value in the ECU's register. There's an android app called Torque which does this.
I can't figure out how to use the serial port though. The only bluetooth functionality mentioned is high-level stuff like pushing objects, pairing, etc. But nothing about setting baud rates or writing to a specific COM port.
Is this possible on WP7/*? Or alternatively, how can I make this possible and get my app approved for distribution?
UPDATE: I haven't been able to get my hands on a WP8 device yet, so I can't verify whether or not this is possible using SSP.
As a bonus note in case you came here looking for alternatives: you can also NOT connect to ad-hoc wifi connections, so the wife-based OBD2 adapters are no good either. There is an ugly way of connecting to the latter which involves having a laptop in your car which is simultaneously connected in ad-hoc mode the the device and is also acting as a wifi hotspot. It is utterly impractical.
Using the Bluetooth Serial Port (SSP) is not possible with public APIs of Windows Phone 7.x. As you've kind of guessed already, the app will likely not be approved for the marketplace if private APIs are P/invoked or otherwise used.
Consider upgrading to Windows Phone 8 as the Bluetooth SSP is partially available there, see Nokias Developer site for example.

Categories