I'm using version 1.12 of the IR Library for esp8266. Here's my code below.
When I get the Result object as the result of decode event , the number of elements for RawBuffer are correct (I get 68 consistently which is correct) however the values are wrong. I'm comparing with my working Arduino decode sketch (which also gives me 68), which gives me the correct rawbuf values (I know they're correct b/c I can record and play back the raw codes in my arduino sketch successfully). The values from the sketch are like 4550, 4574,4500, etc.... What I am getting back from B4R is something like 12,10,12,10,12,40. It feels like there's a type conversion issue at play here.
Basically I am trying to port my IR record and blaster to B4R. In my for each loop below I figure an explicit cast from Object to string should be okay. I also tried "For Each code as Ulong...." with the same results. Any thoughts?
When I get the Result object as the result of decode event , the number of elements for RawBuffer are correct (I get 68 consistently which is correct) however the values are wrong. I'm comparing with my working Arduino decode sketch (which also gives me 68), which gives me the correct rawbuf values (I know they're correct b/c I can record and play back the raw codes in my arduino sketch successfully). The values from the sketch are like 4550, 4574,4500, etc.... What I am getting back from B4R is something like 12,10,12,10,12,40. It feels like there's a type conversion issue at play here.
Basically I am trying to port my IR record and blaster to B4R. In my for each loop below I figure an explicit cast from Object to string should be okay. I also tried "For Each code as Ulong...." with the same results. Any thoughts?
B4X:
Private Sub ir_Decoded (Result As IrResult)
Log("result: ", Result.DecodeType, ", ", Result.Value)
Dim length As Int = Result.RawBuffer.Length
Dim tmpstr As String
Log("Result raw buffer length:", length)
Log("result: ", Result.DecodeType, ", ", Result.Value, " size ",Result.RawBuffer.Length)
For Each code As Object In Result.RawBuffer
tmpstr = code
Log("code: ", code)
Next
ir_recv.Disable
End Sub