Skip to content

Commit 64714a6

Browse files
committed
applications: scale: Add support for L/R pass
Signed-off-by: Pavel Hübner <[email protected]>
1 parent 927f9b9 commit 64714a6

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

applications/scale/codec/cbor-decoder.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
- people_measurements:
3232
- tso:
3333
- motion_counter:
34+
- pass_counter_left:
35+
- pass_counter_right:
3436
- pass_counter_adult:
3537
- pass_counter_child:
3638
- stay_counter_adult:

applications/scale/src/app_cbor.c

+12
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,18 @@ int app_cbor_encode(zcbor_state_t *zs)
367367
zcbor_uint32_put(zs, measurement->motion_counter);
368368
}
369369

370+
if (!is_valid) {
371+
zcbor_nil_put(zs, NULL);
372+
} else {
373+
zcbor_uint32_put(zs, measurement->pass_counter_left);
374+
}
375+
376+
if (!is_valid) {
377+
zcbor_nil_put(zs, NULL);
378+
} else {
379+
zcbor_uint32_put(zs, measurement->pass_counter_right);
380+
}
381+
370382
if (!is_valid) {
371383
zcbor_nil_put(zs, NULL);
372384
} else {

applications/scale/src/app_measure.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
LOG_MODULE_REGISTER(app_measure, LOG_LEVEL_DBG);
3434

3535
#define MAX_REPETITIONS 5
36-
#define MAX_DIFFERENCE 100
36+
#define MAX_DIFFERENCE 100
3737

3838
K_MUTEX_DEFINE(g_app_measure_weight_lock);
3939

@@ -344,6 +344,8 @@ int app_measure_people(void)
344344

345345
} else {
346346
LOG_INF("Motion counter: %u", measurement.motion_counter);
347+
LOG_INF("Pass counter (left): %u", measurement.pass_counter_left);
348+
LOG_INF("Pass counter (right): %u", measurement.pass_counter_right);
347349
LOG_INF("Pass counter (adult): %u", measurement.pass_counter_adult);
348350
LOG_INF("Pass counter (child): %u", measurement.pass_counter_child);
349351
LOG_INF("Stay counter (adult): %u", measurement.stay_counter_adult);

0 commit comments

Comments
 (0)