Communication.h
Go to the documentation of this file.
1 /*
2 BSD 2-Clause License
3 
4 Copyright (c) 2019, Simranjeet Singh
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice, this
11  list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28 
29 #ifndef COMMUNICATION_H
30 #define COMMUNICATION_H
31 
32 #include <stdio.h>
33 #include <string>
34 
35 extern int socketSyckLock;
36 
37 extern int socketOpStarted;
38 
40 
41 public:
42 
43 bool connectSock();
44 bool connectMulSock(const std::string& ip, int index);
45 
46 bool disconnectSock();
47 
48 int writeSock(const void *buf, int count);
49 int writeMulSock(const void *buf, int count, int i);
50 
51 uint8_t readSock(void *buf, int count);
52 uint8_t readMulSock(void *buf, int count, int index);
53 
54 void readFrame();
55 void readMulFrame(int index);
56 
57 private:
58 int sockID;
59 int sockIDList[1000];
60 };
61 #endif
uint8_t readSock(void *buf, int count)
int i
int socketSyckLock
int socketOpStarted
uint8_t readMulSock(void *buf, int count, int index)
int sockIDList[1000]
Definition: Communication.h:59
int writeMulSock(const void *buf, int count, int i)
bool disconnectSock()
int writeSock(const void *buf, int count)
void readMulFrame(int index)
bool connectMulSock(const std::string &ip, int index)


edrone_client
Author(s): Simranjeet Singh
autogenerated on Sun Dec 1 2019 03:30:51