#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
|
#define | UPDATE(item_) ((item_)->update(item_)) |
|
#define | STATUS(item_) ((item_).updateable.status(&item_.updateable)) |
|
#define | ENABLE(item_) ((item_).updateable.enable(&item_.updateable)) |
|
#define | DISABLE(item_) ((item_).updateable.disable(&item_.updateable)) |
|
#define | MAX_NAME_LENGTH 32 |
|
#define | DISABLED 0 |
|
#define | ENABLED 1 |
|
◆ DISABLE
#define DISABLE |
( |
|
item_ | ) |
((item_).updateable.disable(&item_.updateable)) |
◆ DISABLED
◆ ENABLE
#define ENABLE |
( |
|
item_ | ) |
((item_).updateable.enable(&item_.updateable)) |
◆ ENABLED
◆ MAX_NAME_LENGTH
#define MAX_NAME_LENGTH 32 |
◆ STATUS
#define STATUS |
( |
|
item_ | ) |
((item_).updateable.status(&item_.updateable)) |
◆ UPDATE
#define UPDATE |
( |
|
item_ | ) |
((item_)->update(item_)) |
◆ Updateable
◆ UpdateableType
Enumerator |
---|
OUTPUT | |
SENSOR | |
SYSTEM | |
Definition at line 17 of file Updateable.h.
◆ defaultDisable()
◆ defaultEnable()
◆ defaultStatus()
◆ defaultUpdate()
Default update function for Updateable objects.
- Parameters
-
Definition at line 20 of file Updateable.c.
20 {
21
24}
#define ANSI_COLOR_YELLOW
char name[MAX_NAME_LENGTH]
◆ initUpdateable()
Definition at line 6 of file Updateable.c.
6 {
7
15 updateable->
type = utype;
16
17 updateable->
child = child;
18}
int defaultEnable(struct Updateable *self)
Default enable function for Updateable objects.
int defaultDisable(struct Updateable *self)
Default disable function for Updateable objects.
int defaultUpdate(Updateable *self)
Default update function for Updateable objects.
int defaultStatus(struct Updateable *self)
Default status function for Updateable objects.
int(* disable)(struct Updateable *self)
int(* status)(struct Updateable *self)
int(* update)(struct Updateable *self)
int(* enable)(struct Updateable *self)
◆ writeDataToFileImplementation()
int writeDataToFileImplementation |
( |
const char * |
filename, |
|
|
void * |
self |
|
) |
| |
Write data to a file.
- Parameters
-
filename | Name of the file to write to. |
self | Pointer to the object whose data is to be written. |
- Returns
- _SUCCESS if the data was written, _FAILURE otherwise.
Definition at line 40 of file Updateable.c.
40 {
41 FILE* file = fopen(filename, "w");
42 if (!file) {
43 perror("Failed to open file");
45 }
46
47 printf("Writing data to file %s\n", filename);
48
49 fclose(file);
51}