Skip to content

Commit cec9cf7

Browse files
Add communication component diagnostic message (#315)
2 parents 33ae915 + 7eee221 commit cec9cf7

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- The enum `SensorErrorCode` has now been renamed to `SensorDiagnosticCode` to better reflect its shared usage with warnings and errors.
2020
- Added warnings to sensor `SensorState`.
2121
- Added a common `TimeIntervalFilter` message in `frequenz.api.common.v1.types` to standardize time interval filtering across APIs. This uses `start_time` (inclusive) and `end_time` (exclusive) fields, aligning with ISO 8601 and common programming conventions.
22+
- Added new message `CommunicationComponentDiagnostic` to represent warnings and errors in microgrid communication components.
2223

2324
## Bug Fixes
2425

proto/frequenz/api/common/v1/microgrid/communication_components/communication_components.proto

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// protolint:disable MAX_LINE_LENGTH
2+
13
// Frequenz microgrid communication components definitions.
24
//
35
// Copyright:
@@ -10,6 +12,60 @@ syntax = "proto3";
1012

1113
package frequenz.api.common.v1.microgrid.communication_components;
1214

15+
// Enumerated diagnostic codes for communication components.
16+
//
17+
// These codes indicate common network- or device-level faults that may affect
18+
// connectivity.
19+
enum CommunicationComponentDiagnosticCode {
20+
// Default value; no specific diagnostic is specified.
21+
COMMUNICATION_COMPONENT_DIAGNOSTIC_CODE_UNSPECIFIED = 0;
22+
23+
// Component is unreachable (e.g., no heartbeat from device, network down).
24+
COMMUNICATION_COMPONENT_DIAGNOSTIC_CODE_UNREACHABLE = 1;
25+
26+
// Configuration error detected (e.g., invalid VLAN, IP conflict).
27+
COMMUNICATION_COMPONENT_DIAGNOSTIC_CODE_CONFIGURATION_ERR = 2;
28+
29+
// High packet loss detected over a sustained period.
30+
COMMUNICATION_COMPONENT_DIAGNOSTIC_CODE_PACKET_LOSS = 3;
31+
32+
// Excessive latency observed (e.g., ping time above threshold).
33+
COMMUNICATION_COMPONENT_DIAGNOSTIC_CODE_HIGH_LATENCY = 4;
34+
35+
// Hardware fault reported by device (e.g., port error, cable disconnected).
36+
COMMUNICATION_COMPONENT_DIAGNOSTIC_CODE_HARDWARE_FAULT = 5;
37+
}
38+
39+
// Represents an error or warning condition reported by a microgrid
40+
// communication component.
41+
//
42+
// This message extends a standardized diagnostic code with optional
43+
// vendor-specific codes and contextual information for troubleshooting.
44+
//
45+
// !!! example "Typical Communication Component Warning"
46+
// ```json
47+
// {
48+
// "diagnosticCode": "COMMUNICATION_COMPONENT_DIAGNOSTIC_CODE_CONFIGURATION_ERR",
49+
// "vendorErrorCode": 1002,
50+
// "message": "VLAN mismatch detected on port 3"
51+
// }
52+
// ```
53+
//
54+
// !!! note "Vendor-Specific Codes"
55+
// When available, `vendor_error_code` reflects manufacturer-defined error
56+
// identifiers.
57+
// These codes are vendor- and firmware-specific and must be interpreted
58+
// using the vendor's official documentation.
59+
message CommunicationComponentDiagnostic {
60+
// A standardized diagnostic code representing the category of the issue.
61+
CommunicationComponentDiagnosticCode diagnostic_code = 1;
62+
63+
// Optional vendor-provided error code for more granular diagnostics.
64+
optional uint32 vendor_error_code = 2;
65+
66+
// Human-readable message providing additional context.
67+
string message = 3;
68+
}
1369

1470
// `CommunicationComponent` represents a communication component within a
1571
// microgrid.

0 commit comments

Comments
 (0)