IRremoteESP8266
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
IRArgoAC Class Reference

Class for handling detailed Argo A/C messages. More...

#include <ir_Argo.h>

Collaboration diagram for IRArgoAC:
Collaboration graph
[legend]

Public Member Functions

 IRArgoAC (const uint16_t pin, const bool inverted=false, const bool use_modulation=true)
 Class constructor. More...
 
void send (const uint16_t repeat=kArgoDefaultRepeat)
 Send the current internal state as an IR message. More...
 
int8_t calibrate (void)
 Run the calibration to calculate uSec timing offsets for this platform. More...
 
void begin (void)
 Set up hardware to be able to send a message. More...
 
void on (void)
 Set the internal state to have the power on. More...
 
void off (void)
 Set the internal state to have the power off. More...
 
void setPower (const bool on)
 Set the internal state to have the desired power. More...
 
bool getPower (void)
 Get the power setting from the internal state. More...
 
void setTemp (const uint8_t degrees)
 Set the temperature. More...
 
uint8_t getTemp (void)
 Get the current temperature setting. More...
 
void setFan (const uint8_t fan)
 Set the speed of the fan. More...
 
uint8_t getFan (void)
 Get the current fan speed setting. More...
 
void setFlap (const uint8_t flap)
 Set the flap position. i.e. Swing. More...
 
uint8_t getFlap (void)
 Get the flap position. i.e. Swing. More...
 
void setMode (const uint8_t mode)
 Set the desired operation mode. More...
 
uint8_t getMode (void)
 Get the current operation mode setting. More...
 
void setMax (const bool on)
 Control the current Max setting. (i.e. Turbo) More...
 
bool getMax (void)
 Is the Max (i.e. Turbo) setting on? More...
 
void setNight (const bool on)
 Turn on/off the Night mode. i.e. Sleep. More...
 
bool getNight (void)
 Get the status of Night mode. i.e. Sleep. More...
 
void setiFeel (const bool on)
 Turn on/off the iFeel mode. More...
 
bool getiFeel (void)
 Get the status of iFeel mode. More...
 
void setTime (void)
 Set the time for the A/C. More...
 
void setRoomTemp (const uint8_t degrees)
 Set the value for the current room temperature. More...
 
uint8_t getRoomTemp (void)
 Get the currently stored value for the room temperature setting. More...
 
uint8_t * getRaw (void)
 Get the raw state of the object, suitable to be sent with the appropriate IRsend object method. More...
 
void setRaw (const uint8_t state[])
 Set the raw state of the object. More...
 
stdAc::state_t toCommon (void)
 Convert the current internal state into its stdAc::state_t equivilant. More...
 
String toString ()
 Convert the current internal state into a human readable string. More...
 

Static Public Member Functions

static uint8_t calcChecksum (const uint8_t state[], const uint16_t length=kArgoStateLength)
 Verify the checksum is valid for a given state. More...
 
static bool validChecksum (const uint8_t state[], const uint16_t length=kArgoStateLength)
 Verify the checksum is valid for a given state. More...
 
static uint8_t convertMode (const stdAc::opmode_t mode)
 Convert a stdAc::opmode_t enum into its native mode. More...
 
static uint8_t convertFan (const stdAc::fanspeed_t speed)
 Convert a stdAc::fanspeed_t enum into it's native speed. More...
 
static uint8_t convertSwingV (const stdAc::swingv_t position)
 Convert a stdAc::swingv_t enum into it's native setting. More...
 
static stdAc::opmode_t toCommonMode (const uint8_t mode)
 Convert a native mode into its stdAc equivilant. More...
 
static stdAc::fanspeed_t toCommonFanSpeed (const uint8_t speed)
 Convert a native fan speed into its stdAc equivilant. More...
 

Private Member Functions

void stateReset (void)
 Reset the internals of the object to a known good state. More...
 
void checksum (void)
 Update the checksum for the internal state. More...
 

Private Attributes

IRsend _irsend
 instance of the IR send class More...
 
uint8_t argo [kArgoStateLength]
 
uint8_t flap_mode
 
uint8_t heat_mode
 
uint8_t cool_mode
 

Detailed Description

Class for handling detailed Argo A/C messages.

Constructor & Destructor Documentation

◆ IRArgoAC()

IRArgoAC::IRArgoAC ( const uint16_t  pin,
const bool  inverted = false,
const bool  use_modulation = true 
)
explicit

Class constructor.

Parameters
[in]pinGPIO to be used when sending.
[in]invertedIs the output signal to be inverted?
[in]use_modulationIs frequency modulation to be used?

Member Function Documentation

◆ begin()

void IRArgoAC::begin ( void  )

Set up hardware to be able to send a message.

◆ calcChecksum()

uint8_t IRArgoAC::calcChecksum ( const uint8_t  state[],
const uint16_t  length = kArgoStateLength 
)
static

Verify the checksum is valid for a given state.

Parameters
[in]stateThe array to verify the checksum of.
[in]lengthThe size of the state.
Returns
A boolean indicating if it's checksum is valid.

◆ calibrate()

int8_t IRArgoAC::calibrate ( void  )
inline

Run the calibration to calculate uSec timing offsets for this platform.

Returns
The uSec timing offset needed per modulation of the IR Led.
Note
This will produce a 65ms IR signal pulse at 38kHz. Only ever needs to be run once per object instantiation, if at all.

◆ checksum()

void IRArgoAC::checksum ( void  )
private

Update the checksum for the internal state.

◆ convertFan()

uint8_t IRArgoAC::convertFan ( const stdAc::fanspeed_t  speed)
static

Convert a stdAc::fanspeed_t enum into it's native speed.

Parameters
[in]speedThe enum to be converted.
Returns
The native equivilant of the enum.

◆ convertMode()

uint8_t IRArgoAC::convertMode ( const stdAc::opmode_t  mode)
static

Convert a stdAc::opmode_t enum into its native mode.

Parameters
[in]modeThe enum to be converted.
Returns
The native equivilant of the enum.

◆ convertSwingV()

uint8_t IRArgoAC::convertSwingV ( const stdAc::swingv_t  position)
static

Convert a stdAc::swingv_t enum into it's native setting.

Parameters
[in]positionThe enum to be converted.
Returns
The native equivilant of the enum.

◆ getFan()

uint8_t IRArgoAC::getFan ( void  )

Get the current fan speed setting.

Returns
The current fan speed.

◆ getFlap()

uint8_t IRArgoAC::getFlap ( void  )

Get the flap position. i.e. Swing.

Warning
Not yet working!
Returns
The current flap setting.

◆ getiFeel()

bool IRArgoAC::getiFeel ( void  )

Get the status of iFeel mode.

Returns
true if on, false if off.

◆ getMax()

bool IRArgoAC::getMax ( void  )

Is the Max (i.e. Turbo) setting on?

Returns
The current value.

◆ getMode()

uint8_t IRArgoAC::getMode ( void  )

Get the current operation mode setting.

Returns
The current operation mode.

◆ getNight()

bool IRArgoAC::getNight ( void  )

Get the status of Night mode. i.e. Sleep.

Returns
true if on, false if off.

◆ getPower()

bool IRArgoAC::getPower ( void  )

Get the power setting from the internal state.

Returns
A boolean indicating the power setting.

◆ getRaw()

uint8_t * IRArgoAC::getRaw ( void  )

Get the raw state of the object, suitable to be sent with the appropriate IRsend object method.

Returns
A PTR to the internal state.

◆ getRoomTemp()

uint8_t IRArgoAC::getRoomTemp ( void  )

Get the currently stored value for the room temperature setting.

Returns
The current setting for the room temp. in degrees celsius.

◆ getTemp()

uint8_t IRArgoAC::getTemp ( void  )

Get the current temperature setting.

Returns
The current setting for temp. in degrees celsius.

◆ off()

void IRArgoAC::off ( void  )

Set the internal state to have the power off.

◆ on()

void IRArgoAC::on ( void  )

Set the internal state to have the power on.

◆ send()

void IRArgoAC::send ( const uint16_t  repeat = kArgoDefaultRepeat)

Send the current internal state as an IR message.

Parameters
[in]repeatNr. of times the message will be repeated.

◆ setFan()

void IRArgoAC::setFan ( const uint8_t  fan)

Set the speed of the fan.

Parameters
[in]fanThe desired setting.

◆ setFlap()

void IRArgoAC::setFlap ( const uint8_t  flap)

Set the flap position. i.e. Swing.

Warning
Not yet working!
Parameters
[in]flapThe desired setting.

◆ setiFeel()

void IRArgoAC::setiFeel ( const bool  on)

Turn on/off the iFeel mode.

Parameters
[in]onThe desired setting.

◆ setMax()

void IRArgoAC::setMax ( const bool  on)

Control the current Max setting. (i.e. Turbo)

Parameters
[in]onThe desired setting.

◆ setMode()

void IRArgoAC::setMode ( const uint8_t  mode)

Set the desired operation mode.

Parameters
[in]modeThe desired operation mode.

◆ setNight()

void IRArgoAC::setNight ( const bool  on)

Turn on/off the Night mode. i.e. Sleep.

Parameters
[in]onThe desired setting.

◆ setPower()

void IRArgoAC::setPower ( const bool  on)

Set the internal state to have the desired power.

Parameters
[in]onThe desired power state.

◆ setRaw()

void IRArgoAC::setRaw ( const uint8_t  state[])

Set the raw state of the object.

Parameters
[in]stateThe raw state from the native IR message.

◆ setRoomTemp()

void IRArgoAC::setRoomTemp ( const uint8_t  degrees)

Set the value for the current room temperature.

Parameters
[in]degreesThe temperature in degrees celsius.

◆ setTemp()

void IRArgoAC::setTemp ( const uint8_t  degrees)

Set the temperature.

Parameters
[in]degreesThe temperature in degrees celsius.
Note
Sending 0 equals +4

◆ setTime()

void IRArgoAC::setTime ( void  )

Set the time for the A/C.

Warning
Not yet working!

◆ stateReset()

void IRArgoAC::stateReset ( void  )
private

Reset the internals of the object to a known good state.

◆ toCommon()

stdAc::state_t IRArgoAC::toCommon ( void  )

Convert the current internal state into its stdAc::state_t equivilant.

Returns
The stdAc equivilant of the native settings.

◆ toCommonFanSpeed()

stdAc::fanspeed_t IRArgoAC::toCommonFanSpeed ( const uint8_t  speed)
static

Convert a native fan speed into its stdAc equivilant.

Parameters
[in]speedThe native setting to be converted.
Returns
The stdAc equivilant of the native setting.

◆ toCommonMode()

stdAc::opmode_t IRArgoAC::toCommonMode ( const uint8_t  mode)
static

Convert a native mode into its stdAc equivilant.

Parameters
[in]modeThe native setting to be converted.
Returns
The stdAc equivilant of the native setting.

◆ toString()

String IRArgoAC::toString ( )

Convert the current internal state into a human readable string.

Returns
A human readable string.

◆ validChecksum()

bool IRArgoAC::validChecksum ( const uint8_t  state[],
const uint16_t  length = kArgoStateLength 
)
static

Verify the checksum is valid for a given state.

Parameters
[in]stateThe array to verify the checksum of.
[in]lengthThe size of the state.
Returns
A boolean indicating if it's checksum is valid.

Member Data Documentation

◆ _irsend

IRsend IRArgoAC::_irsend
private

instance of the IR send class

◆ argo

uint8_t IRArgoAC::argo[kArgoStateLength]
private

◆ cool_mode

uint8_t IRArgoAC::cool_mode
private

◆ flap_mode

uint8_t IRArgoAC::flap_mode
private

◆ heat_mode

uint8_t IRArgoAC::heat_mode
private

The documentation for this class was generated from the following files: