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

added Serial industrial types #4981

Merged
merged 6 commits into from Feb 1, 2024

Conversation

Torstein-Eide
Copy link
Contributor

@Torstein-Eide Torstein-Eide commented Dec 14, 2023

What's Changed

Add choices for some used serial interfaces:

  • Generic RS232, RS422, RS423, R485
  • Modbus
  • Profibus
  • HART

TODO

  • Explanation of Change(s)
  • Added change log fragment(s) (for more information see the documentation)

Comment on lines 828 to 834
TYPE_EIA485_modbus = "modbus"
TYPE_EIA485_profibus = "profibus"
TYPE_fiber_profibus = "profibus-fiber"
TYPE_HART_RS232 = "hart-rs232"
TYPE_HART_RS422 = "hart-rs422"
TYPE_HART_RS485 = "hart-rs485"
TYPE_HART_bell202 = "hart-bell202"
Copy link
Contributor

Choose a reason for hiding this comment

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

Our general convention would be for each of the constants to be all-caps, rather than mixed case, i.e. TYPE_EIA485_MODBUS, etc.

@@ -821,6 +821,17 @@ class InterfaceTypeChoices(ChoiceSet):
TYPE_E1 = "e1"
TYPE_T3 = "t3"
TYPE_E3 = "e3"
TYPE_EIA232= "eia232"
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be more self-consistent and make better sense for these to be the connector type rather than the protocol? E.g. ConsolePortTypeChoices has TYPE_DE9 = "de-9" and TYPE_DB25 = "db-25" rather than eia232.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For serial port there is 4 elements:

  • The physical connector, there is a lot.
  • Is the connector a point to point, or bus.
  • OSI model 1, how bits are send, EIA233, EIA485, BELL202, fiber...
  • OSI model 2-6 is not used.
  • OSI model 7, how the data is formatted, Profibus, MODbus, HART, and you can make your own.

So based on that i think a mix of OSI L1 and OSI L7, is what will give us the best result, this is most inline with the other elements in the table.

And option is to have physical connector, as it own table.

Copy link
Contributor

Choose a reason for hiding this comment

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

Tagging @lampwins to provide guidance here.

Copy link
Member

Choose a reason for hiding this comment

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

Let's focus on the physical type and a custom field can be used for transport protocol where appropriate. In the future we can look at adding additional context to the data model here.

@HanlinMiao HanlinMiao merged commit bb58ca3 into nautobot:develop Feb 1, 2024
17 checks passed
@glennmatthews glennmatthews mentioned this pull request Feb 5, 2024
4 tasks
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

5 participants