To Develop an Application:Using Mobile Camera as a Web Cam - c#

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?

Related

Genesys Workspace Desk. Edit. get information

I am pretty new in programming and I have developed few small apps.
Now I want to create simple Window based App "communicating" with Genesys
What does app do is when you get call through Genesys there is textbox where time is counted.
Now my "stopwatch" app should start counting in same time. SHOULD
There is issue, I am not sure how to connect or get info from Genesys interface without API
I know for most of you is dumb question but for me, beginner not so :)
I would be really glad if someone from you can help me here or give me advice.
My app of course have more functions and they are working without issue, that is the last thing what I need.
Thank you in advance.
Assuming you are referring to Genesys 'proper', not cloud or any new variants, you need to license the Genesys SDK, the protocol is proprietary. There is a Rest API available via Workspace Web Edition but that also requires license to use. Licenses are per agent!

Running PowerShell script in a C# Windows Service App

I am really not asking for any specific lines of code here, but more along the lines of someone being able to explain to me the idea of it to help me have a better understanding. I am very new to coding with PowerShell scripts let alone calling them in a C# app. Would anyone be able to explain or even point me in the right direction so I can learn about what I would need to do here. I have a basic "Hello World" script that I would like to call from a C# Windows Service using VS2010. I have seen examples around the internet, but they are very brief and don't really teach the concept behind it.
Any help would be much appreciated!
Thanks!
Here is a pretty good discussion on how to call Powershell from C#: http://www.codeproject.com/Articles/18229/How-to-run-PowerShell-scripts-from-C
I suggest you start with the RunScript function and add it to a VS2010 console application. Main() would then invoke RunScript something like RunScript( "echo 'hello from PS';get-date; get-culture; ").
Windows services have quite a few differences from a normal console application. You can read about how to write a windows service on MSDN, but if you've never coded before, you have a steep learning curve in front of you.
There is a service from an old Resource Kit call srvany.exe (Google it) which would run any console app as a service. However in Windows Vista (and above) services were restricted from accessing the desktop, so srvany could only be successful in Vista and above if you EXE doesn't need keyboard input or need to write to the display. However your EXE could read/write files.
This is what I was able to get to work for me.
I basically followed the information that I found from this post, but changed a couple of things to get it to work for me: Problem with calling a powershell function from c#
For example, for the ps.AddCommand("BatAvg") I just added my own function in my .ps1 file ps.AddCommand("PS1FunctionName") and didn't add any parameters since it was not necessary. The answer was staring me in the face the whole time, I just didn't know where I needed to place it in my windows service. I was able to figure that out and now I am cruising!
Also, don't forget to reference using System.Management.Automation and using System.Management.Automation.Runspaces in your code (for all the future people that may look at this).

Simple way to read values from the SMBus in C#, on a Windows machine?

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.

Getting started with writing a desktop app that talks to an iPhone

I'm thinking of writing an app to selectively transfer photos/music to and from my iPhone, mostly for fun and personal convenience. However, I'm stuck at the very beginning -- where do I look to find information on how to do this?
Pretty much every link I see talks about developing applications that run on the iPhone, but nothing about desktop app for interfacing with an iPhone.
I'm on Windows (no access to a Mac, but I'll take suggestions for that for when I eventually acquire one), and I'm most familiar with C#, but other languages are definitely an option.
Can anybody offer me a few pointers on getting started? Thanks.
Edit: to clarify further, I don't need information on how to write applications that run ON the iphone. There are plenty of resources out for that. :) What I'm looking for it some pointers on how to "talk" to an iPhone or an iPod through the USB cord, if that's even possible.
Edit #2: I found libmobiledevice library that effectively does what I'm talking about on Linux. I don't think I'm too keen on attempting to port it over to Windows, though. :)
I found what I was looking for: SharePodLib. Thanks, everyone.
I recommend and have used the following options:
Option 1:
Run a small and light webserver in the iPhone and of course, use HTTP to transfer. I recommend mongoose websever, i've tried it with very simple and very heavy load. Also here, you can find an actual drag and drop project to deploy this webserver in the iPhone.
Option 2:
Use something like Bonjour, this is something very useful if you want the "smart" discovery of your device in the network, maybe for opportunistic peer discovery. You can check here and here, to understand how to get bonjour to run in the iPhone and use it to exploit discovery and sharing.
Hope it helps!!
Unfortunately, there's no no way to sync an iPhone app with a Mac app over USB, at least in the current SDK. As already stated, you'll have to either sync over HTTP or use the local network. You might want to check out ZSync, a Cocoa library for bonjour syncing (I haven't used it, and it's in early development stages, but it looks interesting).
Unfortunately there is no officially sanctioned method to do what you describe. In Apple's view the only application that should have visibility of that information is iTunes. There are applications out there that appear to be able to do this, but I suspect they have reverse engineered the USB protocol and are thus open to being locked out if the protocol changes.

Wiimote example programs

I'd like to use the Wiimote (accelerometers, gyroscopes, infrared camera, etc, etc, etc) on various applications.
It's a bluetooth device, and I know others have connected it to their computer.
What's the easiest way to start using it in my software - are there libraries for C#, for instance?
I want my software to be usable and easily installable - what's the current easiest way to connect a wiimote to the computer? Can I make that process part of my software installation?
-Adam
Have you seen Johnny Chung Lee's 'Procrastineering' Blog? He's written a lot on the subject of using wii remotes and has some fantastic demonstration videos. [Edit] I just found out Mr Lee did a TED talk which gives a good introduction to the stuff he's done too...
There's a wealth of information over on Wiibrew.org - check out their Wiimote Library page for some other APIs if you want to look beyond c#. As an avid Python fan, I'm quite curious to have a play with the pyWiimote library :-)
Coding4Fun had a managed C# library up that would allow you to interface with it but it seems their site is down right now. Though I think they used the Robotics Studio so that may be a place to start.
Found it... http://www.codeplex.com/WiimoteLib
Oh and I forgot to post a link to these videos I saw quite some time ago. http://www.cs.cmu.edu/~johnny/projects/wii/
If you use WiimoteLib (from Coding4Fun as mentioned in another answer), there is an example application called WiimoteTest. This tests all of the Wiimote inputs and outputs, including for multiple Wiimotes at the same time, so it is a good starting point for your own Wiimote code as it gives you an example of how to do pretty much anything you would want to.
For the second part of your question, connecting the Wiimote to the computer is pretty much the same as connecting any other Bluetooth device. I don't know that it would be very suitable to have this done at installation as it is likely to be connected and disconnected a lot, especially since the Wiimote will turn itself off if not used for a while. However, it's pretty much a matter of following a standard Windows wizard to connect to it, so it's not too hard. This assumes you have a Bluetooth driver that will work with the Wiimote - more information on that is available at the Coding4Fun website. It worked for me with the default driver that already came with my laptop but if it doesn't for you, the one they recommend is BlueSoleil.
what's the current easiest way to
connect a wiimote to the computer?
I not found solution for connect wiimote within my software, you have to connect manually into Windows, but on Windows register bluetooth device it very take time, Try Toshiba bluetooth stack it more convenient.

Categories