Skip to content

Commit

Permalink
Needed timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
preston-rogers committed Sep 11, 2024
1 parent 7068ff8 commit 7b9151a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/jsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/jsd_pub.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/device/jsd_minimal_example_el3602.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion test/jsd_test_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/jsd_soem_init_close_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/jsd_egd_tlc_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7b9151a

Please sign in to comment.