ifm3d
err.h
1 // -*- c++ -*-
2 /*
3  * Copyright 2018-present ifm electronic, gmbh
4  * Copyright 2017 Love Park Robotics, LLC
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #ifndef IFM3D_DEVICE_ERR_H
9 #define IFM3D_DEVICE_ERR_H
10 
11 #include <exception>
12 #include <string>
13 #include <ifm3d/device/device_export.h>
14 
21 // library errors
22 extern IFM3D_DEVICE_EXPORT const int IFM3D_NO_ERRORS;
23 extern IFM3D_DEVICE_EXPORT const int IFM3D_XMLRPC_FAILURE;
24 extern IFM3D_DEVICE_EXPORT const int IFM3D_XMLRPC_TIMEOUT;
25 extern IFM3D_DEVICE_EXPORT const int IFM3D_JSON_ERROR;
26 extern IFM3D_DEVICE_EXPORT const int IFM3D_NO_ACTIVE_APPLICATION;
27 extern IFM3D_DEVICE_EXPORT const int IFM3D_SUBCOMMAND_ERROR;
28 extern IFM3D_DEVICE_EXPORT const int IFM3D_IO_ERROR;
29 extern IFM3D_DEVICE_EXPORT const int IFM3D_THREAD_INTERRUPTED;
30 extern IFM3D_DEVICE_EXPORT const int IFM3D_PCIC_BAD_REPLY;
31 extern IFM3D_DEVICE_EXPORT const int IFM3D_UNSUPPORTED_OP;
32 extern IFM3D_DEVICE_EXPORT const int IFM3D_IMG_CHUNK_NOT_FOUND;
33 extern IFM3D_DEVICE_EXPORT const int IFM3D_PIXEL_FORMAT_ERROR;
34 extern IFM3D_DEVICE_EXPORT const int IFM3D_UNSUPPORTED_DEVICE;
35 extern IFM3D_DEVICE_EXPORT const int IFM3D_RECOVERY_CONNECTION_ERROR;
36 extern IFM3D_DEVICE_EXPORT const int IFM3D_UPDATE_ERROR;
37 extern IFM3D_DEVICE_EXPORT const int IFM3D_PCICCLIENT_UNSUPPORTED_DEVICE;
38 extern IFM3D_DEVICE_EXPORT const int IFM3D_HEADER_VERSION_MISMATCH;
39 extern IFM3D_DEVICE_EXPORT const int
40  IFM3D_INTRINSIC_CALIBRATION_UNSUPPORTED_DEVICE;
41 extern IFM3D_DEVICE_EXPORT const int
42  IFM3D_INTRINSIC_CALIBRATION_UNSUPPORTED_FIRMWARE;
43 extern IFM3D_DEVICE_EXPORT const int
44  IFM3D_INVERSE_INTRINSIC_CALIBRATION_UNSUPPORTED_DEVICE;
45 extern IFM3D_DEVICE_EXPORT const int
46  IFM3D_INVERSE_INTRINSIC_CALIBRATION_UNSUPPORTED_FIRMWARE;
47 extern IFM3D_DEVICE_EXPORT const int IFM3D_CURL_ERROR;
48 extern IFM3D_DEVICE_EXPORT const int IFM3D_CURL_TIMEOUT;
49 extern IFM3D_DEVICE_EXPORT const int IFM3D_CURL_ABORTED;
50 extern IFM3D_DEVICE_EXPORT const int IFM3D_SWUPDATE_BAD_STATE;
51 extern IFM3D_DEVICE_EXPORT const int
52  IFM3D_CONFIDENCE_IMAGE_FORMAT_NOT_SUPPORTED;
53 extern IFM3D_DEVICE_EXPORT const int
54  IFM3D_DISTANCE_NOISE_IMAGE_UNSUPPORTED_DEVICE;
55 extern IFM3D_DEVICE_EXPORT const int
56  IFM3D_DISTANCE_NOISE_IMAGE_UNSUPPORTED_FIRMWARE;
57 extern IFM3D_DEVICE_EXPORT const int IFM3D_INVALID_PORT;
58 extern IFM3D_DEVICE_EXPORT const int IFM3D_TOOL_COMMAND_UNSUPPORTED_DEVICE;
59 extern IFM3D_DEVICE_EXPORT const int IFM3D_UNSUPPORTED_SCHEMA_ON_DEVICE;
60 extern IFM3D_DEVICE_EXPORT const int IFM3D_BUFFER_ID_NOT_AVAILABLE;
61 extern IFM3D_DEVICE_EXPORT const int IFM3D_NETWORK_ERROR;
62 extern IFM3D_DEVICE_EXPORT const int IFM3D_SYSTEM_ERROR;
63 extern IFM3D_DEVICE_EXPORT const int IFM3D_CORRUPTED_STRUCT;
64 extern IFM3D_DEVICE_EXPORT const int
65  IFM3D_DEVICE_PORT_INCOMPATIBLE_WITH_ORGANIZER;
66 extern IFM3D_DEVICE_EXPORT const int IFM3D_DEVICE_PORT_NOT_SUPPORTED;
67 extern IFM3D_DEVICE_EXPORT const int IFM3D_INDEX_OUT_OF_RANGE;
68 // sensor errors
69 extern IFM3D_DEVICE_EXPORT const int IFM3D_XMLRPC_OBJ_NOT_FOUND;
70 extern IFM3D_DEVICE_EXPORT const int IFM3D_INVALID_PARAM;
71 extern IFM3D_DEVICE_EXPORT const int IFM3D_INVALID_VALUE_TYPE;
72 extern IFM3D_DEVICE_EXPORT const int IFM3D_VALUE_OUT_OF_RANGE;
73 extern IFM3D_DEVICE_EXPORT const int IFM3D_READONLY_PARAM;
74 extern IFM3D_DEVICE_EXPORT const int IFM3D_SESSION_ALREADY_ACTIVE;
75 extern IFM3D_DEVICE_EXPORT const int IFM3D_INVALID_PASSWORD;
76 extern IFM3D_DEVICE_EXPORT const int IFM3D_INVALID_SESSIONID;
77 extern IFM3D_DEVICE_EXPORT const int IFM3D_COULD_NOT_REBOOT;
78 extern IFM3D_DEVICE_EXPORT const int IFM3D_INVALID_FORMAT;
79 extern IFM3D_DEVICE_EXPORT const int IFM3D_INVALID_DEVICE_TYPE;
80 extern IFM3D_DEVICE_EXPORT const int IFM3D_INVALID_IMPORT_FLAGS;
81 extern IFM3D_DEVICE_EXPORT const int IFM3D_INVALID_APP_INDEX;
82 extern IFM3D_DEVICE_EXPORT const int IFM3D_APP_IN_EDIT_MODE;
83 extern IFM3D_DEVICE_EXPORT const int IFM3D_MAX_APP_LIMIT;
84 extern IFM3D_DEVICE_EXPORT const int IFM3D_NO_APP_IN_EDIT_MODE;
85 extern IFM3D_DEVICE_EXPORT const int IFM3D_CANNOT_SW_TRIGGER;
86 extern IFM3D_DEVICE_EXPORT const int IFM3D_INVALID_IMAGER_TYPE;
87 extern IFM3D_DEVICE_EXPORT const int IFM3D_UNSUPPORTED_APP_TYPE;
88 extern IFM3D_DEVICE_EXPORT const int IFM3D_PIN_ALREADY_IN_USE;
89 extern IFM3D_DEVICE_EXPORT const int IFM3D_NO_SUCH_MODEL_OR_ROI;
90 extern IFM3D_DEVICE_EXPORT const int IFM3D_TEMPORAL_FILTER_TRIGGER_CONFLICT;
91 extern IFM3D_DEVICE_EXPORT const int IFM3D_EEPROM_FAIL;
92 extern IFM3D_DEVICE_EXPORT const int IFM3D_IMPORT_EXPORT_IN_PROGRESS;
93 extern IFM3D_DEVICE_EXPORT const int IFM3D_INVALID_NET_CONFIG;
94 extern IFM3D_DEVICE_EXPORT const int IFM3D_LED_DUTY_CYCLE_VIOLATION;
95 extern IFM3D_DEVICE_EXPORT const int IFM3D_AUTO_EXPOSURE_NOT_SUPPORTED;
96 extern IFM3D_DEVICE_EXPORT const int IFM3D_INVALID_FIRMWARE_VERSION;
97 extern IFM3D_DEVICE_EXPORT const int IFM3D_PROXY_AUTH_REQUIRED;
98 extern IFM3D_DEVICE_EXPORT const int IFM3D_PIXEL_FORMAT_NOT_SUPPORTED;
102 namespace ifm3d
103 {
110  IFM3D_DEVICE_EXPORT const char* strerror(int errnum);
111 
117  class IFM3D_DEVICE_EXPORT Error : public std::exception
118  {
119  public:
125  Error(int errnum, const std::string& msg = "");
126 
130  virtual const char* what() const noexcept;
131 
135  int code() const noexcept;
136 
140  const char* message() const noexcept;
141 
142  private:
147  int errnum_;
148 
152  std::string errmsg_;
153 
158  std::string what_;
159 
160  }; // end: class Error
161 
162 } // end: namespace ifm3d
163 
164 #endif // IFM3D_DEVICE_ERR_H
ifm3d::Error
Definition: err.h:117