469,950 Members | 1,930 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

WinLirc problem, Sends stuff two time???

I am using winLirc to receive date from my Packard Bell Fast media IR
remote. The problem I have is that Winsock1_DataArrival(ByVal bytesTotal As
Long) Is called two times almost every time I press a button on my
remote.Way is it doing that???
This is the code I am using but I don't know how has made it...
It works fine and i can make WinAmp5 play, stop, Next and back etc with a
few adds to it. The problem is that the Winsock1_DataArrival some times, not
always, think that I have pressed a button on my remote two times... This
makes WinAmp Next and back not that good...

WinLirc shows with a green button when I press the remote and it blink green
ones each time I press a button.

Is it something in WinLirc or is it how WinLirc translate my remote that is
wrong?
Or is it in this code???

Plz help me I wold be so happy if I could program my remote with the use of
winLirc

Option Explicit
Dim Counter As Integer

Private Sub Form_Load()
Counter = 1
Dim strLocalIP As String

strLocalIP = Winsock1.LocalIP
Winsock1.Protocol = sckTCPProtocol
Winsock1.RemoteHost = strLocalIP
Winsock1.RemotePort = 8765
Winsock1.Connect

End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)

Dim strData As String
Dim strRemoteHex, strRemoteName, strRemoteKey As String
Dim intRemoteIdx, intSeperatorOne, intSeperatorTwo As Integer

Winsock1.GetData strData, vbString
Text1.Text = strData 'Messagestring from WinLirc

strRemoteHex = Left(strData, 16)
intRemoteIdx = Val(Mid$(strData, 18, 2))

intSeperatorOne = InStr(21, strData, " ", vbBinaryCompare)
strRemoteKey = Mid$(strData, 21, intSeperatorOne - 21) 'Code of the Key
from Remote Control

intSeperatorTwo = InStr(intSeperatorOne, strData, Chr(10),
vbBinaryCompare)
strRemoteName = Mid$(strData, intSeperatorOne + 1, (intSeperatorTwo -
intSeperatorOne) - 1) 'Name of the Key - defined in WinLircServer

Text2.Text = "KEY:" & strRemoteKey & " Control:" & strRemoteName

End Sub

Yours, Jonas
Jul 17 '05 #1
1 3764

There was a repeat in the WinLirc Config file that I deleted to solve that
problem...

But I need to be able to hold down the Volume button on my remote so it will
repeat but sens I have deleted the repeat from the config file it will of
cause not work... :(

Instead I need to have the repeat in the config file and be able to just
take out the Initial signal from the remote and not the repeat signal.

How do I do that?
"BadOmen" <ba*******@hotmail.com> skrev i meddelandet
news:vN********************@newsc.telia.net...
I am using winLirc to receive date from my Packard Bell Fast media IR
remote. The problem I have is that Winsock1_DataArrival(ByVal bytesTotal As Long) Is called two times almost every time I press a button on my
remote.Way is it doing that???
This is the code I am using but I don't know how has made it...
It works fine and i can make WinAmp5 play, stop, Next and back etc with a
few adds to it. The problem is that the Winsock1_DataArrival some times, not always, think that I have pressed a button on my remote two times... This
makes WinAmp Next and back not that good...

WinLirc shows with a green button when I press the remote and it blink green ones each time I press a button.

Is it something in WinLirc or is it how WinLirc translate my remote that is wrong?
Or is it in this code???

Plz help me I wold be so happy if I could program my remote with the use of winLirc

Option Explicit
Dim Counter As Integer

Private Sub Form_Load()
Counter = 1
Dim strLocalIP As String

strLocalIP = Winsock1.LocalIP
Winsock1.Protocol = sckTCPProtocol
Winsock1.RemoteHost = strLocalIP
Winsock1.RemotePort = 8765
Winsock1.Connect

End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)

Dim strData As String
Dim strRemoteHex, strRemoteName, strRemoteKey As String
Dim intRemoteIdx, intSeperatorOne, intSeperatorTwo As Integer

Winsock1.GetData strData, vbString
Text1.Text = strData 'Messagestring from WinLirc

strRemoteHex = Left(strData, 16)
intRemoteIdx = Val(Mid$(strData, 18, 2))

intSeperatorOne = InStr(21, strData, " ", vbBinaryCompare)
strRemoteKey = Mid$(strData, 21, intSeperatorOne - 21) 'Code of the Key from Remote Control

intSeperatorTwo = InStr(intSeperatorOne, strData, Chr(10),
vbBinaryCompare)
strRemoteName = Mid$(strData, intSeperatorOne + 1, (intSeperatorTwo -
intSeperatorOne) - 1) 'Name of the Key - defined in WinLircServer

Text2.Text = "KEY:" & strRemoteKey & " Control:" & strRemoteName

End Sub

Yours, Jonas

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Sačo Zagoranski | last post: by
14 posts views Thread by Jim Michaels | last post: by
20 posts views Thread by Pete Marsh | last post: by
7 posts views Thread by Peter Laan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.