Skip to content

Commit fbf1f40

Browse files
Thomasdjbrzr
authored andcommitted
SWPROT-9430: Address review comments
1 parent ae37efe commit fbf1f40

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

applications/zpc/components/zpc_stdin/test/zpc_stdin_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ void test_handle_cc_versions_log()
333333
void test_handle_nls()
334334
{
335335
sl_status_t state;
336-
uint8_t nls_state = false;
337-
uint8_t nls_support = false;
336+
uint8_t nls_state = 0;
337+
uint8_t nls_support = 0;
338338

339339
state = uic_stdin_handle_command("zwave_enable_nls");
340340
TEST_ASSERT_EQUAL(SL_STATUS_FAIL, state);

applications/zpc/components/zwave/zwave_transports/s2/src/zwave_s2_network.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ void zwave_s2_network_init()
148148
return;
149149
}
150150

151-
sl_log_info(LOG_TAG, "NLS support %s for Node ID: %d\n", nls_support == 1 ? "supported" : "not supported", node_id);
152-
sl_log_info(LOG_TAG, "NLS state %s for Node ID: %d\n", nls_state == 1 ? "active" : "not active", node_id);
151+
sl_log_info(LOG_TAG, "NLS %s, NLS %s for Node ID: %d\n", nls_support == 0 ? "not supported" : "supported", nls_state == 0 ? "not active" : "active", node_id);
153152

154153
S2_load_nls_state(s2_ctx, nls_state);
155154
status = zwave_store_nls_state(node_id, nls_state, REPORTED_ATTRIBUTE) || zwave_store_nls_support(node_id, nls_support, REPORTED_ATTRIBUTE);

applications/zpc/components/zwave_api/include/zwapi_protocol_controller.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,8 @@ sl_status_t zwapi_enable_node_nls(const zwave_node_id_t nodeId);
10491049
* @brief Get the NLS State of the node in the controller NVM
10501050
*
10511051
* @param nodeId the node ID
1052+
* @param nls_state NLS state pointer to be filled
1053+
* @param nls_support NLS support pointer to be filled
10521054
*
10531055
*/
10541056
sl_status_t zwapi_get_node_nls(const zwave_node_id_t nodeId, uint8_t* nls_state, uint8_t* nls_support);

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,9 @@ sl_status_t zwapi_get_node_nls(
829829
{
830830
*nls_support = response_buffer[IDX_DATA];
831831
*nls_state = response_buffer[IDX_DATA + 1];
832+
if (((*nls_support != 0) && (*nls_support != 1)) || ((*nls_state != 0) && (*nls_state != 1))) {
833+
return SL_STATUS_FAIL;
834+
}
832835
return SL_STATUS_OK;
833836
}
834837

0 commit comments

Comments
 (0)