KatanaNativeInterface $VERSION$
cdlCOMExceptions.h
Go to the documentation of this file.
1//
2// C++ Interface: cdlCOMExceptions
3//
4// Description:
5//
6//
7// Author: Tiziano Müller <tiziano.mueller@neuronics.ch>, (C) 2006
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12
13#ifndef _CDLCOMEXCEPTIONS_H_
14#define _CDLCOMEXCEPTIONS_H_
15
16#include "common/exception.h"
17#include <string>
18
20enum{
32 ERR_CRC = -12,
36};
37
42
48public:
49 CannotOpenPortException(const std::string & port, const std::string os_msg) throw ():
50 Exception("Cannot open port '" + port + "': " + os_msg, -10) {}
51};
52
57public:
58 CannotGetSetPortAttributesException(const std::string & port) throw ():
59 Exception("Cannot get/set attributes on '" + port + "'", -11) {}
60};
61
66public:
67 PortNotOpenException(const std::string & port) throw ():
68 Exception("Port '" + port + "' not open", -12) {}
69};
70
76public:
77 DeviceReadException(const std::string & port, const std::string os_msg) throw ():
78 Exception("Read failure on port '" + port + "': " + os_msg, -13) {}
79};
80
86public:
87 DeviceWriteException(const std::string & port, const std::string os_msg) throw ():
88 Exception("Write failure on port '" + port + "': " + os_msg, -14) {}
89};
90
95public:
96 ReadWriteNotCompleteException(const std::string & errstr, const int error_number) throw ():
97 Exception(errstr, error_number) {}
98};
99
104public:
105 WriteNotCompleteException(const std::string & port) throw ():
106 ReadWriteNotCompleteException("Cannot write all date to '" + port + "'", -15) {}
107};
108
113public:
114 ReadNotCompleteException(const std::string & port) throw ():
115 ReadWriteNotCompleteException("Cannot read all data from '" + port + "'", -16) {}
116};
117
121class ErrorException : public Exception {
122 public:
123 ErrorException(const std::string &error) throw ():
124 Exception(error, -20) {}
125};
126
130
131#endif
@ ERR_AXIS_ANY
@ ERR_MESSAGE_STRING
@ ERR_TYPE_MISMATCH
@ ERR_AXIS_MOVE
@ ERR_FAILED
@ ERR_AXIS_COLLISION
@ ERR_RANGE_MISMATCH
@ ERR_PERIPHERAL
@ ERR_CRC
@ ERR_AXIS_MOVE_POLY
@ ERR_STATE_MISMATCH
@ ERR_MESSAGE
@ ERR_INVALID_ARGUMENT
@ ERR_AXIS_HEARTBEAT
@ ERR_AXIS_OPERATIONAL
Could not set or get the attributes for the given serial communication device.
CannotGetSetPortAttributesException(const std::string &port)
Failed to open the serial communication device.
CannotOpenPortException(const std::string &port, const std::string os_msg)
Reading from the serial communication device failed.
DeviceReadException(const std::string &port, const std::string os_msg)
Writing to the serial communication device failed.
DeviceWriteException(const std::string &port, const std::string os_msg)
The Katana returned an error string.
ErrorException(const std::string &error)
Exception(const std::string &message, const int error_number)
Definition: exception.h:85
const int error_number() const
Definition: exception.h:100
The port was not open.
PortNotOpenException(const std::string &port)
The Katana didn't answer correctly within the given timeout.
ReadNotCompleteException(const std::string &port)
This exception is the base for the WriteNotComplete and ReadNotCompleteException.
ReadWriteNotCompleteException(const std::string &errstr, const int error_number)
Not all bytes could be written to the serial communication device.
WriteNotCompleteException(const std::string &port)