UniSaSA  1.0
C Gateway
gateway.h
Go to the documentation of this file.
1 
21 #ifndef _GATEWAY_H_
22 #define _GATEWAY_H_
23 
24 
25 #include <sys/types.h>
26 #include <sys/socket.h>
27 #include <unistd.h>
28 #include <netinet/in.h> // sockaddr_in
29 #include <fcntl.h>
30 #include <stdlib.h>
31 #include <string.h>
32 #include <stdio.h>
33 
34 //#include<omp.h>
35 
36 #include "unisasa_types.h"
37 #include "connector.h"
38 #include "configuration.h"
39 
45 typedef union messageInt_t {
46  unsigned int integer;
47  unsigned char byte[256]; // max unit message
48 } messageInt_t;
49 
55 void init_gateway();
56 
66 void load_table(char *path);
67 
75 
81 unsigned int getNumDevices();
82 
88 void addConnector(connectorInterface_t newConnector);
89 
96 
101 void verifyDevices();
102 
106 void verifyTable();
107 
113 void createNewTable();
114 
120 void create_tcp_server(unsigned int port);
121 
125 void close_gateway();
126 
131 int wait_client();
132 
139 void client_communication(int client_sock);
140 
141 
142 #endif
143 
void verifyDevices()
Definition: gateway.c:303
device_t * getDevices()
Definition: gateway.c:292
void createNewTable()
Definition: gateway.c:318
void close_gateway()
Definition: gateway.c:356
void init_gateway()
Definition: gateway.c:67
void create_tcp_server(unsigned int port)
Definition: gateway.c:330
void addConnector(connectorInterface_t newConnector)
Definition: gateway.c:105
void discoveryAndCreateTable()
Definition: gateway.c:111
void load_table(char *path)
Definition: gateway.c:167
int wait_client()
Definition: gateway.c:363
void verifyTable()
Definition: gateway.c:313
unsigned int getNumDevices()
Definition: gateway.c:297
void client_communication(int client_sock)
Definition: gateway.c:374
union messageInt_t messageInt_t