Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Samsung AC Display and VirusDoctor toggles #1048

Merged
merged 6 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/ir_Samsung.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,22 @@ void IRSamsungAc::setPowerful(const bool on) {
}
}

bool IRSamsungAc::getDisplay(void) {
return GETBIT8(remote_state[10], kSamsungAcDisplayOffset);
}

void IRSamsungAc::setDisplay(const bool on) {
setBit(&remote_state[10], kSamsungAcDisplayOffset, on);
}

bool IRSamsungAc::getIon(void) {
return GETBIT8(remote_state[11], kSamsungAcIonOffset);
}

void IRSamsungAc::setIon(const bool on) {
setBit(&remote_state[11], kSamsungAcIonOffset, on);
}

// Convert a standard A/C mode into its native mode.
uint8_t IRSamsungAc::convertMode(const stdAc::opmode_t mode) {
switch (mode) {
Expand Down
8 changes: 8 additions & 0 deletions src/ir_Samsung.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ const uint8_t kSamsungAcQuiet5Offset = 5;
const uint8_t kSamsungAcPowerfulMask8 = 0b01010000;
const uint8_t kSamsungAcPowerful10Offset = 1; // Mask 0b00000110
const uint8_t kSamsungAcPowerful10Size = 1; // Mask 0b00000110
const uint8_t kSamsungAcDisplayOffset = 4; // Mask 0b00010000
const uint8_t kSamsungAcIonOffset = 0; // Mask 0b00000001

const uint16_t kSamsungACSectionLength = 7;
const uint64_t kSamsungAcPowerSection = 0x1D20F00000000;
Expand Down Expand Up @@ -99,6 +101,12 @@ class IRSamsungAc {
bool getQuiet(void);
void setPowerful(const bool on);
bool getPowerful(void);

void setDisplay(const bool on);
bool getDisplay(void);
void setIon(const bool on);
bool getIon(void);

uint8_t* getRaw(void);
void setRaw(const uint8_t new_code[],
const uint16_t length = kSamsungAcStateLength);
Expand Down