Skip to content

Commit

Permalink
Science protobuf v1.0.0 (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Lesches authored May 13, 2024
1 parent 94ac8e2 commit 943ba6b
Show file tree
Hide file tree
Showing 7 changed files with 230 additions and 284 deletions.
2 changes: 1 addition & 1 deletion Protobuf
Submodule Protobuf updated 1 files
+44 −32 science.proto
2 changes: 1 addition & 1 deletion example/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void main() async {
final client = BasicServer(port: 8000, device: Device.DASHBOARD);
await client.init();
client.destination = destination;
final message = ScienceData(methane: 1, co2: 2);
final message = ScienceData(temperature: 1, co2: 2);
while (true) {
client.sendMessage(message);
await Future<void>.delayed(const Duration(seconds: 1));
Expand Down
2 changes: 1 addition & 1 deletion example/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class BasicServer extends ProtoSocket {
@override
void onWrapper(WrappedMessage wrapper, SocketInfo source) {
final message = ScienceData.fromBuffer(wrapper.data);
logger.info("Received ${wrapper.name} message: ${message.co2} & ${message.methane}");
logger.info("Received ${wrapper.name} message: ${message.toProto3Json()}");
}
}

Expand Down
Loading

0 comments on commit 943ba6b

Please sign in to comment.