I am new to this business and I want to make an application related to Bluetooth LE. I don't know where to start, I want to do it using a library. I searched libraries such as 32feet.Net, InTheHand.BluetoothLe, Plugin.BluetoothLe, ble.net but I could not figure out how to make a windows form app or what can I do and where to start. Can anyone help?
Bluetooth on windows has always been difficult with very few examples to learn from.
I think the most up to date way is probably to make a UWP application and use the Windows.Devices namespace. I've never tried it that way though.
There are examples of this here: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothLE
If you want to use 32feet.net, you will find some sample code in an old question of mine here:
Bluetooth Pairing (SSP) on Windows 10 with 32feet.NET
I got the basics of searching for devices working, but never got the pairing to work how I wanted, and the question never got an answer despite someone placing a bounty on it. Hopefully it at least puts you on the right path.
Related
I'm trying to build a simple program (in C#) to send messages over Skype and tried to used Skype4Com. However, I found out, as here: https://support.skype.com/en/faq/FA12384/how-does-my-3rd-party-application-work-with-skype-and-how-will-changes-to-skype-impact-my-3rd-party-application, that since the library has been discontinued it no longer works for sending a message. In trying to find an alternative for this, I've found a number of other SDKs which Skype offer - such as their Bot SDK, but they all offer far more abilities than I require.
What's the best SDK to use to produce a simple program to send messages over Skype?
Thanks in advance.
This has now become a common problem, but luckily, there is a workaround that solves the problems being caused by the discontinuation of Skype's Desktop API.
Skype.Client.OpenMessageDialog(Skype username here, Message you want to send here);
Skype.Client.Focus();
Sendkeys.Send("{ENTER}")
Note: The above will bring the Skype client into focus so it cannot be ran completely in the background, unfortunately.
You can see a demonstration here: How To: Fix Skype4Com SendMessage Problem!
I'm trying to write code to access the camera function of a Windows 8 tablet in a WPF application.
The threads I've found all seem to point to using DirectShow.Net or MediaKit. Neither of these projects have been updated in over 3 years. Is still the best way to go or are there any other ideas on how to do it?
I'm going to answer my own question here.
From what I've found, in Windows 8, you should be using the Windows.Media namespace's MediaCapture class to do it. DirectShow and MediaKit are for legacy systems.
I am in the middle of getting this to work, but in case anyone needs help, here's the best sample I've found so far:
http://blogs.msdn.com/b/eternalcoding/archive/2013/10/29/how-to-use-specific-winrt-api-from-desktop-apps-capturing-a-photo-using-your-webcam-into-a-wpf-app.aspx
I'm developping a SmartDevice application (Pocket PC 2003 template) in C# for a device with Windows Mobile 6.1. I need to use the camera of this device (photos, video); to do this work i tried using the CameraCaptureDialog class but it does not work for Pocket PC applications.
So, I documented on the internet and found that I probably refer to DirectShow API, but the problem is that I do not know where to start because I can't found a working/correct example.
My questions:
Is this the right way? Are there alternatives?
Where I can find a very good example that shows how to do this work?
You may try directshowbetcf: http://alexmogurenko.com/blog/directshownetcf/ if you really want to go with DirectShow and NetCF.
There's plenty of examples of directshow on the web. There is a site dedicated to converting the API over to C# which makes it a lot easier, maybe this was it http://directshownet.sourceforge.net/about.html. I struggled with DirectShow until I read the book "programming directshow" from microsoft press. About a third of that way through that book it all seemed incredibly easy and I was able to complete what I wanted. In the end it's a lot like referencing any library and using the classes from within that library. The added difficulty is that you need to add wrappers because they are all COM objects but that has been done for you.
This might be useful to you to understand the DirectShow technology. Basically gives a start to DirctShow and explains some of the important points. But its C++ not C#. Hope this help
Basic Video Capture
DirectShow is the video capture API in Windows Mobile 6. There is a Video Capture Filter there and all in all things are designed pretty much the same way they are in Windows.
The problem is that however that this is a native API, and not just in Windows Mobile. To develop in C# you need some bindings and they are missing. On desktop there is DirectShow.NET, which is a missing piece, but it does not seem to fit well for CE. Yet you still need to fill this gap in Windows Mobile.
To work it around you have a few ways, the first would be to go through DirectShow.NET and update it appropriately to start working on your device, strip parts missing in mobile OS etc. This would get you a twin for DS.NET but for mobile operating system.
Another option would be to do some C++ development and implement the minimal sufficient feature set in that domain, exposing the component via COM. Then you will reference this from managed code and things will get connected together. And another obvious option would be to use a third party solution which already does one of the mentioned above.
I've been at it for a month, and still can't find a solution to this deceptively difficult problem. Specifically, I would like to read temperatures from the W83793 chip, using C#, on a Windows machine. I have virtually no experience with low-level programming. All I know is that in order to read from this chip, I need to access the SMBus, and that alone will get me started.
Despite going through every SMBus document I could find online, I am still clueless as to how I should start. I searched for C# SMBus libraries online, but couldn't find anything aside from a few Linux related documents. I don't want to re-invent the wheel here. There's got to be a library, a tutorial, or other resource out there to explain exactly how to access the SMBus in C# on Windows.
What is a simple way to access the SMBus in C#? If you can help me out to the point where I can pull SOME value, ANY value, out of a slave device on the SMBus, that will get me started.
Look at OpenHardware monitor. It will have code dealing with that already.
Else use WinRing0, if you feel adventurous. :) You would normally access the smbus via ISA port IIRC. (I did this previously before I discovered OpenHardwareMonitor, a very fun exercise).
A helpful tool is called 'ReadWriteEverthing' for poking at all kinds of hardware ports. Expect blue screens or freezes :)
Have you looked at the Windows Driver Kit? Searching around the web, it seems like its the place to start when communicating on SMBus from within windows.
I have been tasked with doing this application:
So far: I have a J2SE application which builds a bluetooth service and waits for an incoming connection.
A J2ME application which searches for the service and when a match is found, it streams images clicking continuously with the phone's camera. The J2SE app accepts the images and displays them on the desktop machine.
But according to my project specification, I need the desktop application to be developed in C#.
What I tried?
I tried to read the J2SE code line by line and reproduce the same in C#. After googling around I found that 32Feet library was a good choice. So I went ahead and read the documentation which has code samples in VB, and tried to implement it in C#. It started well with me discovering the local device successfully but eventually i got stuck in the part related to the creation of Bluetooth service.
While most of the terminology is same with ServiceRecord, UUID/GUID etc...but I have failed miserably. Moreover I tested some code which works in VB but fails in C#. Even I tried OBEX...(a small file transfer test) which worked yesterday but fails today with an exception.
Now I am contemplating of starting from scratch all over again. Can someone help me please in suggesting ways to proceed further. I mean in what tools/library/environment should i opt for. What is the best and reliable way to develop the desktop app in C# with the J2ME app already developed.
Help required please. All suggestions even small ones are welcome. I am relatively new to both Bluetooth and C#. I have some experience in Java and J2ME.
Its sad to see that you wish to leave back those libraries you did used and spend alot worty time tinkering with it.
Rather than leaving that effort, try to resolve it. Let us know what exceptions/errors your facing with those libs.
Many experts here shall surely help you with it. Or talk to the developer of those libs for any help needed.
Hope this kind of helps Bluetooth in C#, Which stack, Which SDK?