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

remove invalid enum reference from storm32.xml #1947

Merged
merged 3 commits into from
Feb 7, 2023
Merged

remove invalid enum reference from storm32.xml #1947

merged 3 commits into from
Feb 7, 2023

Conversation

aler9
Copy link
Contributor

@aler9 aler9 commented Feb 3, 2023

#1941 contains an invalid enum reference that breaks generation of external libraries.

I searched for the enum definition but i couldn't find it, therefore it should be removed unless @olliw42 provides it.

@olliw42
Copy link
Contributor

olliw42 commented Feb 3, 2023

omg, indeed ... MANY thx!

could you please also change the date to 3. Feb. 2023 (it seems one can't do a suggestion for non modified lines)

message_definitions/v1.0/storm32.xml Outdated Show resolved Hide resolved
aler9 and others added 2 commits February 4, 2023 11:26
Co-authored-by: olliw42 <6089567+olliw42@users.noreply.github.com>
@aler9
Copy link
Contributor Author

aler9 commented Feb 4, 2023

@olliw42 all done.

@olliw42
Copy link
Contributor

olliw42 commented Feb 4, 2023

perfect, many thx sir :)

it's interesting that some generators do test for such things...

@aler9
Copy link
Contributor Author

aler9 commented Feb 4, 2023

@olliw42 in some strongly typed languages, an enum corresponds to a dedicated type. If the enum doesn't exist, the field has an invalid type.

While in C, that is still a strongly typed language, an enum-based field may be converted into

#define ENUM_MYENUM_VAL1 1
#define ENUM_MYENUM_VAL2 2

typedef struct {
  uint16_t my_field;
} mymsg;

In Typescript, it is converted into

enum myenum {
  myval1 = 1,
  myval2 = 2,
}

type mymsg = {
  my_field: myenum
};

In Golang, it is converted into

type myenum int

const (
  myval1 myenum = 1
  myval2 myenum = 2
)

type mymsg struct {
  my_field myenum
}

Therefore myenum must exist.

@olliw42
Copy link
Contributor

olliw42 commented Feb 4, 2023

ah, it's not a generator thing but a language thing
thx for the insight :)

Copy link
Collaborator

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olliw42 I'm taking your comment as approval and merging :-)

@hamishwillee hamishwillee merged commit 841b768 into mavlink:master Feb 7, 2023
TSC21 pushed a commit to Dronecode/air-iop-definitions that referenced this pull request Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants