@@ -29,10 +29,13 @@ static char * port_name = "/dev/ttyACM0";
29
29
#define MAX_SIZE_SERVICE_NAME 100
30
30
/* Prefix for sink service name */
31
31
#define BASE_SERVICE_NAME "com.wirepas.sink.sink0"
32
- /* max poll fail duration undefined */
33
- #define UNDEFINED_MAX_POLL_FAIL_DURATION 0xffffffff
32
+
34
33
/* max default delay to keep incomplete fragmented packet inside our buffers */
35
34
#define DEFAULT_FRAGMENT_MAX_DURATION_S 900
35
+ /* max default delay for poll fail duration */
36
+ /* 120s should cover most scratchpad exchanges and image processing. Sink is
37
+ not answearing during that time */
38
+ #define DEFAULT_MAX_POLL_FAIL_DURATION_S 120
36
39
37
40
/* Dbus bus instance*/
38
41
static sd_bus * m_bus = NULL ;
@@ -153,7 +156,7 @@ int main(int argc, char * argv[])
153
156
int r ;
154
157
int c ;
155
158
unsigned int sink_id = 0 ;
156
- unsigned int max_poll_fail_duration = UNDEFINED_MAX_POLL_FAIL_DURATION ;
159
+ unsigned int max_poll_fail_duration = DEFAULT_MAX_POLL_FAIL_DURATION_S ;
157
160
unsigned int fragment_max_duration_s = DEFAULT_FRAGMENT_MAX_DURATION_S ;
158
161
unsigned int downlink_limit = 0 ;
159
162
@@ -256,13 +259,10 @@ int main(int argc, char * argv[])
256
259
}
257
260
}
258
261
259
- if (max_poll_fail_duration != UNDEFINED_MAX_POLL_FAIL_DURATION )
262
+ if (WPC_set_max_poll_fail_duration ( max_poll_fail_duration ) )
260
263
{
261
- if (WPC_set_max_poll_fail_duration (max_poll_fail_duration ))
262
- {
263
- LOGE ("Cannot set max poll fail duration (%d)\n" , max_poll_fail_duration );
264
- return EXIT_FAILURE ;
265
- }
264
+ LOGE ("Cannot set max poll fail duration (%d)\n" , max_poll_fail_duration );
265
+ return EXIT_FAILURE ;
266
266
}
267
267
268
268
if (WPC_set_max_fragment_duration (fragment_max_duration_s ))
0 commit comments