CF's System.Net.IrDA can't find either client or server.

A

Alex Dong

Hello Everybody:
I have tried to use System.Net.IrDA to create an IrDA application to control my home air conditioner. The idea is that first I learn the controlling signal by reading IR from controller and then send the signal out by using my iPAQ 5500. The problem is that I use IrDAListen to listen to the socket but can't find the IrDAClient even if the controller is only 1cm from the iPAQ's IR port; I also use IrDAClient to find a device and can't find any. Can anybody here tell me what I have done is wrong?

Environment: VS.NET 2003, iPAQ 5500, PocketPC 2003. Compact Framework 1.1 SP1.

Thank you.
Alex

The server code looks like this:
#region IrDAListener

irDAListener = new IrDAListener("IRClientDemo");

irDAListener.Start();

Socket socket = irDAListener.AcceptSocket();


IrDAClient irClient = irDAListener.AcceptIrDAClient();

Debug.WriteLine(irClient.RemoteMachineName);

StreamReader sr = new StreamReader(irClient.GetStream(), System.Text.Encoding.ASCII);

Debug.WriteLine(sr.ReadLine());

sr.Close();

#endregion

The client code looks like this:

#region IrDAClient

IrDAClient irDAClient = new IrDAClient();

IrDADeviceInfo[] devsAvailable = irDAClient.DiscoverDevices(5);

foreach(IrDADeviceInfo devInfo in devsAvailable)

{

Debug.WriteLine("Device ID: " + devInfo.DeviceID + ", Device Name: " + devInfo.DeviceName);

}

#endregion
 
A

Alan J. McFarlane

Hello Everybody:
I have tried to use System.Net.IrDA to create an IrDA application to
control my home air conditioner. The idea is that first I learn the
controlling signal by reading IR from controller and then send the
signal out by using my iPAQ 5500. The problem is that I use
IrDAListen to listen to the socket but can't find the IrDAClient even
if the controller is only 1cm from the iPAQ's IR port; I also use
IrDAClient to find a device and can't find any. Can anybody here tell
me what I have done is wrong?
Do you know that the air conditioner uses IrDA protocols (precisely
IrDA-Data)? I would have guessed it uses some form of 'consumer'
infrared signal. These two are not at all similar.

(Oh by the way please don't post here in HTML format).
 
Top