Main Page
Namespaces
Classes
Files
File List
File Members
include
ur_client_library
primary
primary/package_header.h
Go to the documentation of this file.
1
// this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2
3
// -- BEGIN LICENSE BLOCK ----------------------------------------------
4
// Copyright 2019 FZI Forschungszentrum Informatik
5
//
6
// Licensed under the Apache License, Version 2.0 (the "License");
7
// you may not use this file except in compliance with the License.
8
// You may obtain a copy of the License at
9
//
10
// http://www.apache.org/licenses/LICENSE-2.0
11
//
12
// Unless required by applicable law or agreed to in writing, software
13
// distributed under the License is distributed on an "AS IS" BASIS,
14
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
// See the License for the specific language governing permissions and
16
// limitations under the License.
17
// -- END LICENSE BLOCK ------------------------------------------------
18
19
//----------------------------------------------------------------------
27
//----------------------------------------------------------------------
28
29
#ifndef UR_CLIENT_LIBRARY_PRIMARY_INTERFACE_H_INCLUDED
30
#define UR_CLIENT_LIBRARY_PRIMARY_INTERFACE_H_INCLUDED
31
32
#include <inttypes.h>
33
#include <cstddef>
34
#include <endian.h>
35
#include "
ur_client_library/types.h
"
36
37
namespace
urcl
38
{
39
namespace
primary_interface
40
{
41
static
const
int
UR_PRIMARY_PORT
= 30001;
42
static
const
int
UR_SECONDARY_PORT
= 30002;
46
enum class
RobotPackageType
: int8_t
47
{
48
DISCONNECT
= -1,
49
ROBOT_STATE
= 16,
50
ROBOT_MESSAGE
= 20,
51
HMC_MESSAGE
= 22,
52
MODBUS_INFO_MESSAGE
= 5,
53
SAFETY_SETUP_BROADCAST_MESSAGE
= 23,
54
SAFETY_COMPLIANCE_TOLERANCES_MESSAGE
= 24,
55
PROGRAM_STATE_MESSAGE
= 25
56
};
57
61
class
PackageHeader
62
{
63
public
:
64
PackageHeader
() =
default
;
65
virtual
~
PackageHeader
() =
default
;
66
67
using
_package_size_type
= int32_t;
68
76
static
size_t
getPackageLength
(uint8_t* buf)
77
{
78
return
be32toh(*(reinterpret_cast<_package_size_type*>(buf)));
79
}
80
};
81
}
// namespace primary_interface
82
}
// namespace urcl
83
84
#endif // ifndef UR_CLIENT_LIBRARY_PRIMARY_INTERFACE_H_INCLUDED
types.h
urcl::primary_interface::PackageHeader
This class represents the header for primary packages.
Definition:
primary/package_header.h:61
urcl::primary_interface::RobotPackageType::DISCONNECT
urcl::primary_interface::RobotPackageType::ROBOT_STATE
urcl::primary_interface::PackageHeader::_package_size_type
int32_t _package_size_type
Definition:
primary/package_header.h:67
urcl::primary_interface::RobotPackageType::SAFETY_SETUP_BROADCAST_MESSAGE
urcl
Definition:
bin_parser.h:36
urcl::primary_interface::RobotPackageType::ROBOT_MESSAGE
urcl::primary_interface::PackageHeader::getPackageLength
static size_t getPackageLength(uint8_t *buf)
Reads a buffer, interpreting the next bytes as the size of the contained package. ...
Definition:
primary/package_header.h:76
urcl::primary_interface::UR_SECONDARY_PORT
static const int UR_SECONDARY_PORT
Definition:
primary/package_header.h:42
urcl::primary_interface::RobotPackageType::SAFETY_COMPLIANCE_TOLERANCES_MESSAGE
urcl::primary_interface::RobotPackageType::PROGRAM_STATE_MESSAGE
urcl::primary_interface::RobotPackageType
RobotPackageType
Possible RobotPackage types.
Definition:
primary/package_header.h:46
urcl::primary_interface::RobotPackageType::HMC_MESSAGE
urcl::primary_interface::RobotPackageType::MODBUS_INFO_MESSAGE
urcl::primary_interface::UR_PRIMARY_PORT
static const int UR_PRIMARY_PORT
Definition:
primary/package_header.h:41
ur_client_library
Author(s): Thomas Timm Andersen, Simon Rasmussen, Felix Exner, Lea Steffen, Tristan Schnell
autogenerated on Sun May 9 2021 02:16:26