#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "System.h"
#include "CommsSystem.h"
#include "../Scheduler/Task.h"
Go to the source code of this file.
◆ ExternalSystem
◆ ExternalType
◆ e_defaultUpdate()
Default update function for ExternalSystem objects.
- Parameters
-
task | Pointer to the task to update. |
- Returns
- int _SUCCESS or _FAILURE.
Definition at line 20 of file ExternalSystem.c.
20 {
21
24
25
26 if (external->check_heartbeat(external) ==
_FAILURE) {
28 }
29
30
31 if (external->updateExternal(external) ==
_FAILURE) {
33 }
34
36}
◆ initExternalSystem()
Initializes the External System with initial settings.
- Parameters
-
external | A pointer to the ExternalSystem structure. |
name | The name of the external system. |
hz | Rate at which the external system is called (in hz). |
type | The type of external system (per ExternalType). |
updateExternal | The function to update the external system. |
check_heartbeat | The function to check the heartbeat of the external system. |
child | Pointer to the child struct. |
Definition at line 6 of file ExternalSystem.c.
8 {
10 external->
type = type;
11 external->
comms = NULL;
14 external->
child = child;
15
16
18}
int e_defaultUpdate(Updateable *updateable)
void initSystem(System *system, const char *name, int hz, SystemType type, void *child)
Initializes a System object.
int(* updateExternal)(struct ExternalSystem *external)
int(* check_heartbeat)(void *self)
int(* update)(struct Updateable *self)