Developer World
Spresense SDK Library v3.3.0-375c679
supervisor.h File Reference
#include <pthread.h>
#include <asmp/types.h>
#include <asmp/mptask.h>
#include <asmp/mpmq.h>
#include <mpcomm/mpcomm.h>

Go to the source code of this file.

Classes

struct  worker_info
 
struct  supervisor_context
 

Typedefs

typedef struct worker_info worker_info_t
 
typedef struct supervisor_context mpcomm_supervisor_context_t
 

Functions

int mpcomm_supervisor_init (mpcomm_supervisor_context_t **ctx, const char *filepath, uint8_t helper_num)
 
int mpcomm_supervisor_deinit (mpcomm_supervisor_context_t *ctx)
 
int mpcomm_supervisor_send_controller (mpcomm_supervisor_context_t *ctx, void *data)
 
int mpcomm_supervisor_wait_controller_done (mpcomm_supervisor_context_t *ctx, const struct timespec *abstime)
 

Typedef Documentation

◆ worker_info_t

◆ mpcomm_supervisor_context_t

Function Documentation

◆ mpcomm_supervisor_init()

int mpcomm_supervisor_init ( mpcomm_supervisor_context_t **  ctx,
const char *  filepath,
uint8_t  helper_num 
)

Initialize the MPCOMM framework.

Parameters
[in]ctxContext with information about MPCOMM workers.
[in]filepathPath to controller and helper binary file.
[in]helper_numNumber of helpers to be used.
Returns
On success, 0 is returned. On failure, negative value is returned according to <errno.h>.

◆ mpcomm_supervisor_deinit()

int mpcomm_supervisor_deinit ( mpcomm_supervisor_context_t ctx)

Deinitialize the MPCOMM framework.

Parameters
[in]ctxContext with information about MPCOMM workers.
Returns
On success, 0 is returned. On failure, negative value is returned according to <errno.h>.

◆ mpcomm_supervisor_send_controller()

int mpcomm_supervisor_send_controller ( mpcomm_supervisor_context_t ctx,
void *  data 
)

Send the user data to the controller for processing.

Parameters
[in]ctxContext with information about MPCOMM workers.
[in]dataUser data.
Returns
On success, 0 is returned. On failure, negative value is returned according to <errno.h>.

◆ mpcomm_supervisor_wait_controller_done()

int mpcomm_supervisor_wait_controller_done ( mpcomm_supervisor_context_t ctx,
const struct timespec *  abstime 
)

Wait until user data has been processed by controller.

Parameters
[in]ctxContext with information about MPCOMM workers.
[in]abstimeThe absolute time to wait until a timeout is declared.
Returns
On success, 0 is returned. On failure, negative value is returned according to <errno.h>.