EnOcean Link  1.14.0.0
Middleware to Connect EnOcean easily to other Projects
eoWin32PacketStream.h
1 /******************************************************************************
2  DISCLAIMER
3 
4  THIS SOFTWARE PRODUCT ("SOFTWARE") IS PROPRIETARY TO ENOCEAN GMBH, OBERHACHING,
5  GERMANY (THE "OWNER") AND IS PROTECTED BY COPYRIGHT AND INTERNATIONAL TREATIES OR
6  PROTECTED AS TRADE SECRET OR AS OTHER INTELLECTUAL PROPERTY RIGHT. ALL RIGHTS, TITLE AND
7  INTEREST IN AND TO THE SOFTWARE, INCLUDING ANY COPYRIGHT, TRADE SECRET OR ANY OTHER
8  INTELLECTUAL PROPERTY EMBODIED IN THE SOFTWARE, AND ANY RIGHTS TO REPRODUCE,
9  DISTRIBUTE, MODIFY, DISPLAY OR OTHERWISE USE THE SOFTWARE SHALL EXCLUSIVELY VEST IN THE
10  OWNER. ANY UNAUTHORIZED REPRODUCTION, DISTRIBUTION, MODIFICATION, DISPLAY OR OTHER
11  USE OF THE SOFTWARE WITHOUT THE EXPLICIT PERMISSION OF OWNER IS PROHIBITED AND WILL
12  CONSTITUTE AN INFRINGEMENT OF THE OWNER'S RIGHT AND MAY BE SUBJECT TO CIVIL OR
13  CRIMINAL SANCTION.
14 
15  THIS SOFTWARE IS PROVIDED BY THE OWNER "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
16  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
17  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN PARTICULAR, THE OWNER DOES NOT WARRANT
18  THAT THE SOFTWARE SHALL BE ERROR FREE AND WORKS WITHOUT INTERRUPTION.
19 
20  IN NO EVENT SHALL THE OWNER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  ******************************************************************************/
27 
33 #ifndef EO_WIN32_PACKET_STREAM_H_
34 #define EO_WIN32_PACKET_STREAM_H_
35 
36 #include "eoPacketStream.h"
37 #include <windows.h>
38 
46 {
47 
48 public:
50  virtual ~eoWin32PacketStream();
56  eoReturn Open(const char * port);
60  void Close();
64  DWORD GetLastError(){ return error;};
65  eoReturn ReceiveByte(uint8_t* u8RxByte);
66  eoReturn SendByte(uint8_t u8TxByte);
67 private:
68  int fd;
69  static const uint8_t buffSize = 128;
70  DWORD error;
71  uint8_t buf[buffSize];
72  uint8_t numBytes;
73  uint8_t curByte;
74  HANDLE portOpen;
75  COMMTIMEOUTS m_Comtimeout;
76  DCB DCBParam;
77 
78 };
79 #endif // !defined(EO_WIN32_PACKET_STREAM_H_)
eoReturn ReceiveByte(uint8_t *u8RxByte)
DWORD GetLastError()
Definition: eoWin32PacketStream.h:64
eoReturn SendByte(uint8_t u8TxByte)
PacketStream Implementation for Windows based Systems.
Definition: eoWin32PacketStream.h:45
eoReturn
contains all the return values from different functions
Definition: eoApiDef.h:40
The base class for all PacketStreams Implementations.
Definition: eoPacketStream.h:58
eoReturn Open(const char *port)