IRremote
ir_Others.hpp
Go to the documentation of this file.
1 /*
2  * ir_Others.hpp
3  *
4  * Contains functions for miscellaneous protocols
5  *
6  * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
7  *
8  ************************************************************************************
9  * MIT License
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining a copy
12  * of this software and associated documentation files (the "Software"), to deal
13  * in the Software without restriction, including without limitation the rights
14  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15  * copies of the Software, and to permit persons to whom the Software is furnished
16  * to do so, subject to the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be included in all
19  * copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
22  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23  * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
25  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
26  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27  *
28  ************************************************************************************
29  */
30 
35 #ifndef _IR_OTHERS_HPP
36 #define _IR_OTHERS_HPP
37 //==============================================================================
38 // DDDD IIIII SSSS H H
39 // D D I S H H
40 // D D I SSS HHHHH
41 // D D I S H H
42 // DDDD IIIII SSSS H H
43 //==============================================================================
44 
45 // DISH support by Todd Treece
46 //
47 // The send function needs to be repeated 4 times
48 // Only send the last for characters of the hex.
49 // I.E. Use 0x1C10 instead of 0x0000000000001C10 as listed in the LIRC file.
50 // Here is the LIRC file I found that seems to match the remote codes from the
51 // oscilloscope: DISH NETWORK (echostar 301):
52 // http://lirc.sourceforge.net/remotes/echostar/301_501_3100_5100_58xx_59xx
53 #define DISH_BITS 16
54 #define DISH_HEADER_MARK 400
55 #define DISH_HEADER_SPACE 6100
56 #define DISH_BIT_MARK 400
57 #define DISH_ONE_SPACE 1700
58 #define DISH_ZERO_SPACE 2800
59 #define DISH_REPEAT_SPACE 6200 // really?
60 
63 
64 void IRsend::sendDish(uint16_t aData) {
66 }
67 
68 //==============================================================================
69 // W W H H Y Y N N TTTTT EEEEE RRRRR
70 // W W H H Y Y NN N T E R R
71 // W W W HHHHH Y N N N T EEE RRRR
72 // W W W H H Y N NN T E R R
73 // WWW H H Y N N T EEEEE R R
74 //==============================================================================
75 // Whynter A/C ARC-110WD added by Francesco Meschia
76 // see https://docs.google.com/spreadsheets/d/1dsr4Jh-nzC6xvSKGpLlPBF0NRwvlpyw-ozg8eZU813w/edit#gid=0
77 // Looking at the code table the protocol is LSB first with start and stop bit.
78 // 4 bit checksum, constant address 0xAA00, 8 bit Command and 4 bit Command group
79 // but we use MSB first to be backwards compatible
80 #define WHYNTER_BITS 32
81 #define WHYNTER_HEADER_MARK 2850
82 #define WHYNTER_HEADER_SPACE 2850
83 #define WHYNTER_BIT_MARK 750
84 #define WHYNTER_ONE_SPACE 2150
85 #define WHYNTER_ZERO_SPACE 750
86 
89 
90 void IRsend::sendWhynter(uint32_t aData, uint8_t aNumberOfBitsToSend) {
91  sendPulseDistanceWidth(&WhynterProtocolConstants, aData, NEC_BITS, aNumberOfBitsToSend);
92 }
93 
95  // Check we have the right amount of data (68). The +4 is for initial gap, start bit mark and space + stop bit mark.
96  if (decodedIRData.rawlen != (2 * WHYNTER_BITS) + 4) {
97  return false;
98  }
100  return false;
101  }
103  return false;
104  }
105  // Success
109  return true;
110 }
111 
113 #endif // _IR_OTHERS_HPP
WhynterProtocolConstants
struct PulseDistanceWidthProtocolConstants WhynterProtocolConstants
Definition: ir_Others.hpp:87
NEC_BITS
#define NEC_BITS
Definition: ir_NEC.hpp:97
PROTOCOL_IS_MSB_FIRST
#define PROTOCOL_IS_MSB_FIRST
Definition: IRProtocol.h:147
IRsend::sendDish
void sendDish(uint16_t aData)
Definition: ir_Others.hpp:64
WHYNTER_ONE_SPACE
#define WHYNTER_ONE_SPACE
Definition: ir_Others.hpp:84
IRData::numberOfBits
uint16_t numberOfBits
Number of bits received for data (address + command + parity) - to determine protocol length if diffe...
Definition: IRProtocol.h:119
WHYNTER_HEADER_SPACE
#define WHYNTER_HEADER_SPACE
Definition: ir_Others.hpp:82
DISH_ONE_SPACE
#define DISH_ONE_SPACE
Definition: ir_Others.hpp:57
IRsend::sendPulseDistanceWidth
void sendPulseDistanceWidth(PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData, uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats)
Sends PulseDistance frames and repeats.
Definition: IRSend.hpp:691
IRsend::sendWhynter
void sendWhynter(uint32_t aData, uint8_t aNumberOfBitsToSend)
Definition: ir_Others.hpp:90
DISH_BIT_MARK
#define DISH_BIT_MARK
Definition: ir_Others.hpp:56
WHYNTER_HEADER_MARK
#define WHYNTER_HEADER_MARK
Definition: ir_Others.hpp:81
DISH_ZERO_SPACE
#define DISH_ZERO_SPACE
Definition: ir_Others.hpp:58
WHYNTER_ZERO_SPACE
#define WHYNTER_ZERO_SPACE
Definition: ir_Others.hpp:85
PulseDistanceWidthProtocolConstants
Definition: IRProtocol.h:134
IRrecv::decodedIRData
IRData decodedIRData
Definition: IRremoteInt.h:358
IRData::flags
uint8_t flags
IRDATA_FLAGS_IS_REPEAT, IRDATA_FLAGS_WAS_OVERFLOW etc. See IRDATA_FLAGS_* definitions above.
Definition: IRProtocol.h:120
IRrecv::checkHeader
bool checkHeader(PulseDistanceWidthProtocolConstants *aProtocolConstants)
Definition: IRReceive.hpp:1126
WHYNTER_BIT_MARK
#define WHYNTER_BIT_MARK
Definition: ir_Others.hpp:83
IRrecv::decodePulseDistanceWidthData
bool decodePulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset=3)
Decode pulse distance protocols for PulseDistanceWidthProtocolConstants.
Definition: IRReceive.hpp:954
DISH_BITS
#define DISH_BITS
Definition: ir_Others.hpp:53
IRDATA_FLAGS_IS_MSB_FIRST
#define IRDATA_FLAGS_IS_MSB_FIRST
Value is mainly determined by the (known) protocol.
Definition: IRProtocol.h:100
IRData::rawlen
IRRawlenType rawlen
counter of entries in rawbuf of last received frame.
Definition: IRProtocol.h:128
DISH_HEADER_MARK
#define DISH_HEADER_MARK
Definition: ir_Others.hpp:54
DISH_HEADER_SPACE
#define DISH_HEADER_SPACE
Definition: ir_Others.hpp:55
UNKNOWN
@ UNKNOWN
Definition: IRProtocol.h:41
WHYNTER
@ WHYNTER
Definition: IRProtocol.h:70
WHYNTER_BITS
#define WHYNTER_BITS
Definition: ir_Others.hpp:80
IRData::protocol
decode_type_t protocol
UNKNOWN, NEC, SONY, RC5, PULSE_DISTANCE, ...
Definition: IRProtocol.h:109
DishProtocolConstants
struct PulseDistanceWidthProtocolConstants DishProtocolConstants
Definition: ir_Others.hpp:61
IRrecv::decodeWhynter
bool decodeWhynter()
Definition: ir_Others.hpp:94