socket.h
Go to the documentation of this file.
1 /* Copyright 2017 UFACTORY Inc. All Rights Reserved.
2  *
3  * Software License Agreement (BSD License)
4  *
5  * Author: Jimy Zhang <jimy92@163.com>
6  ============================================================================*/
7 #ifndef CORE_PORT_SOCKET_H_
8 #define CORE_PORT_SOCKET_H_
9 
10 #include <iostream>
11 #include <thread>
14 
15 class SocketPort {
16 public:
17  SocketPort(char *server_ip, int server_port, int que_num, int que_maxlen);
18  ~SocketPort(void);
19  int is_ok(void);
20  void flush(void);
21  void recv_proc(void);
22  int write_frame(unsigned char *data, int len);
23  int read_frame(unsigned char *data);
24  void close_port(void);
26 
27 private:
28  int port_;
29  int fp_;
30  int state_;
31  int que_num_;
33 };
34 
35 #endif
void recv_proc(void)
Definition: socket.cc:45
QueueMemcpy * rx_que_
Definition: socket.h:32
int port_
Definition: socket.h:28
int fp_
Definition: socket.h:29
int write_frame(unsigned char *data, int len)
Definition: socket.cc:131
int read_frame(unsigned char *data)
Definition: socket.cc:122
void flush(void)
Definition: socket.cc:120
int que_maxlen_
Definition: socket.h:25
void close_port(void)
Definition: socket.cc:136
int is_ok(void)
Definition: socket.cc:118
SocketPort(char *server_ip, int server_port, int que_num, int que_maxlen)
Definition: socket.cc:89
int que_num_
Definition: socket.h:31
~SocketPort(void)
Definition: socket.cc:113
int state_
Definition: socket.h:30


xarm_api
Author(s):
autogenerated on Sat May 8 2021 02:51:23