repositories
/
deb_libcec.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cec: refactored threading/locking - added windows native instead of pthread-win32...
[deb_libcec.git]
/
src
/
lib
/
platform
/
serialport
/
serialport.h
diff --git
a/src/lib/platform/serialport.h
b/src/lib/platform/serialport/serialport.h
similarity index 75%
rename from
src/lib/platform/serialport.h
rename to
src/lib/platform/serialport/serialport.h
index f5035b908f21705a57bdee173b5e127784145198..3710bfecd52fb0579ad83810a875c6e4513cdfb4 100644
(file)
--- a/
src/lib/platform/serialport.h
+++ b/
src/lib/platform/serialport/serialport.h
@@
-31,20
+31,15
@@
* http://www.pulse-eight.net/
*/
* http://www.pulse-eight.net/
*/
-#include "os-dependent.h"
-#include <cectypes.h>
+#include "../os.h"
#include <string>
#include <stdint.h>
#include <string>
#include <stdint.h>
-#include "../AdapterCommunication.h"
-#include "../platform/threads.h"
#ifndef __WINDOWS__
#include <termios.h>
#ifndef __WINDOWS__
#include <termios.h>
-#else
-#include "../util/buffer.h"
#endif
#endif
-namespace
CEC
+namespace
PLATFORM
{
#define PAR_NONE 0
#define PAR_EVEN 1
{
#define PAR_NONE 0
#define PAR_EVEN 1
@@
-60,7
+55,7
@@
namespace CEC
bool IsOpen();
void Close();
bool IsOpen();
void Close();
- int
8_t Write(CCECAdapterMessage *data
);
+ int
64_t Write(uint8_t* data, uint32_t len
);
int32_t Read(uint8_t* data, uint32_t len, uint64_t iTimeoutMs = 0);
std::string GetError() { return m_error; }
int32_t Read(uint8_t* data, uint32_t len, uint64_t iTimeoutMs = 0);
std::string GetError() { return m_error; }
@@
-69,23
+64,23
@@
namespace CEC
private:
bool SetBaudRate(uint32_t baudrate);
private:
bool SetBaudRate(uint32_t baudrate);
- std::string
m_error;
- std::string
m_name;
- CMutex
m_mutex;
- bool
m_tostdout;
+ std::string m_error;
+ std::string m_name;
+ CMutex m_mutex;
+ bool m_tostdout;
#ifdef __WINDOWS__
bool SetTimeouts(bool bBlocking);
#ifdef __WINDOWS__
bool SetTimeouts(bool bBlocking);
- HANDLE m_handle;
- bool m_bIsOpen;
- uint32_t m_iBaudrate;
- uint8_t m_iDatabits;
- uint8_t m_iStopbits;
- uint8_t m_iParity;
- int64_t m_iTimeout;
-
Cec
Buffer<uint8_t> m_buffer;
- HANDLE m_ovHandle;
+ HANDLE
m_handle;
+ bool
m_bIsOpen;
+ uint32_t
m_iBaudrate;
+ uint8_t
m_iDatabits;
+ uint8_t
m_iStopbits;
+ uint8_t
m_iParity;
+ int64_t
m_iTimeout;
+
Synced
Buffer<uint8_t> m_buffer;
+ HANDLE
m_ovHandle;
#else
struct termios m_options;
int m_fd;
#else
struct termios m_options;
int m_fd;