You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.6 KiB

/////////////////////////////////////////////////////////////////////////////////
//
// client.h is part of TestModbus-Client.
//
/////////////////////////////////////////////////////////////////////////////////
#ifndef _CLIENT_H_
#define _CLIENT_H_
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <glib.h>
#include <string>
#include <iostream>
#include <list>
#include "nwthread.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "modbus.h"
#define LEN_STATUSTEXT 255
enum {
LOG_CONNECT,
LOG_TX,
LOG_RX,
LOG_CLOSE,
LOG_ERROR
};
void displayerror (std::string error);
void log_addtext (int logtype, std::string text, NWTRawData *data);
// ***********************************************************************
//
// main windows call backs
//
gboolean mbcli_thread_cb_error(gpointer data);
gboolean mbcli_thread_cb_status(gpointer data);
gboolean mbcli_thread_cb_net(gpointer data);
gboolean mbcli_thread_cb_modbusdata(gpointer data);
int mbcli_get_FC ();
int mbcli_get_register ();
int mbcli_get_unitid ();
int mbcli_get_number ();
int mbcli_get_update ();
void mbcli_set_update (int active);
int mbcli_get_FC1516 ();
void mbcli_readdata();
gboolean mbcli_refreshtimeout(gpointer data);
std::string to_hex16 (uint16_t v);
std::string to_hex8 (uint8_t v);
G_MODULE_EXPORT void mbcli_cb_show(GtkWidget *widget, gpointer data);
G_MODULE_EXPORT void mbcli_cb_updateread (GtkToggleButton *togglebutton, gpointer user_data);
G_MODULE_EXPORT void mbcli_cb_connect (GtkWidget *widget, gpointer data);
G_MODULE_EXPORT void mbcli_cb_disconnect (GtkWidget *widget, gpointer data);
#ifdef __cplusplus
}
#endif
#endif