aboutsummaryrefslogtreecommitdiff
path: root/includes/types.h
blob: 149415ec5303b6dcad2807cca28af261fdf2bc76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef TYPES_H
#define TYPES_H
#include <semaphore.h>

#define true 1
#define false 0

typedef int boolean;
typedef struct sensor_t Sensor_t;
typedef struct queue_t Queue_t;
typedef struct fifo_q Fifo_q;

struct sensor_t{
    int uid;
    int value;
};

struct queue_t{
    Sensor_t * sensor;
    Queue_t * next;
};

struct fifo_q{
    Queue_t * head;
    Queue_t * tail;
    int maxSize;
    int currentSize;
    int droppedValues;
    int largestBufferSize;
    int valuesReceived;
    int valuesReleased;
    sem_t bufferEmptyBlock;
    sem_t bufferFullBlock;
    sem_t lock;
};

#endif