-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: APKAM enrollmentId support and atkeys_file refactor #400
Changes from all commits
5cbb247
5338eeb
39e0738
d16c0bf
93b0120
3da35a3
857f3e2
1f58601
9caea86
28b8159
60955e5
6b06522
d6e6962
e8ffc06
cd088c2
d78b8fd
a93f07b
39a33bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
#include <atchops/iv.h> | ||
#include <atclient/atclient.h> | ||
#include <atclient/atclient_utils.h> | ||
#include <atclient/atkeysfile.h> | ||
#include <atclient/atkeys_file.h> | ||
#include <atclient/constants.h> | ||
#include <atclient/encryption_key_helpers.h> | ||
#include <atclient/monitor.h> | ||
|
@@ -145,23 +145,23 @@ int main(int argc, char *argv[]) { | |
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "atclient_atkey_create_shared_key: %d\n", ret); | ||
} | ||
|
||
if((ret = atclient_notify_params_set_operation(¶ms, ATCLIENT_NOTIFY_OPERATION_UPDATE)) != 0) { | ||
if ((ret = atclient_notify_params_set_operation(¶ms, ATCLIENT_NOTIFY_OPERATION_UPDATE)) != 0) { | ||
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "atclient_notify_params_set_operation: %d\n", ret); | ||
} | ||
|
||
if((ret = atclient_notify_params_set_atkey(¶ms, &atkey)) != 0) { | ||
if ((ret = atclient_notify_params_set_atkey(¶ms, &atkey)) != 0) { | ||
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "atclient_notify_params_set_atkey: %d\n", ret); | ||
} | ||
|
||
if((ret = atclient_notify_params_set_value(¶ms, line)) != 0) { | ||
if ((ret = atclient_notify_params_set_value(¶ms, line)) != 0) { | ||
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "atclient_notify_params_set_value: %d\n", ret); | ||
} | ||
|
||
if((ret = atclient_notify_params_set_should_encrypt(¶ms, true)) != 0) { | ||
if ((ret = atclient_notify_params_set_should_encrypt(¶ms, true)) != 0) { | ||
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "atclient_notify_params_set_should_encrypt: %d\n", ret); | ||
} | ||
|
||
if((ret = atclient_notify_params_set_notification_expiry(¶ms, 5000)) != 0) { | ||
if ((ret = atclient_notify_params_set_notification_expiry(¶ms, 5000)) != 0) { | ||
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "atclient_notify_params_set_notification_expiry: %d\n", ret); | ||
} | ||
|
||
|
@@ -235,7 +235,7 @@ static void *monitor_handler(void *xargs) { | |
const char *from_atsign = args->from_atsign; | ||
|
||
pthread_mutex_lock(&monitor_mutex); | ||
if ((ret = atclient_monitor_pkam_authenticate(monitor, atserver_host, atserver_port, atkeys, from_atsign)) != 0) { | ||
if ((ret = atclient_monitor_pkam_authenticate(monitor, from_atsign, atkeys, NULL)) != 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This signature is changed, host and port are now part of the options struct (which can be NULL, and the pkam_authenticate will look it up for you) |
||
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "atclient_pkam_authenticate: %d\n", ret); | ||
goto exit; | ||
} | ||
|
@@ -353,7 +353,7 @@ static int reconnect_clients(atclient *monitor, atclient *ctx, const char *atser | |
* 2. Reconnect monitor connection | ||
*/ | ||
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_DEBUG, "Reconnecting monitor connection...\n"); | ||
if ((ret = atclient_monitor_pkam_authenticate(monitor, atserver_host, atserver_port, atkeys, from_atsign)) != 0) { | ||
if ((ret = atclient_monitor_pkam_authenticate(monitor, from_atsign, atkeys, NULL)) != 0) { | ||
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "atclient_pkam_authenticate: %d\n", ret); | ||
return ret; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ set( | |
${CMAKE_CURRENT_LIST_DIR}/src/atclient.c | ||
${CMAKE_CURRENT_LIST_DIR}/src/atkey.c | ||
${CMAKE_CURRENT_LIST_DIR}/src/atkeys.c | ||
${CMAKE_CURRENT_LIST_DIR}/src/atkeysfile.c | ||
${CMAKE_CURRENT_LIST_DIR}/src/atkeys_file.c | ||
${CMAKE_CURRENT_LIST_DIR}/src/atnotification.c | ||
${CMAKE_CURRENT_LIST_DIR}/src/connection_hooks.c | ||
${CMAKE_CURRENT_LIST_DIR}/src/connection.c | ||
|
@@ -49,11 +49,11 @@ if(ESP_PLATFORM) | |
TARGET ${COMPONENT_LIB} | ||
POST_BUILD | ||
COMMAND | ||
${CMAKE_COMMAND} -E copy_directory ${ATCLIENT_INCLUDE_DIR} | ||
${CMAKE_SOURCE_DIR}/include | ||
${CMAKE_COMMAND} -E copy_directory ${ATCLIENT_INCLUDE_DIR} | ||
${CMAKE_SOURCE_DIR}/include | ||
COMMAND | ||
${CMAKE_COMMAND} -E copy $<TARGET_FILE:${COMPONENT_LIB}> | ||
${CMAKE_SOURCE_DIR}/lib/lib${COMPONENT_NAME}.a | ||
${CMAKE_COMMAND} -E copy $<TARGET_FILE:${COMPONENT_LIB}> | ||
${CMAKE_SOURCE_DIR}/lib/lib${COMPONENT_NAME}.a | ||
COMMENT "Copying built archive file and header to lib directory..." | ||
) | ||
endif() | ||
|
@@ -111,9 +111,9 @@ if(NOT ESP_PLATFORM) | |
target_include_directories( | ||
${PROJECT_NAME} | ||
PUBLIC | ||
$<BUILD_INTERFACE:${ATCLIENT_INCLUDE_DIR}> | ||
$<BUILD_INTERFACE:${cjson_SOURCE_DIR}> | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
$<BUILD_INTERFACE:${ATCLIENT_INCLUDE_DIR}> | ||
$<BUILD_INTERFACE:${cjson_SOURCE_DIR}> | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
) | ||
|
||
# Link dependencies to library targets | ||
|
@@ -150,9 +150,8 @@ if(NOT ESP_PLATFORM) | |
) | ||
|
||
# EXPORT | ||
if(NOT ATCLIENT_AS_SUBPROJECT) | ||
if(NOT ATCLIENT_AS_SUBPROJECT AND ATCLIENT_EXPORT) | ||
# Export the library | ||
export(PACKAGE ${PROJECT_NAME}) | ||
Comment on lines
-153
to
-155
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't export the package by default |
||
|
||
# install as a config.cmake | ||
install( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This header file was renamed to conform to our naming standards