Skip to content

Commit

Permalink
Add protocol error count information to status line
Browse files Browse the repository at this point in the history
  • Loading branch information
mubes committed Sep 3, 2024
1 parent 9761c75 commit 4d758dd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Inc/cobs.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ void COBSPump( struct COBS *t, const uint8_t *incoming, int len,
void ( *packetRxed )( struct Frame *p, void *param ),
void *param );
void COBSDelete( struct COBS *t );
static inline int COBSGetErrors( struct COBS *t )
{
return t ? t->error : 0;
}
struct COBS *COBSInit( struct COBS *t );
// ====================================================================================================
#ifdef __cplusplus
Expand Down
9 changes: 8 additions & 1 deletion Inc/oflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ void OFLOWEncode( const uint8_t channel, const uint64_t tstamp, const uint8_t *i
void OFLOWPump( struct OFLOW *t, const uint8_t *incoming, int len,
void ( *packetRxed )( struct OFLOWFrame *p, void *param ),
void *param );

static inline uint64_t OFLOWGetErrors( struct OFLOW *t )
{
return t ? t->perror : ( uint64_t ) -1;
}
static inline uint64_t OFLOWGetCOBSErrors( struct OFLOW *t )
{
return t ? COBSGetErrors( &t->c ) : -1;
}
void OFLOWDelete( struct OFLOW *t );
struct OFLOW *OFLOWInit( struct OFLOW *t );
// ====================================================================================================
Expand Down
3 changes: 2 additions & 1 deletion Src/orbuculum.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

/* Number of potential tags */
#define NUM_TAGS (256)
#define LAST_TAG_SEEN_TIME_NS (500L*1000L*1000L)
#define LAST_TAG_SEEN_TIME_NS (2*1000L*1000L*1000L)

/* Record of transferred data per tag */
struct TagDataCount
Expand Down Expand Up @@ -784,6 +784,7 @@ void _checkInterval( void *params )
genericsPrintf( "(" C_DATA " %3d%% " C_RESET "full)", ( fullPercent > 100 ) ? 100 : fullPercent );
}

genericsReport( V_INFO, "Ce=%d Oe=%d", OFLOWGetCOBSErrors( &_r.oflow ), OFLOWGetErrors( &_r.oflow ) );
genericsPrintf( " " C_RESET C_CLR_LN EOL );
}

Expand Down

0 comments on commit 4d758dd

Please sign in to comment.