Aruna
aruna::sis::reporter Namespace Reference

Functions

err_t start ()
 start reporter to report all SIS activiry to the watcher over comm channels More...
 
void alert (status_t *status)
 alert watcher with given status_t More...
 

Variables

static const comm::port_t port = 1
 

Function Documentation

◆ alert()

void aruna::sis::reporter::alert ( status_t status)

alert watcher with given status_t

Parameters
status

Definition at line 23 of file reporter.cpp.

23  {
24 // encode status
25  auto* buffer = static_cast<uint8_t *>(malloc(status->get_encode_size()));
26  status->encode(buffer);
27  err_t send_err = comm_channel->send(watcher::port, buffer, status->get_encode_size(), true);
28  if ((uint8_t) send_err)
29  log_channel->error("failed to send SIS report to watcher: %s", err_to_char.at(send_err));
30  free(buffer);
31 }
const std::map< err_t, char * > err_to_char
Definition: arunaTypes.h:54
status_t status
stores the comm status
Definition: comm.cpp:40
err_t send(port_t to_port, uint8_t *data, size_t data_size, bool wait_for_ack=false)
Definition: comm.cpp:513
comm::channel_t * comm_channel
Definition: reporter.cpp:13
int error(const char *format,...)
log error message
Definition: log.cpp:90
static const comm::port_t port
Definition: reporter.h:15
Here is the call graph for this function:
Here is the caller graph for this function:

◆ start()

aruna::err_t aruna::sis::reporter::start ( )

start reporter to report all SIS activiry to the watcher over comm channels

Returns
err if failed to register comm channel.

start reporter to report all SIS activiry to the watcher over comm channels

Using LINK_HARDWARE to define hardware

Return values
err_t
  • HARDWARE_ERROR if the hardware fails.
  • OK great success!

start reporter to report all SIS activiry to the watcher over comm channels

Returns
status_t, returns current status of the modulke
  • RUNNING if it is running,
  • STOPPED is it us currenty stopped.

Definition at line 16 of file reporter.cpp.

16  {
18 // TODO error check
19  log_channel = new log::channel_t("SIS report");
20  return comm_channel->register_err;
21 }
comm::channel_t * comm_channel
Definition: reporter.cpp:13
endpoint type of a comm channel
Definition: commTypes.h:150
static const comm::port_t port
Definition: reporter.h:15

Variable Documentation

◆ port

const comm::port_t aruna::sis::reporter::port = 1
static

Definition at line 15 of file reporter.h.