-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmbus-tcp.h
41 lines (28 loc) · 943 Bytes
/
mbus-tcp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//------------------------------------------------------------------------------
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// FreeSCADA
// http://www.FreeSCADA.com
// freescada@freescada.com
//
//------------------------------------------------------------------------------
/**
* @file mbus-tcp.h
*
* @brief Functions and data structures for sending M-Bus data via TCP.
*
*/
#ifndef MBUS_TCP_H
#define MBUS_TCP_H
#include <mbus/mbus.h>
typedef struct _mbus_tcp_handle {
char *host;
int port;
int sock;
} mbus_tcp_handle;
mbus_tcp_handle *mbus_tcp_connect(char *host, int port);
int mbus_tcp_disconnect(mbus_tcp_handle *handle);
int mbus_tcp_send_frame(mbus_tcp_handle *handle, mbus_frame *frame);
int mbus_tcp_recv_frame(mbus_tcp_handle *handle, mbus_frame *frame);
#endif /* MBUS_TCP_H */