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.
55 lines
1.3 KiB
55 lines
1.3 KiB
#include <sys/time.h>
|
|
|
|
#include "config.h"
|
|
#include "gui.h"
|
|
|
|
#define BUILDER_FILE "testmodbus-client.ui"
|
|
|
|
/************************************************************************************
|
|
* Global Variables
|
|
*/
|
|
ModbusCli modbuscli;
|
|
GtkBuilder *_builder_ = NULL; // work around for the thread situation
|
|
|
|
gboolean modbuscli_callback(gpointer data);
|
|
|
|
int main (int argc, char **argv) {
|
|
GtkBuilder *builder;
|
|
GObject *window;
|
|
|
|
#ifdef BUILD_WINDOWS
|
|
char buffer[16];
|
|
setvbuf (stdout, buffer, _IONBF, 16);
|
|
#endif
|
|
|
|
printf ("TestModbus-Client - %s\n", VERSION);
|
|
printf (" https://steffen.gulpe.de/modbus-tcpip\n");
|
|
printf (" written by Steffen Pohle <steffen@gulpe.de>\n");
|
|
|
|
gtk_init (&argc, &argv);
|
|
_builder_ = builder = gtk_builder_new ();
|
|
gtk_builder_add_from_file (builder, BUILDER_FILE, NULL);
|
|
gtk_builder_connect_signals(builder, builder);
|
|
|
|
//
|
|
// #if defined _WIN32 || defined _WIN64 || defined __CYGWIN__
|
|
// #else
|
|
// #endif
|
|
//
|
|
|
|
// modbuscli.SetCallback(&modbus_callback);
|
|
window = gtk_builder_get_object (builder, "testmodbus-client");
|
|
gtk_widget_show_all (GTK_WIDGET(window));
|
|
gtk_main ();
|
|
|
|
return 0;
|
|
}
|
|
|
|
|
|
gboolean modbuscli_callback(gpointer data) {
|
|
struct modbus_callback_data *mdata = (struct modbus_callback_data *) data;
|
|
free (mdata);
|
|
|
|
return FALSE;
|
|
};
|