aboutsummaryrefslogtreecommitdiff
path: root/drivers/tcpip/tcpclient.h
diff options
context:
space:
mode:
authorTero Kontkanen <tero.kontkanen@granitedevices.fi>2017-08-19 18:18:00 +0300
committerTero Kontkanen <tero.kontkanen@granitedevices.fi>2017-08-19 18:18:00 +0300
commit98fc91e77907285c0c2f9d8f6209d2df004835e1 (patch)
treebce57d784f61999d06088cee152eabb4087e8c00 /drivers/tcpip/tcpclient.h
parent6ef9e8c44e29d270c64c22b73ae00508966b4892 (diff)
downloadSimpleMotionV2-98fc91e77907285c0c2f9d8f6209d2df004835e1.tar.gz
SimpleMotionV2-98fc91e77907285c0c2f9d8f6209d2df004835e1.zip
Reorganized drivers (move them to drivers subfolder)
Diffstat (limited to 'drivers/tcpip/tcpclient.h')
-rw-r--r--drivers/tcpip/tcpclient.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/tcpip/tcpclient.h b/drivers/tcpip/tcpclient.h
new file mode 100644
index 0000000..5ed075a
--- /dev/null
+++ b/drivers/tcpip/tcpclient.h
@@ -0,0 +1,28 @@
+#ifndef tcpclient_INCLUDED
+#define tcpclient_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//return port handle or -1 if fails
+int OpenTCPPort(const char * ip_addr, int port);
+int PollTCPPort(int, unsigned char *, int);
+int SendTCPByte(int, unsigned char);
+int SendTCPBuf(int, unsigned char *, int);
+void CloseTCPport(int);
+
+
+//accepted TCP/IP address format is nnn.nnn.nnn.nnn:pppp where n is IP address numbers and p is port number
+int validateIpAddress(const char *s, const char **pip_end,
+ const char **pport_start);
+int parseIpAddress(const char *s, char *ip, size_t ipsize, short *port);
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif
+
+