Aruna
aruna::sis::status_t Struct Reference

status that is to be reported to the watcher More...

#include <sisTypes.h>

Inheritance diagram for aruna::sis::status_t:

Public Member Functions

 status_t (type_t type)
 
virtual ~status_t ()
 
virtual uint8_t get_encode_size ()
 
virtual void encode (uint8_t *buffer)
 
virtual void decode (uint8_t *to_decode)
 

Public Attributes

level_t level = level_t::NOTIFY
 
char description [32]
 
type_t type
 

Detailed Description

status that is to be reported to the watcher

Definition at line 36 of file sisTypes.h.

Constructor & Destructor Documentation

◆ status_t()

aruna::sis::status_t::status_t ( type_t  type)
inlineexplicit

Definition at line 43 of file sisTypes.h.

43 : type(type) {};

◆ ~status_t()

virtual aruna::sis::status_t::~status_t ( )
inlinevirtual

Definition at line 44 of file sisTypes.h.

44 {};

Member Function Documentation

◆ decode()

virtual void aruna::sis::status_t::decode ( uint8_t *  to_decode)
inlinevirtual

Reimplemented in aruna::sensor::water_status_t.

Definition at line 56 of file sisTypes.h.

56  {
57  type = (type_t) to_decode[0];
58  level = (level_t) to_decode[1];
59  memcpy(description, (char *) &to_decode[3], to_decode[2]);
60  }
type_t
Type of status.
Definition: sisTypes.h:26
level_t
SIS urgency level.
Definition: sisTypes.h:16
char description[32]
Definition: sisTypes.h:40
Here is the caller graph for this function:

◆ encode()

virtual void aruna::sis::status_t::encode ( uint8_t *  buffer)
inlinevirtual

Reimplemented in aruna::sensor::water_status_t.

Definition at line 49 of file sisTypes.h.

49  {
50  buffer[0] = (uint8_t) type;
51  buffer[1] = (uint8_t) level;
52  buffer[2] = strlen(description);
53  memcpy((char *) &buffer[3], (const char *) description, strlen(description));
54  }
char description[32]
Definition: sisTypes.h:40
Here is the caller graph for this function:

◆ get_encode_size()

virtual uint8_t aruna::sis::status_t::get_encode_size ( )
inlinevirtual

Reimplemented in aruna::sensor::water_status_t.

Definition at line 45 of file sisTypes.h.

45  {
46  return strlen(description) + 3;
47  }
char description[32]
Definition: sisTypes.h:40
Here is the caller graph for this function:

Member Data Documentation

◆ description

char aruna::sis::status_t::description[32]

Definition at line 40 of file sisTypes.h.

◆ level

level_t aruna::sis::status_t::level = level_t::NOTIFY

Definition at line 39 of file sisTypes.h.

◆ type

type_t aruna::sis::status_t::type

Definition at line 41 of file sisTypes.h.


The documentation for this struct was generated from the following file: