@@ -652,3 +652,75 @@ long IRrecv::decodeHash(decode_results *results) {
652
652
results->decode_type = UNKNOWN;
653
653
return DECODED;
654
654
}
655
+
656
+ /* Sharp and DISH support by Todd Treece
657
+
658
+ The Dish send function needs to be repeated 4 times and the Sharp function
659
+ has the necessary repeats built in. I know that it's not consistent,
660
+ but I don't have the time to update my code.
661
+
662
+ Here are the LIRC files that I found that seem to match the remote codes
663
+ from the oscilloscope:
664
+
665
+ Sharp LCD TV:
666
+ http://lirc.sourceforge.net/remotes/sharp/GA538WJSA
667
+
668
+ DISH NETWORK (echostar 301):
669
+ http://lirc.sourceforge.net/remotes/echostar/301_501_3100_5100_58xx_59xx
670
+
671
+ For the DISH codes, only send the last for characters of the hex.
672
+ i.e. use 0x1C10 instead of 0x0000000000001C10 which is listed in the
673
+ linked LIRC file.
674
+ */
675
+
676
+ void IRsend::sendSharp (unsigned long data, int nbits) {
677
+ unsigned long invertdata = data ^ SHARP_TOGGLE_MASK;
678
+ enableIROut (38 );
679
+ for (int i = 0 ; i < nbits; i++) {
680
+ if (data & 0x4000 ) {
681
+ mark (SHARP_BIT_MARK);
682
+ space (SHARP_ONE_SPACE);
683
+ }
684
+ else {
685
+ mark (SHARP_BIT_MARK);
686
+ space (SHARP_ZERO_SPACE);
687
+ }
688
+ data <<= 1 ;
689
+ }
690
+
691
+ mark (SHARP_BIT_MARK);
692
+ space (SHARP_ZERO_SPACE);
693
+ delay (46 );
694
+ for (int i = 0 ; i < nbits; i++) {
695
+ if (invertdata & 0x4000 ) {
696
+ mark (SHARP_BIT_MARK);
697
+ space (SHARP_ONE_SPACE);
698
+ }
699
+ else {
700
+ mark (SHARP_BIT_MARK);
701
+ space (SHARP_ZERO_SPACE);
702
+ }
703
+ invertdata <<= 1 ;
704
+ }
705
+ mark (SHARP_BIT_MARK);
706
+ space (SHARP_ZERO_SPACE);
707
+ delay (46 );
708
+ }
709
+
710
+ void IRsend::sendDISH (unsigned long data, int nbits)
711
+ {
712
+ enableIROut (56 );
713
+ mark (DISH_HDR_MARK);
714
+ space (DISH_HDR_SPACE);
715
+ for (int i = 0 ; i < nbits; i++) {
716
+ if (data & DISH_TOP_BIT) {
717
+ mark (DISH_BIT_MARK);
718
+ space (DISH_ONE_SPACE);
719
+ }
720
+ else {
721
+ mark (DISH_BIT_MARK);
722
+ space (DISH_ZERO_SPACE);
723
+ }
724
+ data <<= 1 ;
725
+ }
726
+ }
0 commit comments