integration from bus into ebusloop continued.

This commit is contained in:
Roland Jax
2014-11-07 20:58:15 +01:00
parent 6db67385b5
commit 6b0f58b291
6 changed files with 435 additions and 242 deletions
+2 -2
View File
@@ -54,9 +54,9 @@ const std::string BusCommand::getMessageStr()
result += "00";
result += m_result.getDataStr();
result += "00";
} else {
result = "success";
}
else
result = "success";
}
else
result = "error: "+std::string(getResultCodeCStr());
+4 -1
View File
@@ -31,6 +31,9 @@ namespace libebus
/** available device types. */
enum DeviceType { SERIAL, NETWORK };
/** max bytes write to bus. */
#define MAX_WRITE_SIZE 1
/** max size of receive buffer. */
#define MAX_READ_SIZE 100
@@ -218,7 +221,7 @@ public:
* @param nbytes number of bytes to send.
* @return number of written bytes or -1 if an error has occured.
*/
ssize_t send(const unsigned char* buffer, size_t nbytes)
ssize_t send(const unsigned char* buffer, size_t nbytes = MAX_WRITE_SIZE)
{ return m_device->sendBytes(buffer, nbytes); }
/**