Implement demo of DER comms

This commit is contained in:
2025-02-25 22:01:38 +00:00
parent f5cb3b7166
commit 727c0aedd6
8 changed files with 119 additions and 41 deletions

View File

@@ -14,7 +14,9 @@ namespace StudySystemClient {
this.connection = connection;
connection.received.connect((msg) => {
response_label.label = "Response: " + (string)msg;
var der = Der.decode(msg) as Der.Choice;
var str = der.value as Der.Utf8String;
response_label.label = "Response: " + str.value;
});
var box = new Gtk.Box(Gtk.Orientation.VERTICAL, 10);
@@ -24,7 +26,10 @@ namespace StudySystemClient {
box.margin_bottom = 10;
send_button = new Gtk.Button.with_label("Send");
send_button.clicked.connect(() => connection.send("Foo".data));
send_button.clicked.connect(() => {
var msg = new Der.Choice(0, new Der.Null());
connection.send(msg.encode());
});
box.append(send_button);
response_label = new Gtk.Label("");