aboutsummaryrefslogtreecommitdiff
path: root/client/sock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'client/sock.cpp')
-rw-r--r--client/sock.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/client/sock.cpp b/client/sock.cpp
index f967f64..2d5787d 100644
--- a/client/sock.cpp
+++ b/client/sock.cpp
@@ -10,7 +10,7 @@
#include <thread>
-#include "puzbusv1.h"
+#include "i2ctcpv1.h"
#include "sock.h"
#include "rl.h"
@@ -72,7 +72,7 @@ void PBSocket::send(const char * buf, size_t buf_sz) {
}
void PBSocket::sock_task() {
- struct pb_msg input;
+ i2ctcp_msg_t input;
while(1) {
char buf[80];
@@ -86,11 +86,11 @@ void PBSocket::sock_task() {
// skip empty frames
if (bytes == 0) continue;
- int ret = pb_read(&input, buf, bytes);
+ int ret = i2ctcp_read(&input, buf, bytes);
// header read error
if (ret < 0) {
- rl_printf("pb_read error!\n");
+ rl_printf("i2ctcp_read error!\n");
break;
}
@@ -106,7 +106,7 @@ void PBSocket::sock_task() {
}
void i2c_send(uint16_t addr, const char * data, size_t data_size) {
- struct pb_msg msg = {
+ i2ctcp_msg_t msg = {
.addr = addr,
.data = (char *) data,
.length = data_size,
@@ -114,7 +114,7 @@ void i2c_send(uint16_t addr, const char * data, size_t data_size) {
char* packed;
size_t size;
- if (!pb_write(&msg, &packed, &size)) return;
+ if (!i2ctcp_write(&msg, &packed, &size)) return;
sock->send(packed, size);
}