File tree Expand file tree Collapse file tree 5 files changed +22
-15
lines changed
samples/peripherals/bm_zms/src Expand file tree Collapse file tree 5 files changed +22
-15
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,12 @@ Libraries
54
54
55
55
* :ref: `lib_bm_zms ` library:
56
56
57
- * Updated the :c:func: `bm_zms_register ` function to return ``-EINVAL `` when passing ``NULL `` input parameters.
57
+ * Updated:
58
+
59
+ * The :c:func: `bm_zms_register ` function to return ``-EINVAL `` when passing ``NULL `` input parameters.
60
+ * The name of the :c:struct: `bm_zms_evt_t ` ``id `` field to :c:member: `bm_zms_evt_t.evt_id `.
61
+ * The name of the :c:struct: `bm_zms_evt_t ` ``ate_id `` field to :c:member: `bm_zms_evt_t.id `.
62
+
58
63
* Added the :c:enumerator: `BM_ZMS_EVT_DELETE ` event ID to distinguish :c:func: `bm_zms_delete ` events.
59
64
60
65
* :ref: `lib_ble_conn_params ` library:
Original file line number Diff line number Diff line change @@ -41,9 +41,11 @@ typedef enum {
41
41
42
42
/**@brief A BM_ZMS event. */
43
43
typedef struct {
44
- bm_zms_evt_id_t id ; /* The event ID. See @ref bm_zms_evt_id_t. */
45
- uint32_t result ; /* The result of the operation related to this event. */
46
- uint32_t ate_id ; /* The ATE id in case of a write operation. */
44
+ bm_zms_evt_id_t evt_id ; /* The event ID. See @ref bm_zms_evt_id_t. */
45
+ uint32_t result ; /* The result of the operation related to this event. */
46
+ uint32_t id ; /* The ID of the entry as specified in the corresponding
47
+ * write/delete operation.
48
+ */
47
49
} bm_zms_evt_t ;
48
50
49
51
/* Init flags. */
Original file line number Diff line number Diff line change @@ -69,21 +69,21 @@ static void event_prepare(bm_zms_evt_t *p_evt)
69
69
{
70
70
switch (cur_op .op_code ) {
71
71
case ZMS_OP_INIT :
72
- p_evt -> id = BM_ZMS_EVT_INIT ;
72
+ p_evt -> evt_id = BM_ZMS_EVT_INIT ;
73
73
break ;
74
74
75
75
case ZMS_OP_WRITE :
76
76
atomic_sub (& cur_op .fs -> ongoing_writes , 1 );
77
- p_evt -> id = cur_op .len ? BM_ZMS_EVT_WRITE : BM_ZMS_EVT_DELETE ;
78
- p_evt -> ate_id = cur_op .id ;
77
+ p_evt -> evt_id = cur_op .len ? BM_ZMS_EVT_WRITE : BM_ZMS_EVT_DELETE ;
78
+ p_evt -> id = cur_op .id ;
79
79
break ;
80
80
81
81
case ZMS_OP_CLEAR :
82
- p_evt -> id = BM_ZMS_EVT_CLEAR ;
82
+ p_evt -> evt_id = BM_ZMS_EVT_CLEAR ;
83
83
break ;
84
84
85
85
case ZMS_OP_NONE :
86
- p_evt -> id = BM_ZMS_EVT_NONE ;
86
+ p_evt -> evt_id = BM_ZMS_EVT_NONE ;
87
87
break ;
88
88
default :
89
89
/* Should not happen. */
Original file line number Diff line number Diff line change @@ -112,12 +112,12 @@ static int delete_basic_items(struct bm_zms_fs *fs)
112
112
113
113
void bm_zms_sample_handler (bm_zms_evt_t const * p_evt )
114
114
{
115
- if (p_evt -> id == BM_ZMS_EVT_INIT ) {
115
+ if (p_evt -> evt_id == BM_ZMS_EVT_INIT ) {
116
116
if (p_evt -> result ) {
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 ) || (p_evt -> id == BM_ZMS_EVT_DELETE )) {
120
+ } else if ((p_evt -> evt_id == BM_ZMS_EVT_WRITE ) || (p_evt -> evt_id == BM_ZMS_EVT_DELETE )) {
121
121
if (!p_evt -> result ) {
122
122
return ;
123
123
}
@@ -127,7 +127,7 @@ void bm_zms_sample_handler(bm_zms_evt_t const *p_evt)
127
127
}
128
128
LOG_ERR ("BM_ZMS Error received %d" , p_evt -> result );
129
129
} else {
130
- LOG_WRN ("Unhandled BM_ZMS event ID %u" , p_evt -> id );
130
+ LOG_WRN ("Unhandled BM_ZMS event ID %u" , p_evt -> evt_id );
131
131
}
132
132
}
133
133
Original file line number Diff line number Diff line change @@ -92,10 +92,10 @@ static void wait_for_init(struct bm_zms_fs *fs)
92
92
93
93
void bm_zms_test_handler (bm_zms_evt_t const * p_evt )
94
94
{
95
- if (p_evt -> id == BM_ZMS_EVT_INIT ) {
95
+ if (p_evt -> 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 ) || (p_evt -> id == BM_ZMS_EVT_DELETE )) {
98
+ } else if ((p_evt -> evt_id == BM_ZMS_EVT_WRITE ) || (p_evt -> evt_id == BM_ZMS_EVT_DELETE )) {
99
99
if (p_evt -> result == 0 ) {
100
100
return ;
101
101
}
@@ -104,7 +104,7 @@ void bm_zms_test_handler(bm_zms_evt_t const *p_evt)
104
104
return ;
105
105
}
106
106
printf ("BM_ZMS Error received %d\n" , p_evt -> result );
107
- } else if (p_evt -> id == BM_ZMS_EVT_CLEAR ) {
107
+ } else if (p_evt -> evt_id == BM_ZMS_EVT_CLEAR ) {
108
108
zassert_true (p_evt -> result == 0 , "bm_zms_clear call failure: %d" ,
109
109
p_evt -> result );
110
110
}
You can’t perform that action at this time.
0 commit comments