Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Commit

Permalink
fix(endpoint): Fix Legato app building errors
Browse files Browse the repository at this point in the history
Generate the certification before building the endpoint Legato app.
Add the source and header files of logger.
Fix the if-else condition comparison and function argument.
  • Loading branch information
marktwtn committed Jun 4, 2020
1 parent cd3c1eb commit 69f67b6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $(MOSQUITTO_LIB): $(MOSQUITTO_DIR)
$(MAKE) -C $^ WITH_DOCS=no

# Build endpoint Legato app
legato:
legato: cert
# Generate resolv.conf
echo "nameserver $(NAMESERVER)" > $(RESOLV_CONF_DIR)/resolv.conf
# Fetch the required external source code
Expand Down
3 changes: 3 additions & 0 deletions endpoint/endpointComp/Component.cdef
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ sources:
{
${CURDIR}/../endpoint_core.c

${CURDIR}/../../output_base/external/entangled/utils/logger_helper.c

${CURDIR}/../../output_base/external/http_parser/http_parser.c

${CURDIR}/../../output_base/external/mbedtls_2_16_6/library/aes.c
Expand Down Expand Up @@ -76,6 +78,7 @@ cflags:
-I${CURDIR}/../../output_base/execroot/__main__/bazel-out/k8-fastbuild/bin/external/entangled

-I${CURDIR}/../../output_base/external/com_github_uthash/src
-I${CURDIR}/../../output_base/external/com_github_embear_logger/include
-I${CURDIR}/../../output_base/external/entangled
-I${CURDIR}/../../output_base/external/http_parser
-I${CURDIR}/../../output_base/external/keccak
Expand Down
4 changes: 2 additions & 2 deletions endpoint/endpoint_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ status_t send_transaction_information(int value, const char* message, const char
ret = aes_encrypt(&encrypt_ctx);
memcpy(iv, encrypt_ctx.iv, AES_IV_SIZE);

if (ret != RET_OK) {
if (ret != SC_OK) {
ta_log_error("Encrypt message error.\n");
return ret;
}
Expand All @@ -102,7 +102,7 @@ status_t send_transaction_information(int value, const char* message, const char
return SC_ENDPOINT_SEND_TRANSFER;
}

if (send_https_msg(HOST, PORT, SEND_TRANSACTION_API, req_body, MAX_MSG_LEN, SSL_SEED) != RET_OK) {
if (send_https_msg(HOST, PORT, SEND_TRANSACTION_API, req_body, SSL_SEED) != SC_OK) {
ta_log_error("http message sending error.\n");
return SC_ENDPOINT_SEND_TRANSFER;
}
Expand Down

0 comments on commit 69f67b6

Please sign in to comment.