-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ec8005
commit 07cbb7b
Showing
9 changed files
with
75 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
## 2.3.0 | ||
|
||
- Deprecate `generated.dart` in favor of `protobuf.dart` | ||
|
||
## SKIP A FEW | ||
|
||
## 1.0.0 | ||
|
||
- Initial version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export "src/utils.dart"; | ||
export "service.dart"; | ||
|
||
export "generated.dart"; | ||
export "protobuf.dart"; | ||
export "logging.dart"; | ||
export "udp.dart"; | ||
export "serial.dart"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,4 @@ | ||
/// This library exports the generated Protobuf classes. | ||
/// | ||
/// Nothing in this library is hand-written. See our [Protobuf repository](https://github.com/BinghamtonRover/Protobuf) for more details. | ||
@Deprecated("Use package:burt_network/protobuf instead") | ||
library; | ||
|
||
export "src/generated/arm.pb.dart"; | ||
export "src/generated/base_station.pb.dart"; | ||
export "src/generated/autonomy.pb.dart"; | ||
export "src/generated/core.pb.dart"; | ||
export "src/generated/drive.pb.dart"; | ||
export "src/generated/gps.pb.dart"; | ||
export "src/generated/logs.pb.dart"; | ||
export "src/generated/motor.pb.dart"; | ||
export "src/generated/status.pb.dart"; | ||
export "src/generated/science.pb.dart"; | ||
export "src/generated/utils.pb.dart"; | ||
export "src/generated/version.pb.dart"; | ||
export "src/generated/video.pb.dart"; | ||
export "src/generated/wrapper.pb.dart"; | ||
|
||
export "src/generated/google/protobuf/timestamp.pb.dart"; | ||
|
||
import "package:protobuf/protobuf.dart" as proto; | ||
|
||
import "src/generated/wrapper.pb.dart"; | ||
import "src/generated/google/protobuf/timestamp.pb.dart"; | ||
|
||
/// A cleaner name for any message generated by Protobuf. | ||
typedef Message = proto.GeneratedMessage; | ||
|
||
/// Defines a friendlier method for getting the name of a message. | ||
extension MessageUtils on Message { | ||
/// The name of the message as declared in the .proto file. | ||
String get messageName => info_.messageName; | ||
|
||
/// Returns a [WrappedMessage] representing this message with a timestamp | ||
WrappedMessage wrap([DateTime? timestamp]) => WrappedMessage( | ||
data: writeToBuffer(), | ||
name: messageName, | ||
timestamp: Timestamp.fromDateTime(timestamp ?? DateTime.now()), | ||
); | ||
} | ||
|
||
/// Helpful methods on lists of Protobuf enums. | ||
extension EnumUtils<T extends proto.ProtobufEnum> on List<T> { | ||
/// Filters out the `UNDEFINED` value. | ||
List<T> get filtered => [ | ||
for (final value in this) | ||
if (value.value != 0) | ||
value, | ||
]; | ||
|
||
/// A list of all the enum value names. | ||
List<String> get names => [ | ||
for (final value in filtered) | ||
value.name, | ||
]; | ||
} | ||
export "protobuf.dart"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/// This library exports the generated Protobuf classes. | ||
/// | ||
/// Nothing in this library is hand-written. See our [Protobuf repository](https://github.com/BinghamtonRover/Protobuf) for more details. | ||
library; | ||
|
||
export "src/generated/arm.pb.dart"; | ||
export "src/generated/base_station.pb.dart"; | ||
export "src/generated/autonomy.pb.dart"; | ||
export "src/generated/core.pb.dart"; | ||
export "src/generated/drive.pb.dart"; | ||
export "src/generated/gps.pb.dart"; | ||
export "src/generated/logs.pb.dart"; | ||
export "src/generated/motor.pb.dart"; | ||
export "src/generated/status.pb.dart"; | ||
export "src/generated/science.pb.dart"; | ||
export "src/generated/utils.pb.dart"; | ||
export "src/generated/version.pb.dart"; | ||
export "src/generated/video.pb.dart"; | ||
export "src/generated/wrapper.pb.dart"; | ||
|
||
export "src/utils.dart"; | ||
|
||
export "src/generated/google/protobuf/timestamp.pb.dart"; | ||
|
||
import "package:protobuf/protobuf.dart" as proto; | ||
|
||
import "src/generated/wrapper.pb.dart"; | ||
import "src/generated/google/protobuf/timestamp.pb.dart"; | ||
|
||
/// A cleaner name for any message generated by Protobuf. | ||
typedef Message = proto.GeneratedMessage; | ||
|
||
/// Defines a friendlier method for getting the name of a message. | ||
extension MessageUtils on Message { | ||
/// The name of the message as declared in the .proto file. | ||
String get messageName => info_.messageName; | ||
|
||
/// Returns a [WrappedMessage] representing this message with a timestamp | ||
WrappedMessage wrap([DateTime? timestamp]) => WrappedMessage( | ||
data: writeToBuffer(), | ||
name: messageName, | ||
timestamp: Timestamp.fromDateTime(timestamp ?? DateTime.now()), | ||
); | ||
} | ||
|
||
/// Helpful methods on lists of Protobuf enums. | ||
extension EnumUtils<T extends proto.ProtobufEnum> on List<T> { | ||
/// Filters out the `UNDEFINED` value. | ||
List<T> get filtered => [ | ||
for (final value in this) | ||
if (value.value != 0) | ||
value, | ||
]; | ||
|
||
/// A list of all the enum value names. | ||
List<String> get names => [ | ||
for (final value in filtered) | ||
value.name, | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters