File tree Expand file tree Collapse file tree 5 files changed +9
-7
lines changed
samples/peripherals/bm_zms/src Expand file tree Collapse file tree 5 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ Libraries
55
55
* :ref: `lib_bm_zms ` library:
56
56
57
57
* Updated the :c:func: `bm_zms_register ` function to return ``-EINVAL `` when passing ``NULL `` input parameters.
58
+ * Added the :c:enumerator: `BM_ZMS_EVT_DELETE ` event ID to distinguish :c:func: `bm_zms_delete ` events.
58
59
59
60
* :ref: `lib_ble_conn_params ` library:
60
61
Original file line number Diff line number Diff line change @@ -32,10 +32,11 @@ extern "C" {
32
32
33
33
/** BM_ZMS event IDs. */
34
34
typedef enum {
35
- BM_ZMS_EVT_NONE , /* Event if an internal error happened before queuing an operation. */
36
- BM_ZMS_EVT_INIT , /* Event for @ref bm_zms_init. */
37
- BM_ZMS_EVT_WRITE , /* Event for @ref bm_zms_write. */
38
- BM_ZMS_EVT_CLEAR , /* Event for @ref bm_zms_clear. */
35
+ BM_ZMS_EVT_NONE , /* Event if an internal error happened before queuing an operation. */
36
+ BM_ZMS_EVT_INIT , /* Event for @ref bm_zms_init. */
37
+ BM_ZMS_EVT_WRITE , /* Event for @ref bm_zms_write. */
38
+ BM_ZMS_EVT_DELETE , /* Event for @ref bm_zms_delete. */
39
+ BM_ZMS_EVT_CLEAR , /* Event for @ref bm_zms_clear. */
39
40
} bm_zms_evt_id_t ;
40
41
41
42
/**@brief A BM_ZMS event. */
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ static void event_prepare(bm_zms_evt_t *p_evt)
74
74
75
75
case ZMS_OP_WRITE :
76
76
atomic_sub (& cur_op .fs -> ongoing_writes , 1 );
77
- p_evt -> id = BM_ZMS_EVT_WRITE ;
77
+ p_evt -> id = cur_op . len ? BM_ZMS_EVT_WRITE : BM_ZMS_EVT_DELETE ;
78
78
p_evt -> ate_id = cur_op .id ;
79
79
break ;
80
80
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ void bm_zms_sample_handler(bm_zms_evt_t const *p_evt)
117
117
LOG_ERR ("BM_ZMS initialization failed with error %d" , p_evt -> result );
118
118
return ;
119
119
}
120
- } else if (p_evt -> id == BM_ZMS_EVT_WRITE ) {
120
+ } else if (( p_evt -> id == BM_ZMS_EVT_WRITE ) || ( p_evt -> id == BM_ZMS_EVT_DELETE ) ) {
121
121
if (!p_evt -> result ) {
122
122
return ;
123
123
}
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ void bm_zms_test_handler(bm_zms_evt_t const *p_evt)
95
95
if (p_evt -> id == BM_ZMS_EVT_INIT ) {
96
96
zassert_true (p_evt -> result == 0 , "bm_zms_init call failure: %d" ,
97
97
p_evt -> result );
98
- } else if (p_evt -> id == BM_ZMS_EVT_WRITE ) {
98
+ } else if (( p_evt -> id == BM_ZMS_EVT_WRITE ) || ( p_evt -> id == BM_ZMS_EVT_DELETE ) ) {
99
99
if (p_evt -> result == 0 ) {
100
100
return ;
101
101
}
You can’t perform that action at this time.
0 commit comments