Dangerous Prototypes

Dangerous Prototypes => USB Infrared Toy => Topic started by: Smuddy on April 07, 2014, 12:33:01 pm

Title: Let's talk C#
Post by: Smuddy on April 07, 2014, 12:33:01 pm
Hello,

does anyone have some experience with the IR-Toy using C#/.NET?

My intension is a piece of software on my media PC, that uses the IR-Toy as a univeral remote control, that I control with the keyboard.
The current state of the project is, that I send the coammnds via commandline to the irtoy.exe (from the irtoy package).
But it allways take some seconds to finish the process. So i want to send the commands directly via serial.

Greetings
Smuddy
Title: Re: Let's talk C#
Post by: Manitu on April 23, 2014, 10:31:03 pm
Hi Smuddy

yeah I have a similiar project.
I started with Android (http://http://dangerousprototypes.com/forum/viewtopic.php?f=29&t=5902) with the plan to make an universal remote for the TV, AV-Receiver & HTPC. Unfortunately this idea is stopped; the IrToy has some problem as it stucks in bootloader mode when the smartphone/tablet goes to standby (deep sleep) after some time.

So now I plan that the HTPC is able to switch on the TV and the AV-Receiver and switches to the correct channels by a small C# program that I can launch via hotkey.

As my Android code was working quite well (apart from the standy problem) I have ported it now to C#.
It is not a perfect library (specially when there an exception happens it just closes the connection), but working.

The library is a Visual Studio 2008 solution and contains the 'IrToyLibrary' project which is setup as a library (DLL) and there is another 'IrToy' project that is a sample how to use it.
At the moment, it supports only sending and it requires the command in a hex string format (which can be taken from the perl RecPlay output).

just let me know your experience.

Regards, Manitu
Title: Re: Let's talk C#
Post by: Smuddy on April 24, 2014, 03:32:19 pm
Hi Manitu,

thank you, that's exactly, what I need.
I'll give notice if I get this thing to work.

Ahh ... management by exception ;) but I'll get over it.

Grüße,
Smuddy
Title: Re: Let's talk C#
Post by: Manitu on May 01, 2014, 04:01:46 pm
Hi
I've updated the library as it caused some issues where it did not wait until IrToy has written all data to the buffer.
Gruss, Manitu
Title: Re: Let's talk C#
Post by: Smuddy on May 01, 2014, 05:38:40 pm
Cool, thank you.

In unit tests it works fine for my TV, but not for my AV receiver. But this is a problem with the strange codes from Yamaha.

Grüße,
Smuddy
Title: Re: Let's talk C#
Post by: Smuddy on May 11, 2014, 08:34:22 pm
Ok, the remote is finished - at least for my requirements.

The app is running in background ans show up after pressing ctrl+shift.
An additional key starts any command, that is defines in the RcSettings.xml.

I only changed some attributes in your lib for getting the settings xml-serializable.

Greetings
Smuddy

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.00922052320session_write_close ( )...(null):0
20.00962183896ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.00962184672Database_MySQL->query( ).../DatabaseHandler.php:119
40.05322323392Database_MySQL->error( ).../Db-mysql.class.php:273