AiCPlayer
Interface of aic vm - for rendering aspect, sensors, video records
sensors.h
Go to the documentation of this file.
1 
6 #ifndef __SENSORS_H_
7 #define __SENSORS_H_
8 
10 #define PORT_SENSORS 22471
11 
12 #define PORT_BAT 22473
13 
14 #define PORT_GPS 22475
15 
16 #define PORT_GSM 6704
17 
18 #define PORT_NFC 22800
19 
20 #define FREQ_SENSORS 100000 // frequency sending data sensors in micro seconds
21 #define FREQ_BAT 2 * 1000000 // frequency sending data battery in micro seconds
22 #define FREQ_GPS 2 * 1000000 // frequency sending data GPS in micro seconds
23 #define FREQ_DEFAULT 1 * 1000000 // frequency default in micro seconds
24 
25 #include <stdint.h>
26 #include <pthread.h>
27 
28 #include "buffer_sizes.h"
29 
31 typedef struct s_sensor_params
32 {
34  int32_t port;
40  char queue[BUF_SIZE];
42  const char* gvmip;
44  const char* amqp_host;
46  int32_t frequency;
48  int8_t flagRecording;
50 
58 sensor_params* ParamEventsWorker(const char* vmip, const char* vmid, const char* sensor_name,
59  const char* amqp_host);
60 
65 void start_sensor(sensor_params* params, pthread_t* thread);
66 
67 #endif
char sensor[BUF_SIZE]
Sensor name.
Definition: sensors.h:36
sensor_params * ParamEventsWorker(const char *vmip, const char *vmid, const char *sensor_name, const char *amqp_host)
Creates the data structure for sensor threads.
Definition: sensors.c:105
Parameter for sensor threads.
Definition: sensors.h:31
#define BUF_SIZE
Small, fixed-size buffers.
Definition: buffer_sizes.h:9
const char * gvmip
VM IP.
Definition: sensors.h:42
struct s_sensor_params sensor_params
Parameter for sensor threads.
char queue[BUF_SIZE]
Queue name.
Definition: sensors.h:40
char exchange[BUF_SIZE]
Exchange name.
Definition: sensors.h:38
void start_sensor(sensor_params *params, pthread_t *thread)
Start the sensor listener thread.
Definition: sensors.c:154
int32_t frequency
Sensor throttling.
Definition: sensors.h:46
Define common buffer sizes.
const char * amqp_host
AMQP host.
Definition: sensors.h:44
int8_t flagRecording
Grabber-specific ??
Definition: sensors.h:48
int32_t port
Remote port.
Definition: sensors.h:34