Repository navigation
Expand file tree
/
Copy pathbcast.h
More file actions
93 lines (79 loc) · 1.9 KB
/
Copy pathbcast.h
File metadata and controls
93 lines (79 loc) · 1.9 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#ifndef _IDENT_H
#define _IDENT_H
#include <algorithm>
#include <iterator>
#include <string>
#include <unistd.h>
#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cerrno>
#include <fcntl.h>
#include <sstream>
#include <vector>
#include <cstdlib>
#include <termios.h>
#include <ctime>
#include "PracticalSocket.h"
#include <curl/curl.h>
#include <fstream>
#include <thread>
#define DEFAULTPORT 4451
#define FAIL 10 // Maximum # of failiures allowed
#define BLANKIP "0.0.0.0"
#define BUFSIZE 10000 // for modem and gps
#define SBUFSIZE 50 // for conf updates
#define ERRORSTRING "ERROR"
#define SERV_TIME 15
#define SUPDATE 3600 //5 minutes 30 seconds
#define WAITTIME 3600
#define BLANK "000"
#define ERRORSTRING "ERROR"
#define IDBUFSIZE 10000
#define USBDATA "/opt/usb"
#define LOCALIP "0.0.0.0 0.0.0.0 0.0.0.0"
#define LOCALPORT "04551 04551 04551"
#define CONFFILE "/opt/broadcast.conf"
using namespace std;
//ident.cpp
string ident();
void msleep(unsigned int seconds);
//info.cpp
size_t write_callback(char *ptr, size_t size, size_t nmemb, string *userdata);
string getdata(const char* addr);
string finder (string tag, string data);
bool info();
//dev.cpp
void device();
//conf.cpp
bool conf();
//bcast.cpp
bool bcast (string line,string id,string &hostip, unsigned short destport);
vector<string> updateip (string data);
vector<unsigned short> updateport (string data);
void checkinternet();
//car.cpp
bool carinit();
string carinfo();
void carread();
//char *incom, int length, char **buf);
#ifdef _VARS_
#define _EXTERN_
#else
#define _EXTERN_ extern
#endif
_EXTERN_ string modem;
_EXTERN_ string gps;
_EXTERN_ string serport;
_EXTERN_ string sip;
_EXTERN_ string sport;
_EXTERN_ string id;
_EXTERN_ string meterstatus;
_EXTERN_ string addressa;
_EXTERN_ string addressb;
_EXTERN_ string localips;
_EXTERN_ string localports;
//_EXTERN_ UDPSocket sock;
_EXTERN_ string pingip;
#endif