WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Miscellaneous

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Reading Infrared Ports

Keywords: 	  Reading Infrared Ports

Question:

Do you know of a way to send and capture infrared signals?

Answer:

Hmmm. If you have W98 or later the winsock api supports infrared programming , i would say is possible with winbatch, not easy though.

After enabling my infrared port this code showed a valid socket handle:

wsock32=strcat(dirwindows(1),"wsock32.dll")

SOCK_STREAM=1
AF_IRDA=26

WSADATA=binaryalloc(398)
ver=binaryalloc(2)
binarypoke(ver,0,1)
binarypoke(ver,1,1)

r=dllcall(wsock32,long:"WSAStartup",word:binarypeek2(ver,0),lpbinary:WSADATA)
binaryfree(ver)
binaryfree(WSADATA)
;message("start",r)

hsocket=dllcall(wsock32,long:"socket",long:AF_IRDA,long:SOCK_STREAM,long:0)
message("socket",hsocket)
some links:
http://msdn.microsoft.com/library/en-us/irda/irda/about_irda.asp


http://msdn.microsoft.com/library/en-us/wcewinsk/htm/_wcecomm_Creating_an_Infrared_Winsock_Application.asp

or search for 'IrDA Sockets' at http://msdn.microsoft.com
Article ID:   W15543
File Created: 2003:05:13:11:28:38
Last Updated: 2003:05:13:11:28:38