Main Page
Namespaces
Classes
Files
File List
File Members
include
xarm
core
port
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>
12
#include "
xarm/core/common/data_type.h
"
13
#include "
xarm/core/common/queue_memcpy.h
"
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
);
25
int
que_maxlen_
;
26
27
private
:
28
int
port_
;
29
int
fp_
;
30
int
state_
;
31
int
que_num_
;
32
QueueMemcpy
*
rx_que_
;
33
};
34
35
#endif
SocketPort::recv_proc
void recv_proc(void)
Definition:
socket.cc:45
SocketPort::rx_que_
QueueMemcpy * rx_que_
Definition:
socket.h:32
SocketPort::port_
int port_
Definition:
socket.h:28
SocketPort::fp_
int fp_
Definition:
socket.h:29
SocketPort::write_frame
int write_frame(unsigned char *data, int len)
Definition:
socket.cc:131
SocketPort::read_frame
int read_frame(unsigned char *data)
Definition:
socket.cc:122
SocketPort::flush
void flush(void)
Definition:
socket.cc:120
SocketPort::que_maxlen_
int que_maxlen_
Definition:
socket.h:25
queue_memcpy.h
QueueMemcpy
Definition:
queue_memcpy.h:12
SocketPort::close_port
void close_port(void)
Definition:
socket.cc:136
SocketPort::is_ok
int is_ok(void)
Definition:
socket.cc:118
SocketPort::SocketPort
SocketPort(char *server_ip, int server_port, int que_num, int que_maxlen)
Definition:
socket.cc:89
SocketPort
Definition:
socket.h:15
data_type.h
SocketPort::que_num_
int que_num_
Definition:
socket.h:31
SocketPort::~SocketPort
~SocketPort(void)
Definition:
socket.cc:113
SocketPort::state_
int state_
Definition:
socket.h:30
xarm_api
Author(s):
autogenerated on Sat May 8 2021 02:51:23