Skip to content

Commit 8f49f21

Browse files
Add protobuf definition for communication components
Signed-off-by: Tar Viturawong <[email protected]>
1 parent 9a71b3c commit 8f49f21

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// Frequenz microgrid communication components definitions.
2+
//
3+
// Copyright:
4+
// Copyright 2023 Frequenz Energy-as-a-Service GmbH
5+
//
6+
// License:
7+
// MIT
8+
9+
syntax = "proto3";
10+
11+
package frequenz.api.common.v1.microgrid.communication_components;
12+
13+
14+
// CommunicationComponent represents a communication component within a
15+
// microgrid.
16+
//
17+
// Communication components are networked devices responsible for enabling
18+
// communication between electrical components, sensors, controllers, and other
19+
// networked equipment.
20+
message CommunicationComponent {
21+
// Unique identifier of the communication component.
22+
uint64 id = 1;
23+
24+
// Unique identifier of the parent microgrid.
25+
uint64 microgrid_id = 2;
26+
27+
// Human-readable name of the communication component.
28+
string name = 3;
29+
30+
// Category identifying the type of the communication component.
31+
CommunicationComponentCategory category = 4;
32+
33+
// List of IP addresses assigned to this communication component.
34+
repeated string ip_addresses = 5;
35+
}
36+
37+
// CommunicationComponentCategory enumerates possible types of communication
38+
// components within the microgrid.
39+
//
40+
// Categories help distinguish communication devices according to their roles,
41+
// capabilities, and protocols they handle within the microgrid infrastructure.
42+
enum CommunicationComponentCategory {
43+
// Unspecified communication component category.
44+
//
45+
// !!! caution
46+
// This default value should never be used explicitly and indicates that
47+
// the category has not been properly defined.
48+
COMMUNICATION_COMPONENT_CATEGORY_UNSPECIFIED = 0;
49+
50+
// Modbus Gateway used for protocol translation and managing Modbus
51+
// communication.
52+
COMMUNICATION_COMPONENT_CATEGORY_MODBUS_GATEWAY = 1;
53+
54+
// LTE Router providing cellular connectivity (LTE, 4G, 5G) for the microgrid.
55+
COMMUNICATION_COMPONENT_CATEGORY_ROUTER = 2;
56+
57+
// Ethernet Switch enabling wired network connections within the microgrid.
58+
COMMUNICATION_COMPONENT_CATEGORY_ETHERNET_SWITCH = 3;
59+
60+
// Digital Input/Output (DIO) Gateway enabling communication and control
61+
// of digital signals between microgrid devices.
62+
COMMUNICATION_COMPONENT_CATEGORY_DIO_GATEWAY = 4;
63+
64+
// Programmable Logic Controller (PLC) used for automation tasks,
65+
// process control, and operational logic in the microgrid.
66+
COMMUNICATION_COMPONENT_CATEGORY_PLC = 5;
67+
68+
// Serial Gateway (RS-232, RS-485, etc.) facilitating serial communication
69+
// between legacy equipment and modern network infrastructures.
70+
COMMUNICATION_COMPONENT_CATEGORY_SERIAL_GATEWAY = 6;
71+
}

pytests/test_common.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,14 @@ def test_module_import_microgrid_components() -> None:
181181
assert transformer_pb2_grpc is not None
182182

183183

184+
def test_module_import_microgrid_communication_components() -> None:
185+
"""Test that the modules can be imported."""
186+
# pylint: disable=import-outside-toplevel
187+
from frequenz.api.common.v1.microgrid import communication_components
188+
189+
assert communication_components is not None
190+
191+
184192
def test_module_import_location() -> None:
185193
"""Test that the modules can be imported."""
186194
# pylint: disable=import-outside-toplevel

0 commit comments

Comments
 (0)