canserial-esd.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008 SCHUNK GmbH & Co. KG
00003  * Copyright (c) 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *   http://www.apache.org/licenses/LICENSE-2.0
00010 
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 //======================================================================
00045 //======================================================================
00046 
00047 #ifndef CANSERIAL_ESD_H_
00048 #define CANSERIAL_ESD_H_
00049 
00050 //----------------------------------------------------------------------
00051 // System Includes - include with <>
00052 //----------------------------------------------------------------------
00053 
00054 
00055 //----------------------------------------------------------------------
00056 // Project Includes - include with ""
00057 //----------------------------------------------------------------------
00058 
00059 #include "sdhexception.h"
00060 #include "serialbase.h"
00061 #include "basisdef.h"
00062 #include "sdhlibrary_settings.h"
00063 
00064 //----------------------------------------------------------------------
00065 // Defines, enums, unions, structs,
00066 //----------------------------------------------------------------------
00067 
00068 NAMESPACE_SDH_START
00069 
00071 #define CAN_ESD_TXQUEUESIZE 32
00072 
00074 #define CAN_ESD_RXQUEUESIZE 512
00075 
00076 //----------------------------------------------------------------------
00077 // Global variables
00078 //----------------------------------------------------------------------
00079 
00080 
00081 //----------------------------------------------------------------------
00082 // Function and class member declarations
00083 //----------------------------------------------------------------------
00084 
00086 class cCANSerial_ESD_Internal;
00087 
00088 
00092 class VCC_EXPORT cCANSerial_ESDException: public cSerialBaseException
00093 {
00094 public:
00095   cCANSerial_ESDException(cMsg const & _msg)
00096     : cSerialBaseException("cCANSerial_ESDException", _msg)
00097   {}
00098 };
00099 //======================================================================
00100 
00114 class VCC_EXPORT cCANSerial_ESD : public cSerialBase
00115 {
00116 
00117 protected:
00118 
00120   int net;
00121 
00123   unsigned long baudrate;
00124 
00126   int id_read;
00127 
00129   int id_write;
00130 
00131   // ntcan_handle was removed from here, see class comment and GetHandle()
00132 
00134   unsigned int BaudrateToBaudrateCode(unsigned long baudrate)
00135   throw (cCANSerial_ESDException*);
00136 
00137   int status;
00138 
00139 private:
00141   cCANSerial_ESD_Internal* pimpl;
00142 
00144   cCANSerial_ESD(cCANSerial_ESD const& other);
00145 
00147   cCANSerial_ESD& operator=(cCANSerial_ESD const& rhs);
00148 
00149 public:
00160   cCANSerial_ESD(int _net, unsigned long _baudrate, double _timeout, int _id_read, int _id_write)
00161   throw (cCANSerial_ESDException*);
00162 
00172   cCANSerial_ESD(tDeviceHandle _ntcan_handle, double _timeout, int _id_read, int _id_write)
00173   throw (cCANSerial_ESDException*);
00174 
00176   ~cCANSerial_ESD();
00177 
00181   void Open(void)
00182   throw (cCANSerial_ESDException*);
00183 
00185   bool IsOpen(void)
00186   throw();
00187 
00189   void Close(void)
00190   throw (cCANSerial_ESDException*);
00191 
00193 
00201   int write(char const *ptr, int len = 0)
00202   throw (cCANSerial_ESDException*);
00203 
00212   ssize_t Read(void *data, ssize_t size, long timeout_us, bool return_on_less_data)
00213   throw (cCANSerial_ESDException*);
00214 
00216   void SetTimeout(double _timeout)
00217   throw (cSerialBaseException*);
00218 
00222   virtual tErrorCode GetErrorNumber();
00223 
00229   virtual char const* GetErrorMessage(tErrorCode dw);
00230 
00232   tDeviceHandle GetHandle();
00233 };
00234 //======================================================================
00235 
00236 NAMESPACE_SDH_END
00237 
00238 #endif
00239 
00240 
00241 //======================================================================
00242 /*
00243   Here are some settings for the emacs/xemacs editor (and can be safely ignored):
00244   (e.g. to explicitely set C++ mode for *.h header files)
00245 
00246   Local Variables:
00247   mode:C++
00248   mode:ELSE
00249   End:
00250 */
00251 //======================================================================


schunk_sdh
Author(s): Mathias Luedtke , Florian Weisshardt
autogenerated on Sat Jun 8 2019 20:25:21