Skip to content

Commit 857e251

Browse files
silabs-aydoganerzr
authored andcommitted
libs2: SWPROT-9320: Store NLS status of primary/secondary controller in controller's NVM (#52)
(cherry picked from commit d925294748422d314bf58b9d8e67d04efab3aa97) Relate-to: #50 Forwarded: #52 Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
1 parent 1c447bc commit 857e251

File tree

2 files changed

+15
-0
lines changed
  • applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2

2 files changed

+15
-0
lines changed

applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/include/S2_external.h

+8
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,14 @@ void S2_resynchronization_event(
193193
*/
194194
void S2_save_nls_state(void);
195195

196+
/**
197+
* Load NLS state stored in device memory in S2 context
198+
*
199+
* \param ctxt the S2 context
200+
* \param nls_state NLS state
201+
*/
202+
void S2_load_nls_state(struct S2* ctxt, uint8_t nls_state);
203+
196204
/**
197205
* @}
198206
*/

applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/protocol/S2.c

+7
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,7 @@ static void S2_command_handler(struct S2* p_context, s2_connection_t* src, uint8
14591459
if (state) {
14601460
ctxt->nls_state = 1; // There is at least one an NLS-enabled node in the network
14611461
}
1462+
S2_save_nls_state();
14621463

14631464
S2_notify_nls_state_report(src->r_node, src->class_id, capability, state);
14641465
}
@@ -1968,6 +1969,12 @@ S2_is_send_data_multicast_busy(struct S2* p_context)
19681969
return ctxt->fsm != IDLE;
19691970
}
19701971

1972+
void S2_load_nls_state(struct S2* p_context, uint8_t nls_state)
1973+
{
1974+
CTX_DEF
1975+
ctxt->nls_state = nls_state;
1976+
}
1977+
19711978
static void S2_send_nls_state_report(struct S2* p_context, s2_connection_t* con)
19721979
{
19731980
CTX_DEF

0 commit comments

Comments
 (0)