| | |
| | | #include <pthread.h>
|
| | | #include <sys/time.h>
|
| | | #include <fcntl.h>
|
| | | #include "/usr/include/mysql/mysql.h"
|
| | | //#include "/usr/include/mysql/mysql.h"
|
| | | #include <stdio.h>
|
| | | #include <stdlib.h>
|
| | | #include <unistd.h>
|
| | |
| | | pthread_exit((void*)thread_Real[eidx]);
|
| | | }
|
| | |
|
| | | int Read_MysqlData()
|
| | | {
|
| | | static sockinfo equipments_config[] = {
|
| | | //{
|
| | | // .m_id = 1, |
| | | // .ip = "192.168.1.5", // equipmentip (analizer)
|
| | | // .port = "80", // equipmentport
|
| | | // .user = "supervisor", // equipment username
|
| | | // .pass = "supervisor", // equipment password
|
| | | // .serverIP = "192.168.1.2", // serverip
|
| | | // .serverport = "5015", // serverport
|
| | | // .reboot = 0
|
| | | //},
|
| | | { .m_id = 1, .ip = "192.168.1.5", .port = "80", .user = "supervisor", .pass = "supervisor", .serverIP = "192.168.1.2", .serverport = "5015", .reboot = 0 },
|
| | | };
|
| | | |
| | | memcpy(equipments, equipments_config, sizeof(equipments_config));
|
| | | NUM = sizeof(equipments_config) / sizeof(sockinfo);
|
| | |
|
| | | return 1;
|
| | | }
|
| | |
|
| | | /*
|
| | | int Read_MysqlData(){
|
| | | int ret=0;
|
| | | MYSQL *conn;
|
| | |
| | | mysql_close(conn);
|
| | | return ret;
|
| | |
|
| | | }
|
| | | }*/
|
| | |
|
| | | int net_test(char* serverIP,char* port){
|
| | | struct sockaddr_in servaddr;
|
| | | int strlen=sizeof(servaddr);
|