Modbus Vault v1.0
Loading...
Searching...
No Matches
router.c File Reference

Implementation of the system routing helpers. More...

#include "router.h"
#include "blackbox_logger.h"
#include "logger_service.h"
#include "slab_pool.h"
#include "telemetry_service.h"
Include dependency graph for router.c:

Functions

static bool replay_callback (void *arg_void_ptr, const blackbox_logger_entry_view_t *entry_ptr)
 Publish replay and return error code.
 
void router_dispatch (const telemetry_pipeline_record_t *payload_ptr)
 Dispatch serialized frames.
 
bool router_publish_replay (void)
 Try publishing replays.
 
void router_on_replay_available_callback (void)
 Notify telemetry service that replay is available.
 

Detailed Description

Implementation of the system routing helpers.

Author
Abanoub Salah
  • Dispatch serialized frames publish/log
  • Notify telemetry service when replay available through callback
  • Try publishing available replays when connection resumes

Function Documentation

◆ replay_callback()

static bool replay_callback ( void *  arg_void_ptr,
const blackbox_logger_entry_view_t entry_ptr 
)
static

Publish replay and return error code.

Parameters
arg_void_ptrVoid pointer to argument
entry_ptrPointer to log entry
Returns
true on success false otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ router_dispatch()

void router_dispatch ( const telemetry_pipeline_record_t payload_ptr)

Dispatch serialized frames.

Dispatch serialized frames to be published if connected or loggger otherwise

Parameters
payload_ptrPointer to payload
Note
This needs to be as light as possible so it just enqueues to corresponding queue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ router_publish_replay()

bool router_publish_replay ( void  )

Try publishing replays.

Fetch next logged replay if MQTT connected and try to send it

Returns
true on success false otherwise
Here is the call graph for this function:
Here is the caller graph for this function: