Skip to content

Commit

Permalink
Merge pull request DLTcollab#749 from splasky/change_send_transaction
Browse files Browse the repository at this point in the history
fix(Endpoint): End the process via exit function
  • Loading branch information
jserv authored Aug 12, 2020
2 parents b092a0a + fe7ba1d commit 71ea022
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions endpoint/endpointComp/endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,16 @@ COMPONENT_INIT {
device_t* device = ta_device(STRINGIZE(EP_TARGET));
if (device == NULL) {
LE_ERROR("Can not get specific device");
} else {
device->op->get_key(private_key);
device->op->get_device_id(device_id);
#ifdef ENABLE_ENDPOINT_TEST
LE_TEST_INIT;
LE_TEST_INFO("=== ENDPOINT TEST BEGIN ===");
LE_TEST(SC_OK == send_transaction_information(host, port, ssl_seed, value, message, message_fmt, tag, address,
next_address, private_key, device_id_ptr, iv));
LE_TEST_EXIT;
#else
while (true) {
// TODO: listen input from UART here
status_t ret = send_transaction_information(host, port, ssl_seed, value, message, message_fmt, tag, address,
next_address, private_key, device_id_ptr, iv);
LE_INFO("Send transaction information return: %d", ret);
sleep(10);
}
#endif
exit(EXIT_FAILURE);
}

device->op->get_key(private_key);
device->op->get_device_id(device_id);

status_t ret = SC_OK;
LE_INFO("=== ENDPOINT TEST BEGIN ===");
ret = send_transaction_information(host, port, ssl_seed, value, message, message_fmt, tag, address, next_address,
private_key, device_id_ptr, iv);
LE_INFO("Send transaction information return: %d", ret);
exit(ret == SC_OK ? EXIT_SUCCESS : EXIT_FAILURE);
}

0 comments on commit 71ea022

Please sign in to comment.