Writing IR data transmitter / receiver for Pocket PC 2003 (VB.Net)
-
Hello, I am trying to write a program for my Pocket PC 2003 edition, which can receive and / or transmit IR data. I know that depending on the device, I will need to know some very specific information to properly send the data that I will want to send. However, for the time being, I would be happy just knowing how to send any old bytes of data that I choose. The problem mainly lies in the fact that I don't know Socket programming, I guess. So far all I have is:
Dim IR As Socket = New Socket(AddressFamily.Irda, SocketType.Stream, ProtocolType.Unspecified)
Where do I go from here, if I wanted to use the Socket I declared (IR) to send or receive data through my Pocket PC's IR port?
As I sit here, I contemplate the last words of Socrates: "I drank what?". Pokémon Pearl Friend Code: 4554-2418-6836
-
Hello, I am trying to write a program for my Pocket PC 2003 edition, which can receive and / or transmit IR data. I know that depending on the device, I will need to know some very specific information to properly send the data that I will want to send. However, for the time being, I would be happy just knowing how to send any old bytes of data that I choose. The problem mainly lies in the fact that I don't know Socket programming, I guess. So far all I have is:
Dim IR As Socket = New Socket(AddressFamily.Irda, SocketType.Stream, ProtocolType.Unspecified)
Where do I go from here, if I wanted to use the Socket I declared (IR) to send or receive data through my Pocket PC's IR port?
As I sit here, I contemplate the last words of Socrates: "I drank what?". Pokémon Pearl Friend Code: 4554-2418-6836
Mind you, I have no IR or mobile development experience... How you do this depends on how the IR device is exposed to you. You'll either be using Sockets or you might have to switch to using serial communications (COM1, COM2, ...) to talk to the other machine. You might gleen some information on how to do this from this article[^].
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Mind you, I have no IR or mobile development experience... How you do this depends on how the IR device is exposed to you. You'll either be using Sockets or you might have to switch to using serial communications (COM1, COM2, ...) to talk to the other machine. You might gleen some information on how to do this from this article[^].
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008I have been trying to use socket communications so far, but whether I use that or serial communications, I'm having trouble just setting the connection up in the first place. I've actually been trying to understand how to use either in a desktop setting as well, to no avail. For the socket communication option, I am having problems defining the EndPoint for the Socket.Connect method. This is what I have so far:
Dim IR As Socket = New Socket(AddressFamily.Irda, SocketType.Stream, ProtocolType.Unspecified) Dim EP As System.Net.EndPoint Dim SA As System.Net.SocketAddress SA = New System.Net.SocketAddress(AddressFamily.Irda, 1) EP.Create(SA) IR.Connect(EP) IR.Send(New Byte() {1}) IR.Close()
This doesn't work because the EndPoint (EP) has not been assigned a value. EndPoint also does not use a New constructor, so I guess I'm just not sure how to declare it. I would just use the IRDA namespace, but my project is (like so many others') meant to communicate with remote controls and other "dumb" IR devices, rather than communicating with another Pocket PC or Windows based device. I realize the complications involved in communicating with such a device, but right now my main concern is even being able to send or receive any data at all. I figure I'll sort out the data format after that. Anyway, I don't know C++, but I will check out that link and see if I understand it.
As I sit here, I contemplate the last words of Socrates: "I drank what?". Pokémon Pearl Friend Code: 4554-2418-6836