diff --git a/src/jsd.c b/src/jsd.c index 9924d61..a75e224 100644 --- a/src/jsd.c +++ b/src/jsd.c @@ -83,7 +83,7 @@ void jsd_set_slave_config(jsd_t* self, uint16_t slave_id, self->slave_configs[slave_id] = slave_config; } -bool jsd_init(jsd_t* self, const char* ifname, uint8_t enable_autorecovery) { +bool jsd_init(jsd_t* self, const char* ifname, uint8_t enable_autorecovery, int timeout_us) { assert(self); self->enable_autorecovery = enable_autorecovery; diff --git a/src/jsd_pub.h b/src/jsd_pub.h index c69959d..ccf8e64 100644 --- a/src/jsd_pub.h +++ b/src/jsd_pub.h @@ -51,7 +51,7 @@ void jsd_set_slave_config(jsd_t* self, uint16_t slave_id, * @param enable_autorecovery enables automatic recovery of lost devices * @return true on successful SOEM initialization */ -bool jsd_init(jsd_t* self, const char* ifname, uint8_t enable_autorecovery); +bool jsd_init(jsd_t* self, const char* ifname, uint8_t enable_autorecovery, int timeout_us); /** * @brief Receive data from slave devices and store on local IOmap. diff --git a/test/device/jsd_minimal_example_el3602.c b/test/device/jsd_minimal_example_el3602.c index f6a1d16..e57155a 100644 --- a/test/device/jsd_minimal_example_el3602.c +++ b/test/device/jsd_minimal_example_el3602.c @@ -23,7 +23,7 @@ int main() { jsd_set_slave_config(jsd, slave_id, my_config); // Slave configuration must come before initialization - if (!jsd_init(jsd, "eth9", 1)) { + if (!jsd_init(jsd, "eth9", 1, EC_TIMEOUTRET)) { ERROR("Could not init jsd"); return 0; } diff --git a/test/jsd_test_utils.c b/test/jsd_test_utils.c index ffd3f02..76dad08 100644 --- a/test/jsd_test_utils.c +++ b/test/jsd_test_utils.c @@ -103,7 +103,7 @@ void sds_run(single_device_server_t* self, char* device_name, char* filename) { uint32_t sds_iter = 0; - if (!jsd_init(self->jsd, device_name, 1)) { + if (!jsd_init(self->jsd, device_name, 1, EC_TIMEOUTRET)) { ERROR("Could not init jsd"); return; } diff --git a/test/unit/jsd_soem_init_close_test.c b/test/unit/jsd_soem_init_close_test.c index 55cfa00..38425d7 100644 --- a/test/unit/jsd_soem_init_close_test.c +++ b/test/unit/jsd_soem_init_close_test.c @@ -12,7 +12,7 @@ int main(int argc, char* argv[]) { jsd_t* jsd = jsd_alloc(); - if (!jsd_init(jsd, argv[1], 1)) { + if (!jsd_init(jsd, argv[1], 1, EC_TIMEOUTRET)) { ERROR("Could not init jsd"); return 0; } diff --git a/tools/jsd_egd_tlc_tty.c b/tools/jsd_egd_tlc_tty.c index f3e3be1..a6b6d3d 100644 --- a/tools/jsd_egd_tlc_tty.c +++ b/tools/jsd_egd_tlc_tty.c @@ -151,7 +151,7 @@ int main(int argc, char* argv[]) { jsd_set_slave_config(jsd, slave_id, my_config); // slave configuration must come before initialization - if (!jsd_init(jsd, ifname, 1)) { + if (!jsd_init(jsd, ifname, 1, EC_TIMEOUTRET)) { ERROR("Could not init jsd"); return 0; }