File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
modules/HardwareDrivers/PowerSupplies/Huawei_V100R023C10
fusion_charger_lib/fusion-charger-dispenser-library/power_stack_mock/src Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,14 @@ The mock has a few environment variables (enable or disable by setting them to `
155155 messages. This also allows to receive completely unsigned messages.
156156- ``FUSION_CHARGER_MOCK_ETH``: The ethernet interface to use for receiving and sending goose messages. Defaults to
157157 ``veth0``.
158+ - ``FUSION_CHARGER_MOCK_PORT``: The Modbus TCP port to listen on. Defaults to ``8502``.
159+ - ``FUSION_CHARGER_MOCK_MQTT_HOST``: MQTT broker hostname or IP address. When set together with
160+ ``FUSION_CHARGER_MOCK_MQTT_PORT``, the mock will publish power request data via MQTT.
161+ - ``FUSION_CHARGER_MOCK_MQTT_PORT``: MQTT broker port. Required together with ``FUSION_CHARGER_MOCK_MQTT_HOST`` to
162+ enable MQTT publishing.
163+ - ``FUSION_CHARGER_MOCK_MQTT_BASE_TOPIC``: Base topic for MQTT publishing. Defaults to ``fusion_charger_mock/``.
164+ Power requests are published to ``<base_topic>/<connector_number>/power_request`` with JSON payload containing
165+ voltage and current values.
158166
159167It also has one optional command line argument, being the path to a folder with certificates and keys for mTLS.
160168
@@ -172,4 +180,10 @@ corresponding files for the dispenser):
172180
173181.. code-block:: bash
174182
175- modules/HardwareDrivers/PowerSupplies/Huawei_V100R023C10/fusion_charger_lib/fusion-charger-dispenser-library/user-acceptance-tests/test_certificates/generate.sh
183+ modules/HardwareDrivers/PowerSupplies/Huawei_V100R023C10/fusion_charger_lib/fusion-charger-dispenser-library/user-acceptance-tests/test_certificates/generate.sh
184+
185+ Then run the mock with the path to the certificates folder:
186+
187+ .. code-block:: bash
188+
189+ ./fusion_charger_mock /path/to/certificates
Original file line number Diff line number Diff line change @@ -308,6 +308,11 @@ int main(int argc, char* argv[]) {
308308 printf("Using default Ethernet interface: %s\n", config.eth.c_str());
309309 }
310310
311+ // Set the Modbus TCP port to use
312+ if (std::getenv("FUSION_CHARGER_MOCK_PORT")) {
313+ config.port = std::atoi(std::getenv("FUSION_CHARGER_MOCK_PORT"));
314+ }
315+
311316 printf("Waiting for connections on port %d\n", config.port);
312317
313318 std::shared_ptr<MqttPowerRequestPublisher> mqtt_publisher;
You can’t perform that action at this time.
0 commit comments