problem with C# library; errors; pls HELP

USB infrared remote control receiver/transmitter. Get one for $20, including worldwide shipping.

problem with C# library; errors; pls HELP

Postby spike1302 » Tue Apr 18, 2017 6:42 am

Hello,
I downloaded the C# library (from: https://github.com/gmamaladze/usb-infrared-toy-net), but it doesn't work, because i get a many of error (see pictures).
What is the problem?

Thank you.


Image
spike1302
Newbie
Newbie
 
Posts: 6
Joined: Sat Apr 15, 2017 6:01 pm

Re: problem with C# library; errors; pls HELP

Postby spike1302 » Tue Apr 18, 2017 7:12 am

Hi,
i convert the code into
Code: Select all
Console.WriteLine(string.Format("Version: {0}", Execute(port, "v")));


etc.

now it works.



How can i use the codeline:
Code: Select all
port.Write(new byte[] { 0x24, 0x25, 0x26 }, 0, 3); // Enable advanced TX features (no reply)


Which parameter needs the function? What is 0 and for what is 3?

see also my question:
viewtopic.php?f=29&t=8716&p=66055#p66055



thank you very much
spike1302
Newbie
Newbie
 
Posts: 6
Joined: Sat Apr 15, 2017 6:01 pm

Re: problem with C# library; errors; pls HELP

Postby spike1302 » Tue Apr 18, 2017 11:28 am

Hello,
I'm on the next steps and you can find my main problem:

- I downloaded the Tool "IrScrutinizer". It works fine.
- I get a signal from my remote control (button press) in Form: NEC and can this export to bin, Pronto hex, short pronto hex
- with the tool of Manito (convert bin to hex; viewtopic.php?f=29&t=5902#p54761) I have now 3 times the same signal in different code:

example:
bin --> hex
Code: Select all
01 a7 00 d3 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 4f 00 1a 00 4f 00 1a 00 4f 00 1a 00 4f 00 1a 00 4f 00 1a 00 4f 00 1a 00 4f 00 1a 00 4f 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 1a 00 4f 00 1a 00 1a 00 1a 00 4f 00 1a 00 4f 00 1a 00 4f 00 1a 00 4f 00 1a 00 4f 00 1a 00 4f 00 1a 00 1a 00 1a 00 4f 00 1a 07 48 01 a7 00 6a 00 1a 11 9d


Pronto hex
Code: Select all
0000 006C 0022 0002 015B 00AD 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0041 0016 0699 015B 0057 0016 0EA3


short pronto hex
Code: Select all
900A 006C 0000 0001 00FF 40BF


The C# Library of Manito works fine.


Main Problems and need HELP:
1.) the hex (from bin) is tooo long and the program is haning with execute:
Code: Select all
var[] powerOnCmd = new byte[] { 0x01, 0xa7, 0x00, [......] };   
port.Write(powerOnCmd, 0, powerOnCmd.Length);


2.) the same like pronto hex, I guess. But I need 2 chars and not 4. How can I use this hex in the code?
Because
Code: Select all
var[] powerOnCmd = new byte[] { 0x0000, 0x006C , 0x0022, [......] };
doesn't work

3.) short --> good :) but the same problem like 2.)
I have 4 chars and not 2 chars like 1. (bin->hex variante)


I hope you (community) can help me.


PS: yes I can use the Tool "IrScrutinizer". it works fine. However I want to control the function via C# in my own program
Or can I use other programm-function with c# codes? I think not.


@Manito: I use your C# library. I can recording the signal. But when i press a key to transmit the recrded signal. it doesn't work.
the LED is orange =good; but the signal has no result :(
Image

the led is ca. 10-15 active and the bytes was sent. This is to much for a signal I think?
spike1302
Newbie
Newbie
 
Posts: 6
Joined: Sat Apr 15, 2017 6:01 pm


Return to USB Infrared Toy