LibJuno 0.23.0
LibJuno is a lightweight C99 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
subscriber_api.h
Go to the documentation of this file.
1/*
2 MIT License
3
4 Copyright (c) 2025 Robin A. Onsay
5
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files
8 (the "Software"), to deal in the Software without restriction,
9 including without limitation the rights to use, copy, modify, merge,
10 publish, distribute, sublicense, and/or sell copies of the Software,
11 and to permit persons to whom the Software is furnished to do so,
12 subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be
15 included in all copies or substantial portions of the Software.
16*/
17
27#ifndef JUNO_SUBSCRIBER_API_H
28#define JUNO_SUBSCRIBER_API_H
30#include "juno/sb/msg_api.h"
32#include "juno/status.h"
33#include "juno/module.h"
34#include "juno/time/time_api.h"
35#ifdef __cplusplus
36extern "C"
37{
38#endif
39
41
42JUNO_MODULE_DECLARE(JUNO_SUBSCRIBER_T);
43JUNO_MODULE_BASE_DECLARE(JUNO_SUBSCRIBER_BASE_T);
44
46 JUNO_MEMORY_ALLOC_T *ptAlloc;
47);
48
50{
52 JUNO_STATUS_T (*Subscribe)(JUNO_SUBSCRIBER_T *ptJunoSubscriber, const JUNO_PUBLISHER_ID_T *ptPublisher);
54 JUNO_STATUS_T (*Recv)(JUNO_SUBSCRIBER_T *ptJunoSubscriber, JUNO_MSG_T *ptMsg);
56 JUNO_STATUS_T (*TryRecv)(JUNO_SUBSCRIBER_T *ptJunoSubscriber, JUNO_MSG_T *ptMsg, JUNO_TIME_MICROS_T iTimeoutUs);
57};
58
59#ifdef __cplusplus
60}
61#endif
62#endif // JUNO_SUBSCRIBER_API_H
#define JUNO_MODULE_BASE(name, API, members)
Definition module.h:81
#define JUNO_MODULE_BASE_DECLARE(name)
Definition module.h:31
#define JUNO_MODULE_DECLARE(name)
Definition module.h:26
struct JUNO_PUBLISHER_ID_TAG JUNO_PUBLISHER_ID_T
Definition publisher_api.h:38
enum JUNO_STATUS_TAG JUNO_STATUS_T
Definition subscriber_api.h:50
JUNO_STATUS_T(* TryRecv)(JUNO_SUBSCRIBER_T *ptJunoSubscriber, JUNO_MSG_T *ptMsg, JUNO_TIME_MICROS_T iTimeoutUs)
Try to recv subscribed messages.
Definition subscriber_api.h:56
JUNO_STATUS_T(* Subscribe)(JUNO_SUBSCRIBER_T *ptJunoSubscriber, const JUNO_PUBLISHER_ID_T *ptPublisher)
Subscribe to a publisher.
Definition subscriber_api.h:52
JUNO_STATUS_T(* Recv)(JUNO_SUBSCRIBER_T *ptJunoSubscriber, JUNO_MSG_T *ptMsg)
Recv subscribed messages.
Definition subscriber_api.h:54
uint64_t JUNO_TIME_MICROS_T
Definition time_api.h:39