MIP SDK  0.0.1
MicroStrain Communications Library for embedded systems
tcp_socket.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <stdint.h>
4 #include <stddef.h>
5 #include <stdbool.h>
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
15 
22 
23 typedef struct tcp_socket
24 {
25  int handle;
27 
28 
29 bool tcp_socket_open(tcp_socket* socket_ptr, const char* hostname, uint16_t port, size_t timeout_ms);
30 bool tcp_socket_close(tcp_socket* socket_ptr);
31 bool tcp_socket_send(tcp_socket* socket_ptr, const void* buffer, size_t num_bytes, size_t* bytes_written);
32 bool tcp_socket_recv(tcp_socket* socket_ptr, void* buffer, size_t num_bytes, size_t* bytes_read);
33 
37 
38 #ifdef __cplusplus
39 }
40 #endif
bool tcp_socket_send(tcp_socket *socket_ptr, const void *buffer, size_t num_bytes, size_t *bytes_written)
Definition: tcp_socket.c:83
bool tcp_socket_recv(tcp_socket *socket_ptr, void *buffer, size_t num_bytes, size_t *bytes_read)
Definition: tcp_socket.c:100
bool tcp_socket_open(tcp_socket *socket_ptr, const char *hostname, uint16_t port, size_t timeout_ms)
Definition: tcp_socket.c:15
struct tcp_socket tcp_socket
bool tcp_socket_close(tcp_socket *socket_ptr)
Definition: tcp_socket.c:67
Definition: tcp_socket.h:24
int handle
Definition: tcp_socket.h:25