libmbus/mbus/mbus-tcp.h
jakubovsky c848090f56 Rebuilding M-Bus context structs in progress
- changed local library file includes from <> to ""
- get rid of 'if (is_serial)' conditions
- mbus_context_serial() and mbus_context_tcp() allocates memory and initialize context specific function pointers
- simply mbus_connect() called instead of mbus_connect_tcp() or mbus_connect_serial()
- context specific data can still be accessed via (void* auxdata) pointer
- strdup(3) to copy host IP into TCP context struct
2012-07-04 17:18:36 +02:00

39 lines
890 B
C
Executable File

//------------------------------------------------------------------------------
// Copyright (C) 2011, Robert Johansson, Raditex AB
// All rights reserved.
//
// rSCADA
// http://www.rSCADA.se
// info@rscada.se
//
//------------------------------------------------------------------------------
/**
* @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-protocol.h"
#include "mbus-protocol-aux.h"
typedef struct _mbus_tcp_handle
{
char *host;
int port;
} mbus_tcp_handle;
int mbus_tcp_connect(mbus_handle *handle);
int mbus_tcp_disconnect(mbus_handle *handle);
int mbus_tcp_send_frame(mbus_handle *handle, mbus_frame *frame);
int mbus_tcp_recv_frame(mbus_handle *handle, mbus_frame *frame);
#endif /* MBUS_TCP_H */