Bluetooth Communication using C# in Windows Forms apps in windows 7 - c#

Developing a WPF application using C# (.NET Framework 4.5)
I need to use native libraries (No 32Feet.NET suggestions please) to show the list of devices connected via bluetooth and then i need to identify respective COM port numbers.
I know that i can read COM ports using System.IO.Ports & System.ManagementObject namespaces once the device is connected via bluetooth.
The problem is, how to get the list of devices paired to desktop machine using Microsoft libraries?

Related

Unable to use SDK for Zebra Scanner model MC33

I'm developing a windows application with using scanner Zebra MC33.
There is SDK pack which is described here: https://www.zebra.com/us/en/support-downloads/software/developer-tools/scanner-sdk-for-android.html
But my model MC33 is not in a list of approved devices. And test desktop app (supply in pack with SDK) does not detect my device.
Can somebody recommed what to do and if Zebra inc. plan to release SDK for my device (MC33) as well?
UPDATE: during debug my app catch answer code
112 = "ERROR_DEVICE_UNAVAILABLE" = " Required device is unavailable"
I work for Zebra and would concur with the comments below your question. The SDK you are using is designed for our range of handheld rugged scanners but the MC33 is considered a Mobile Computer and uses a different SDK.
I don't quite understand what you are trying to achieve by I'm developing a windows application with using scanner Zebra MC33. That device runs Android so if you want to send scan data to an application running on Windows you will first need to capture those scans on the device and then send them (through IP or BT for example) to your Windows desktop app. There are a few ways to do this (https://techdocs.zebra.com/help/) is a good entry point - you could use DataWedge to send the data over IP or you could write an Android app to send the data over a BT socket. There is a Xamarin SDK for C# development on the device that is popular with Windows developers but I don't think you mean that.

How to write code to connect a hardware device to Android mobile using USB cable in XAMARIN

My organization build ARM chip based hardware devices. I am trying to connect those devices via USB OTG to Android devices (Phones, tablet).
I want to do it in C#.Net using XAMARIN. I found some examples in Java Android, but nothing in .Net language.
You can refer to Android.Hardware.Usb Namespace of xamarin:
Use UsbManager to access the state of USB and to communicate with connected hardware peripherals. Use UsbDevice to communicate with the hardware peripheral if the Android-powered device is acting as the USB host. Use UsbAccessory if the peripheral is acting as the USB host.
It's a pity that I couldn't find any official xamarin sample for USB communication, but here I found a lib and example demo which may be helpful for you:
usb-serial-for-xamarin-android.
However it is done via Java, the same work can be done via Xamarin.Android, you can refer to usb-serial-for-android, although this lib is for Java, you can follow the basic steps but use the Xamarin USB Serial for Android lib to enable USB communication in your app.

How to accept incoming bluetooth connection on Windows 7 desktop (with a c++ or c# program)

I am writing a BT app on an android to connect to a lab device/hardware. At the present time I have a device on loan. However it is not possible for me to always have one while I am developing for it, (commuting, out of town, etc) Therefore I am creating an emulator for it and will run that emulator on my Windows desktop so that my Android client code can make connections to it.
The android code is built with .NET/xamarin and works fine connecting to the real device.
I am comfortable with C++ or C# on the desktop.
I have found this code http://www.codeproject.com/Articles/252882/Bluetooth-Server-Programming-on-Windows online to create and accept BT connections. it looks like a very good start for what I wish to do - which is build a state machine/emulator to mimic the real device. However I have been unable to connect my android device to it.
Note - the connection is a serial port connection. (the UUI coming from the android device is the "well known" serial port connection ("00001101-0000-1000-8000-00805F9B34FB")
I am not sure how to configure the windows 7 desktop and bluetooth services to allow this server/emulator program to accept connections.
I have paired the devices, but unable to connect.
How can I accept incoming Bluetooth serial connections in the C++ or C# code running on Win7 desktop?
If you want to do low level stuff like establish a connection via bluetooth through a C# app then you will need to access the bluetooth stack via its API. If your device is running the Microsofts Bluetooth Stack then you can look at 32feet.net's managed wrapper for Microsofts Bluetooth API. If you have the Widcomm stack then you will have to locate Widcomm's API for it.
To access the microsoft bluetooth stack, you can use the BthUtil.dll.
BthUtil.dll is an unmanaged dll which is part of the Microsoft Bluetooth stack. It's typically utilised for tasks such as turning the bluetooth radio on or off via a function called BthSetMode
(see MSDN for documentation - http://msdn2.microsoft.com/EN-US/library/aa456007.aspx)
You can check the following links:-
http://www.youtube.com/watch?v=Jn05CU3mxzo
Also, check the 32feet.Net
A Brief description of 32feet.Net
32feet.NET is a shared-source project to make personal area networking technologies such as Bluetooth, Infrared (IrDA) and more, easily accessible from .NET code.
Supports desktop, mobile or embedded systems.
32feet.NET is free for commercial or non-commercial use.
If you use the binaries you can just use the library as-is, if you make modifications to the source you need to include the 32feet.NET License.txt document and ensure the file headers are not modified/removed. The project currently consists of the following libraries:-
Bluetooth
IrDA
Object Exchange
Bluetooth support requires a device with either the Microsoft, Widcomm, BlueSoleil, or Stonestreet One Bluetopia Bluetooth stack. Requires .NET Compact Framework v3.5 or above and Windows CE.NET 4.2 or above, or .NET Framework v3.5 for desktop Windows XP, Vista, 7 and 8.
Link
http://32feet.codeplex.com/
Feature link for 32feet.Net
http://32feet.codeplex.com/wikipage?title=Feature%20support%20table&referringTitle=Documentation

Symbian Windows Phone bluetooth communication

If wanted to communicate bluetooth messages between Symbian and Windows Phone using Qt and C# respectively,how would I go about it? What apis or classes would be able to communicate between the two platforms?
Windows Phone 7 does not provide us any public API to communicate by Bluetooth.
So, you can't write apps which work with Bluetooth devices.

Windows Phone 7\Silverlight SSH or Telnet library

Searching for some telnet or SSH libraries (C#) to using with Windows Phone 7.
At now moment I'm failed convert C# libraries like SharpSSH or Granados.
What existing libraries suatable for Windows Phone 7 or ideas how to convert SharpSSH?
Seems such library (in development) found - http://sshnet.codeplex.com/ (with version in development process for Windows Phone 7)
Windows Phone 7 doesn't provide socket support needed for such components to work. In our SecureBlackbox (which includes SSH client and server and has Windows Phone 7 version) we implemented Socket adapter class, which can be used for sending data over custom channels. If you can tunnel the data the way you need, then you can use our components. Until WP7 has support for sockets, there's no other option.

Categories

Resources