| LightHub v4.0.0 Smarthome controller firmware

Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Item Class Reference

`#include <item.h>`

## Public Member Functions
| Item (char *name)
| Item (aJsonObject *obj)
| ~Item ()
boolean | isValid ()
boolean | Setup ()
void | Stop ()
int | Ctrl (itemCmd cmd, char *subItem=NULL, bool allowRecursion=true)
int | Ctrl (char *payload, char *subItem=NULL)
int | getArg (short n=0)
float | getFloatArg (short n=0)
short | getArgCount ()
long int | getVal ()
uint8_t | getSubtype ()
uint8_t | getCmd ()
long int | getExt ()
void | setExt (long int par)
chPersistent * | getPersistent ()
chPersistent * | setPersistent (chPersistent *par)
void | setCmd (uint8_t cmdValue)
short | getFlag (short flag=FLAG_MASK)
void | setFlag (short flag)
void | clearFlag (short flag)
void | setVal (long int par)
void | setFloatVal (float par)
void | setSubtype (uint8_t par)
int | Poll (int cause)
int | SendStatus (int sendFlags)
int | SendStatusImmediate (itemCmd st, int sendFlags, char *subItem=NULL)
int | isActive ()
int | getChanType ()
int | On ()
int | Off ()
int | Toggle ()

## Public Attributes
aJsonObject * | itemArr
aJsonObject * | itemArg
aJsonObject * | itemVal
aJsonObject * | itemExt
uint8_t | itemType
abstractOut * | driver

## Protected Member Functions
int | VacomSetFan (itemCmd st)
int | VacomSetHeat (itemCmd st)
| move to float todo More...
int | modbusDimmerSet (itemCmd st)
int | modbusDimmerSet (int addr, uint16_t _reg, int _regType, int _mask, uint16_t value)
void | mb_fail (int result=0)
void | Parse ()
int | checkModbusDimmer ()
int | checkModbusDimmer (int data)
int | checkModbusRetry ()
void | sendDelayedStatus ()
bool | resumeModbus ()
int | checkFM ()

## Protected Attributes
char | defaultSubItem [10]
int | defaultSuffixCode

## Constructor & Destructor Documentation

## ◆ Item() [1/2]

Item::Item | ( | char * | name | ) |

## ◆ Item() [2/2]

Item::Item | ( | aJsonObject * | obj | ) |

## ◆ ~Item()

Item::~Item | ( |  | ) |

## Member Function Documentation

## ◆ checkFM()

int Item::checkFM | ( |  | ) |
| protected

## ◆ checkModbusDimmer() [1/2]

int Item::checkModbusDimmer | ( |  | ) |
| protected

## ◆ checkModbusDimmer() [2/2]

int Item::checkModbusDimmer | ( | int | data | ) |
| protected

## ◆ checkModbusRetry()

int Item::checkModbusRetry | ( |  | ) |
| protected

## ◆ clearFlag()

void Item::clearFlag | ( | short | flag | ) |

## ◆ Ctrl() [1/2]

int Item::Ctrl | ( | char * | payload,
|  | char * | subItem = `NULL`
| ) |  |

possible problem here with truncated default

## ◆ Ctrl() [2/2]

int Item::Ctrl | ( | itemCmd | cmd,
|  | char * | subItem = `NULL`,
|  | bool | allowRecursion = `true`
| ) |  |

possible problem here with truncated default

DELAYED COMMANDS processing

Common (GRP & NO GRP) commands

rest of Legacy monolite core code (to be refactored ) BEGIN ///

rest of Legacy monolite core code (to be refactored ) END ///

## ◆ getArg()

int Item::getArg | ( | short | n = `0` | ) |

## ◆ getArgCount()

short Item::getArgCount | ( |  | ) |

## ◆ getChanType()

int Item::getChanType | ( |  | ) |

## ◆ getCmd()

uint8_t Item::getCmd | ( |  | ) |

## ◆ getExt()

long int Item::getExt | ( |  | ) |

## ◆ getFlag()

short Item::getFlag | ( | short | flag = `FLAG_MASK` | ) |

## ◆ getFloatArg()

float Item::getFloatArg | ( | short | n = `0` | ) |

## ◆ getPersistent()

chPersistent * Item::getPersistent | ( |  | ) |

## ◆ getSubtype()

uint8_t Item::getSubtype | ( |  | ) |

## ◆ getVal()

long int Item::getVal | ( |  | ) |

## ◆ isActive()

int Item::isActive | ( |  | ) |

## ◆ isValid()

boolean Item::isValid | ( |  | ) |

## ◆ mb_fail()

void Item::mb_fail | ( | int | result = `0` | ) |
| protected

## ◆ modbusDimmerSet() [1/2]

int Item::modbusDimmerSet | ( | int | addr,
|  | uint16_t | _reg,
|  | int | _regType,
|  | int | _mask,
|  | uint16_t | value
| ) |  |
| protected

## ◆ modbusDimmerSet() [2/2]

int Item::modbusDimmerSet | ( | itemCmd | st | ) |
| protected

## ◆ Off()

int Item::Off | ( |  | ) |
| inline

## ◆ On()

int Item::On | ( |  | ) |
| inline

## ◆ Parse()

void Item::Parse | ( |  | ) |
| protected

## ◆ Poll()

int Item::Poll | ( | int | cause | ) |

## ◆ resumeModbus()

bool Item::resumeModbus | ( |  | ) |
| protected

## ◆ sendDelayedStatus()

void Item::sendDelayedStatus | ( |  | ) |
| protected

## ◆ SendStatus()

int Item::SendStatus | ( | int | sendFlags | ) |

## ◆ SendStatusImmediate()

int Item::SendStatusImmediate | ( | itemCmd | st,
|  | int | sendFlags,
|  | char * | subItem = `NULL`
| ) |  |

## ◆ setCmd()

void Item::setCmd | ( | uint8_t | cmdValue | ) |

## ◆ setExt()

void Item::setExt | ( | long int | par | ) |

## ◆ setFlag()

void Item::setFlag | ( | short | flag | ) |

## ◆ setFloatVal()

void Item::setFloatVal | ( | float | par | ) |

## ◆ setPersistent()

chPersistent * Item::setPersistent | ( | chPersistent * | par | ) |

## ◆ setSubtype()

void Item::setSubtype | ( | uint8_t | par | ) |

## ◆ Setup()

boolean Item::Setup | ( |  | ) |

## ◆ setVal()

void Item::setVal | ( | long int | par | ) |

## ◆ Stop()

void Item::Stop | ( |  | ) |

## ◆ Toggle()

int Item::Toggle | ( |  | ) |
| inline

## ◆ VacomSetFan()

int Item::VacomSetFan | ( | itemCmd | st | ) |
| protected

## ◆ VacomSetHeat()

int Item::VacomSetHeat | ( | itemCmd | st | ) |
| protected

move to float todo

## Member Data Documentation

## ◆ defaultSubItem

char Item::defaultSubItem[10]
| protected

## ◆ defaultSuffixCode

int Item::defaultSuffixCode
| protected

## ◆ driver

abstractOut* Item::driver

## ◆ itemArg

aJsonObject * Item::itemArg

## ◆ itemArr

aJsonObject* Item::itemArr

## ◆ itemExt

aJsonObject * Item::itemExt

## ◆ itemType

uint8_t Item::itemType

## ◆ itemVal

aJsonObject * Item::itemVal

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

- item.h
- item.cpp