Skip to content

Commit

Permalink
Change bit-order of the message from LSBF to MSBF
Browse files Browse the repository at this point in the history
Change comments into doxygen ones
Update a section of IRac.cpp
Remove TurnOnTechnibelAC example
Various minor improvements
  • Loading branch information
Quentinbri committed Sep 5, 2020
1 parent 268de3f commit 0b3a5e3
Show file tree
Hide file tree
Showing 9 changed files with 270 additions and 251 deletions.
69 changes: 0 additions & 69 deletions examples/TurnOnTechnibelAC/TurnOnTechnibelAC.ino

This file was deleted.

17 changes: 0 additions & 17 deletions examples/TurnOnTechnibelAC/platformio.ini

This file was deleted.

54 changes: 52 additions & 2 deletions src/IRac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ bool IRac::isProtocolSupported(const decode_type_t protocol) {
#if SEND_TCL112AC
case decode_type_t::TCL112AC:
#endif
#if SEND_TECO
#if SEND_TECHNIBEL_AC
case decode_type_t::TECHNIBEL_AC:
#endif
#if SEND_TECO
Expand Down Expand Up @@ -1750,6 +1750,39 @@ void IRac::tcl112(IRTcl112Ac *ac,
}
#endif // SEND_TCL112AC

#if SEND_TECHNIBEL_AC
/// Send a Technibel A/C message with the supplied settings.
/// @param[in, out] ac A Ptr to an IRTechnibelAc object to use.
/// @param[in] on The power setting.
/// @param[in] mode The operation mode setting.
/// @param[in] degrees The temperature setting in degrees.
/// @param[in] fan The speed setting for the fan.
/// @param[in] swingv The vertical swing setting.
/// @param[in] light Turn on the LED/Display mode.
/// @param[in] sleep Nr. of minutes for sleep mode. -1 is Off, >= 0 is on.
void IRac::technibel(IRTechnibelAc *ac,
const bool on, const stdAc::opmode_t mode, const float degrees,
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
const int16_t sleep) {
ac->begin();
ac->setPower(on);
ac->setMode(ac->convertMode(mode));
ac->setTemp(degrees);
ac->setFan(ac->convertFan(fan));
ac->setSwing(swingv != stdAc::swingv_t::kOff);
// No Horizontal swing setting available.
// No Quiet setting available.
// No Turbo setting available.
// No Light setting available.
// No Filter setting available.
// No Clean setting available.
// No Beep setting available.
ac->setSleep(sleep >= 0); // Sleep is either on/off, so convert to boolean.
// No Clock setting available.
ac->send();
}
#endif // SEND_TECHNIBEL_AC

#if SEND_TECO
/// Send a Teco A/C message with the supplied settings.
/// @param[in, out] ac A Ptr to an IRTecoAc object to use.
Expand Down Expand Up @@ -2466,6 +2499,15 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
break;
}
#endif // SEND_TCL112AC
#if SEND_TECHNIBEL_AC
case TECHNIBEL_AC:
{
IRTechnibelAc ac(_pin, _inverted, _modulation);
technibel(&ac, send.power, send.mode, degC, send.fanspeed, send.swingv,
send.sleep);
break;
}
#endif // SEND_TECHNIBEL_AC
#if SEND_TECO
case TECO:
{
Expand Down Expand Up @@ -3183,7 +3225,7 @@ namespace IRAcUtils {
#endif // DECODE_VESTEL_AC
#if DECODE_TECHNIBEL_AC
case decode_type_t::TECHNIBEL_AC: {
IRTechnibelAc ac(0);
IRTechnibelAc ac(kGpioUnused);
ac.setRaw(result->value); // TechnibelAc uses value instead of state.
return ac.toString();
}
Expand Down Expand Up @@ -3564,6 +3606,14 @@ namespace IRAcUtils {
break;
}
#endif // DECODE_TCL112AC
#if DECODE_TECHNIBEL_AC
case decode_type_t::TECHNIBEL_AC: {
IRTechnibelAc ac(kGpioUnused);
ac.setRaw(decode->value); // Uses value instead of state.
*result = ac.toCommon();
break;
}
#endif // DECODE_TECHNIBEL_AC
#if DECODE_TECO
case decode_type_t::TECO: {
IRTecoAc ac(kGpioUnused);
Expand Down
7 changes: 7 additions & 0 deletions src/IRac.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "ir_Sanyo.h"
#include "ir_Sharp.h"
#include "ir_Tcl.h"
#include "ir_Technibel.h"
#include "ir_Teco.h"
#include "ir_Toshiba.h"
#include "ir_Trotec.h"
Expand Down Expand Up @@ -381,6 +382,12 @@ void electra(IRElectraAc *ac,
const bool turbo, const bool light, const bool econo,
const bool filter);
#endif // SEND_TCL112AC
#if SEND_TECHNIBEL_AC
void technibel(IRTechnibelAc *ac,
const bool on, const stdAc::opmode_t mode, const float degrees,
const stdAc::fanspeed_t fan, const stdAc::swingv_t swingv,
const int16_t sleep = -1);
#endif // SEND_TECHNIBEL_AC
#if SEND_TECO
void teco(IRTecoAc *ac,
const bool on, const stdAc::opmode_t mode, const float degrees,
Expand Down
6 changes: 3 additions & 3 deletions src/IRrecv.h
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,9 @@ class IRrecv {
#endif // DECODE_MULTIBRACKETS
#if DECODE_TECHNIBEL_AC
bool decodeTechnibelAc(decode_results *results,
uint16_t offset = kStartOffset,
const uint16_t nbits = kTechnibelAcBits,
const bool strict = true);
uint16_t offset = kStartOffset,
const uint16_t nbits = kTechnibelAcBits,
const bool strict = true);
#endif // DECODE_TECHNIBEL_AC
#if DECODE_CORONA_AC
bool decodeCoronaAc(decode_results *results, uint16_t offset = kStartOffset,
Expand Down
2 changes: 1 addition & 1 deletion src/IRsend.h
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ class IRsend {
#endif
#if SEND_TECHNIBEL_AC
void sendTechnibelAc(uint64_t data, uint16_t nbits = kTechnibelAcBits,
uint16_t repeat = kTechnibelAcDefaultRepeat);
uint16_t repeat = kTechnibelAcDefaultRepeat);
#endif
#if SEND_CORONA_AC
void sendCoronaAc(const uint8_t data[],
Expand Down
Loading

0 comments on commit 0b3a5e3

Please sign in to comment.