Skip to content

Commit

Permalink
Add network interface config settings.
Browse files Browse the repository at this point in the history
# New Features
 - Add ENABLED interface config

 # Changes
- Add Python helper classes for PORT and REMOTE_ADDRESS interface settings
  • Loading branch information
Jonathan Diamond committed Jan 9, 2024
1 parent 6b5e84c commit ab0d073
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
21 changes: 21 additions & 0 deletions python/fusion_engine_client/messages/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class InterfaceConfigType(IntEnum):
BAUD_RATE = 2
REMOTE_ADDRESS = 3
PORT = 4
ENABLED = 5


class Direction(IntEnum):
Expand Down Expand Up @@ -912,6 +913,26 @@ class InterfaceBaudRateConfig(_conf_gen.IntegerVal):
"""
pass

@_conf_gen.create_interface_config_class(InterfaceConfigType.PORT, _conf_gen.UInt16Construct)
class InterfacePortConfig(_conf_gen.IntegerVal):
"""!
@brief Interface network port configuration settings.
"""
pass

@_conf_gen.create_interface_config_class(InterfaceConfigType.REMOTE_ADDRESS, _conf_gen.StringConstruct(64))
class InterfaceRemoteAddressConfig(_conf_gen.StringVal):
"""!
@brief Configure the network address for a client to connect to.
"""
pass

@_conf_gen.create_interface_config_class(InterfaceConfigType.ENABLED, _conf_gen.BoolConstruct)
class InterfaceEnabledConfig(_conf_gen.BoolVal):
"""!
@brief Interface enabled/disabled configuration settings.
"""
pass

@_conf_gen.create_interface_config_class(InterfaceConfigType.OUTPUT_DIAGNOSTICS_MESSAGES, _conf_gen.BoolConstruct)
class InterfaceDiagnosticMessagesEnabled(_conf_gen.BoolVal):
Expand Down
14 changes: 14 additions & 0 deletions src/point_one/fusion_engine/messages/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,17 @@ enum class InterfaceConfigType : uint8_t {
* Payload format: `uint16_t`
*/
PORT = 4,

/**
* Enable/disable the interface.
*
* Valid for:
* - @ref TransportType::TCP_CLIENT
* - @ref TransportType::UDP_CLIENT
*
* Payload format: `bool`
*/
ENABLED = 5,
};

/**
Expand Down Expand Up @@ -421,6 +432,9 @@ P1_CONSTEXPR_FUNC const char* to_string(InterfaceConfigType type) {
case InterfaceConfigType::PORT:
return "Network Port";

case InterfaceConfigType::ENABLED:
return "Interface Enabled";

default:
return "Unrecognized Configuration";
}
Expand Down

0 comments on commit ab0d073

Please sign in to comment.