osd_hostctrl class

This class contains the host controller. The host controller is the central instance in a host subnet and has the following tasks:

  • It serves as central connection point for all host modules (i.e. forming a star topology). As such, it handles the setup and teardown of connections, as well as assigning of DI addreses.
  • It routes messages between host modules.
  • Gateways can connect to the host controller to extend the debug network beyond the host.

Usage

#include <osd/osd.h>
#include <osd/hostctrl.h>

Public Interface

Functions

osd_result osd_hostctrl_new(struct osd_hostctrl_ctx ** ctx, struct osd_log_ctx * log_ctx, const char * router_address)

Create new host controller

The host controller will listen to requests at router_addres

Return
OSD_OK if initialization was successful, any other return code indicates an error
Parameters
  • ctx: context object
  • log_ctx: logging context
  • router_address: ZeroMQ endpoint/URL the host controller will listen on

osd_result osd_hostctrl_start(struct osd_hostctrl_ctx * ctx)

Start host controller

osd_result osd_hostctrl_stop(struct osd_hostctrl_ctx * ctx)

Stop host controller

void osd_hostctrl_free(struct osd_hostctrl_ctx ** ctx_p)

Free the host controller context object (destructor)

By calling this function all resources associated with the context object are freed and the ctx_p itself is NULLed.

Parameters
  • ctx_p: the host controller context object

bool osd_hostctrl_is_running(struct osd_hostctrl_ctx * ctx)

Is the host controller running?

Return
true if the host controller is running, false otherwise
Parameters
  • ctx: the context object