Dangerous Prototypes

Dangerous Prototypes => USB Infrared Toy => Topic started by: raretomato on August 27, 2015, 01:16:48 am

Title: How to get the raw-data in C++ or Java.
Post by: raretomato on August 27, 2015, 01:16:48 am
I bought the IR-toy and It works well with WinLIRC.

Now, I want to use IR-toy for receiving some data. So It works differently than remote control.
(there are no pre-defined IR-code.)

Therefore, I want to get rawdata like SUMP logic analyzer.
Ex : {9000, 4500, 578, 552, 578, 552, 578, 1684, 578, 552, 578, 552, 578, 552, 578, 552, 578, 552, 578, 1684, 578, 1684};

I can get this data with Home-brew Serial port IR-receiver using below c++ code.

while(1){
   bool now = _serialPort->CDHolding;
   if(now!=pre){
      QueryPerformanceCounter(&liCounter2); 
      int interval = (int)((double)(liCounter2.QuadPart - liCounter1.QuadPart) / (double)liFrequency.QuadPart * 1000000);
      pre = now;
      QueryPerformanceCounter(&liCounter1);
   }
}

Please help me. Thanks.
Title: Re: How to get the raw-data in C++ or Java.
Post by: Barf on August 27, 2015, 08:43:31 am
Have a look at my IrToy Java class, https://raw.githubusercontent.com/bengt ... IrToy.java (https://raw.githubusercontent.com/bengtmartensson/harctoolboxbundle/master/HarcHardware/src/main/java/org/harctoolbox/harchardware/ir/IrToy.java), contained within IrScrutinizer. You can use that class (HarcHardware.jar + IrpMaster.jar) directly. Just clone https://github.com/bengtmartensson/harc ... bundle.git (https://github.com/bengtmartensson/harctoolboxbundle.git) .
Title: Re: How to get the raw-data in C++ or Java.
Post by: raretomato on August 29, 2015, 10:19:51 am
Thanks for your kindness!!!
I will try your solution and reply!