7 #include "gwps-common.h"
10 struct screen screens
[NB_SCREENS
];
11 struct wps_data wpsdata
;
16 extern void test_api(struct proxy_api
*api
);
18 bool debug_wps
= true;
19 int wps_verbose_level
= 0;
23 static char pluginbuf
[PLUGIN_BUFFER_SIZE
];
25 const char* get_model_name(){
33 int read_line(int fd
, char* buffer
, int buffer_size
)
40 while (count
< buffer_size
)
44 if (1 != read(fd
, &c
, 1))
58 buffer
[MIN(count
, buffer_size
- 1)] = 0;
60 return errno_
? -1 : num_read
;
63 void* plugin_get_buffer(size_t *buffer_size
)
65 *buffer_size
= PLUGIN_BUFFER_SIZE
;
69 int checkwps(const char *filename
, int verbose
){
74 wps_verbose_level
= verbose
;
76 fd
= open(filename
, O_RDONLY
);
78 DEBUGF1("Failed to open %s\n",filename
);
83 res
= wps_data_load(&wps
, &screens
[0], filename
, true);
86 DEBUGF1("WPS parsing failure\n");
90 DEBUGF1("WPS parsed OK\n");
94 int wps_init(const char* filename
,struct proxy_api
*api
, bool isfile
){
101 wps_data_init(&wpsdata
);
102 wps_verbose_level
= api
->verbose
;
103 res
= wps_data_load(&wpsdata
, &screens
[0], filename
, isfile
);
106 DEBUGF1("ERR: WPS parsing failure\n");
109 DEBUGF1("WPS parsed OK\n");
110 DEBUGF1("\n-------------------------------------------------\n");
111 wps_state
.paused
= true;
112 gwps
.data
= &wpsdata
;
113 gwps
.display
= &screens
[0];
114 gwps
.state
= &wps_state
;
115 gwps
.state
->id3
= &id3
;
116 gwps
.state
->nid3
= &nid3
;
122 DEBUGF3("wps_display(): begin\n");
123 int res
= gui_wps_display();
124 DEBUGF3("\nWPS %sdisplayed\n", (res
? "" : "not "));
128 DEBUGF3("-----------------<wps_refresh(): begin>-----------------\n");
129 int res
= gui_wps_refresh(&gwps
, 0, WPS_REFRESH_ALL
);
130 DEBUGF3("\nWPS %srefreshed\n", (res
? "" : "not "));