aboutsummaryrefslogtreecommitdiff
path: root/client/sock.h
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2024-05-21 10:30:06 +0200
committerlonkaars <loek@pipeframe.xyz>2024-05-21 10:30:06 +0200
commit68a5c65f9b0e1df30e9cef490d9b218b2f21f90d (patch)
tree804ec0edc0769764b0a090703cf784c2ac7a6f5c /client/sock.h
parentdb8906d54cd9afbc57f0b40a0d618335c552f704 (diff)
clean up puzbusv1 API
Diffstat (limited to 'client/sock.h')
-rw-r--r--client/sock.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/client/sock.h b/client/sock.h
index 818ea72..42eba3b 100644
--- a/client/sock.h
+++ b/client/sock.h
@@ -6,14 +6,14 @@
class PBSocket {
public:
PBSocket();
- PBSocket(char* addr, uint16_t port);
+ PBSocket(const char * addr, uint16_t port);
virtual ~PBSocket();
- void set_server(char* addr, uint16_t port);
+ void set_server(const char * addr, uint16_t port);
void sock_connect();
- void send(char* buf, size_t buf_sz);
+ void send(const char * buf, size_t buf_sz);
private:
void sock_task();
@@ -21,15 +21,14 @@ private:
std::thread* _thread = nullptr;
- char* _addr = NULL;
+ const char * _addr = NULL;
uint16_t _port = 0;
int _fd = -1;
-
};
extern PBSocket* sock;
-void i2c_send(uint16_t addr, char* data, size_t data_size);
-void i2c_recv(uint16_t addr, char* data, size_t data_size);
+void i2c_send(uint16_t addr, const char * data, size_t data_size);
+void i2c_recv(uint16_t addr, const char * data, size_t data_size);