Skip to content

Commit

Permalink
fix(ui): correctly display CRC errors on zniffer (#4039)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Dec 11, 2024
1 parent 4b446b9 commit f868b69
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ export function getRegion(item) {
)
}
export function getRoute(item, withRssi = false) {
if (item.corrupted) {
return ''
}

const repRSSI = item.repeaterRSSI || []
const dir = item.direction === 'inbound' ? '←' : '→'
const hop = item.hop !== undefined ? item.hop : -1
Expand Down Expand Up @@ -267,6 +271,10 @@ export function getRoute(item, withRssi = false) {
return routeString
}
export function getType(item) {
if (item.corrupted) {
return ''
}

if (item.protocol === Protocols.ZWaveLongRange) {
return getEnumMemberName(LongRangeFrameType, item.type)
} else {
Expand Down
12 changes: 9 additions & 3 deletions src/views/Zniffer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@
<template
v-slot:[`item.protocolDataRate`]="{ item }"
>
<div class="d-flex text-center">
<span v-if="item.corrupted">----</span>
<div v-else class="d-flex text-center">
<rich-value
:value="getProtocolIcon(item.protocol)"
/>
Expand All @@ -182,7 +183,9 @@
</template>

<template v-slot:[`item.type`]="{ item }">
{{ getType(item) }}
<span>
{{ getType(item) }}
</span>
</template>

<template v-slot:[`item.sourceNodeId`]="{ item }">
Expand All @@ -194,10 +197,13 @@
</template>

<template v-slot:[`item.payload`]="{ item }">
<code v-if="item.corrupted"> CRC Error </code>
<span v-if="item.parsedPayload">
{{ getPayloadTags(item.parsedPayload) }}
</span>
<span v-else-if="item.payload">
<span
v-else-if="item.payload && !item.corrupted"
>
{{ item.payload }}
</span>
<span v-else-if="item.routedAck"
Expand Down

0 comments on commit f868b69

Please sign in to comment.