Skip to content

Commit d14cdd6

Browse files
silabs-aydoganerzr
authored andcommitted
uic: zpc: UIC-3597: Remove zwave_store_nls_support dependency from zwave_api module
(cherry picked from commit dc4aac75a507871e24f1dfd71dd7f1cdb6794167) Forwarded: #11 Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
1 parent 5bf4022 commit d14cdd6

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

applications/zpc/components/zpc_stdin/src/zpc_stdin_command_handling.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,13 +881,22 @@ static sl_status_t handle_get_nls_state(const handle_args_t &arg)
881881
sl_status_t status = zwapi_get_node_nls(node_id, &nls_state);
882882
if (SL_STATUS_OK == status)
883883
{
884+
// TODO: Add commented condition below once related SAPI command is updated
885+
status = zwave_store_nls_state(node_id, nls_state, REPORTED_ATTRIBUTE) /* || zwave_store_nls_support(node_id, nls_support, REPORTED_ATTRIBUTE) */;
886+
if (SL_STATUS_OK != status) {
887+
dprintf(out_stream, "Unable to store NLS state for Node ID: %d\n", node_id);
888+
return SL_STATUS_FAIL;
889+
}
884890
dprintf(out_stream, "Node ID %d, NLS state: %d\n", node_id, nls_state);
891+
return SL_STATUS_OK;
885892
}
886893
else
887894
{
888-
dprintf(out_stream, "Unable to read NLS state");
895+
dprintf(out_stream,
896+
"Unable to read NLS state for Node ID: %d\n",
897+
node_id);
898+
return SL_STATUS_FAIL;
889899
}
890-
return status;
891900
} catch (const std::invalid_argument &e) {
892901
dprintf(out_stream, "%s: Invalid argument: %s\n", arg[0].c_str(), e.what());
893902
return SL_STATUS_FAIL;

applications/zpc/components/zwave_api/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ add_library(
1414
platform/${COMPATIBLE_PLATFORM}/zwapi_timestamp.c
1515
)
1616

17-
target_link_libraries(zwave_api PUBLIC zwave_definitions PRIVATE unify zpc_attribute_store)
17+
target_link_libraries(zwave_api PUBLIC zwave_definitions PRIVATE unify)
1818
target_include_directories(
1919
zwave_api
2020
PRIVATE src platform/${COMPATIBLE_PLATFORM}

applications/zpc/components/zwave_api/src/zwapi_protocol_controller.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "zwapi_init.h"
2020
#include "zwapi_internal.h"
2121
#include "zwapi_utils.h"
22-
#include "zwave_utils.h"
2322

2423
// Unify includes
2524
#include "sl_log.h"
@@ -828,14 +827,10 @@ sl_status_t zwapi_get_node_nls(
828827
if (send_command_status == SL_STATUS_OK && response_length > IDX_DATA)
829828
{
830829
*nls_state = response_buffer[IDX_DATA];
831-
if (// zwave_store_nls_support(nodeId, *nls_support, REPORTED_ATTRIBUTE) ||
832-
// TODO: to be added once SAPI command is updated
833-
zwave_store_nls_state(nodeId, *nls_state, REPORTED_ATTRIBUTE))
834-
{
835-
return SL_STATUS_FAIL;
836-
}
830+
return SL_STATUS_OK;
837831
}
838-
return send_command_status;
832+
833+
return SL_STATUS_FAIL;
839834
}
840835

841836
sl_status_t zwapi_transfer_protocol_cc(

0 commit comments

Comments
 (0)