Skip to content

Commit

Permalink
Change init state to also be reported outside monr decoding function
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasWikander committed Apr 8, 2021
1 parent e88fd70 commit 6228a21
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion iso22133.c
Original file line number Diff line number Diff line change
Expand Up @@ -3245,6 +3245,9 @@ void convertMONRToHostRepresentation(const MONRType * MONRData,

// State
switch (MONRData->state) {
case ISO_OBJECT_STATE_INIT:
monitorData->state = OBJECT_STATE_INIT;
break;
case ISO_OBJECT_STATE_DISARMED:
monitorData->state = OBJECT_STATE_DISARMED;
break;
Expand All @@ -3264,7 +3267,6 @@ void convertMONRToHostRepresentation(const MONRType * MONRData,
monitorData->state = OBJECT_STATE_REMOTE_CONTROL;
break;
case ISO_OBJECT_STATE_OFF:
case ISO_OBJECT_STATE_INIT:
default:
monitorData->state = OBJECT_STATE_UNKNOWN;
break;
Expand Down
3 changes: 3 additions & 0 deletions positioning.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "positioning.h"

static const char unknownStateString[] = "UNKNOWN";
static const char initStateString[] = "INIT";
static const char disarmedStateString[] = "DISARMED";
static const char armedStateString[] = "ARMED";
static const char runningStateString[] = "RUNNING";
Expand Down Expand Up @@ -47,6 +48,8 @@ const char *objectStateToASCII(const ObjectStateType state) {
return abortingStateString;
case OBJECT_STATE_REMOTE_CONTROL:
return remoteControlStateString;
case OBJECT_STATE_INIT:
return initStateString;
case OBJECT_STATE_UNKNOWN:
default:
return unknownStateString;
Expand Down
1 change: 1 addition & 0 deletions positioning.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ typedef enum {
/*! Enumeration of observable object states */
typedef enum {
OBJECT_STATE_UNKNOWN,
OBJECT_STATE_INIT,
OBJECT_STATE_DISARMED,
OBJECT_STATE_ARMED,
OBJECT_STATE_RUNNING,
Expand Down

0 comments on commit 6228a21

Please sign in to comment.