Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): correctly display CRC errors on zniffer #4039

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading