private void handleNameAcquired(global::Dbus.MessageHeader header, byte[] body) { assertSignature(header.BodySignature, "s"); var decoderIndex = 0; var decoded0 = global::Dbus.Decoder.GetString(body, ref decoderIndex); NameAcquired?.Invoke(decoded0); }
private void handleSeeked(global::Dbus.MessageHeader header, byte[] body) { assertSignature(header.BodySignature, "x"); var decoderIndex = 0; var decoded0 = global::Dbus.Decoder.GetInt64(body, ref decoderIndex); Seeked?.Invoke(decoded0); }
private void handleInterfacesRemoved(global::Dbus.MessageHeader header, byte[] body) { assertSignature(header.BodySignature, "oas"); var decoderIndex = 0; var decoded0 = global::Dbus.Decoder.GetObjectPath(body, ref decoderIndex); var decoded1 = global::Dbus.Decoder.GetArray(body, ref decoderIndex, global::Dbus.Decoder.GetString); InterfacesRemoved?.Invoke(decoded0, decoded1); }
private void handleProperties(global::Dbus.MessageHeader header, byte[] body) { assertSignature(header.BodySignature, "sa{sv}as"); var index = 0; var interfaceName = global::Dbus.Decoder.GetString(body, ref index); var changed = global::Dbus.Decoder.GetDictionary(body, ref index, global::Dbus.Decoder.GetString, global::Dbus.Decoder.GetObject); //var invalidated = global::Dbus.Decoder.GetArray(body, ref index, global::Dbus.Decoder.GetString); applyProperties(changed); }
private void handleInterfacesAdded(global::Dbus.MessageHeader header, byte[] body) { assertSignature(header.BodySignature, "oa{sa{sv}}"); var decoderIndex = 0; var decoded0 = global::Dbus.Decoder.GetObjectPath(body, ref decoderIndex); var decoded1 = global::Dbus.Decoder.GetDictionary(body, ref decoderIndex, global::Dbus.Decoder.GetString, (byte[] decoded1_v_b, ref int decoded1_v_i) => { var decoded1_v_inner = global::Dbus.Decoder.GetDictionary(decoded1_v_b, ref decoded1_v_i, global::Dbus.Decoder.GetString, global::Dbus.Decoder.GetObject); return(decoded1_v_inner); }); InterfacesAdded?.Invoke(decoded0, decoded1); }
public System.Threading.Tasks.Task HandleMethodCallAsync(uint replySerial, global::Dbus.MessageHeader header, byte[] body, bool shouldSendReply) { switch (header.Member) { case "Release": return(handleReleaseAsync(replySerial, header, body, shouldSendReply)); default: throw new global::Dbus.DbusException( global::Dbus.DbusException.CreateErrorName("UnknownMethod"), "Method not supported" ); } }
private System.Threading.Tasks.Task handleMethodCall(uint replySerial, global::Dbus.MessageHeader header, byte[] body) { switch (header.Member) { case "MyComplexMethod": return(handleMyComplexMethodAsync(replySerial, header, body)); case "MyEcho": return(handleMyEchoAsync(replySerial, header, body)); case "MyVoid": return(handleMyVoidAsync(replySerial, header, body)); default: throw new global::Dbus.DbusException( global::Dbus.DbusException.CreateErrorName("UnknownMethod"), "Method not supported" ); } }
private async System.Threading.Tasks.Task handleMyVoidAsync(uint replySerial, global::Dbus.MessageHeader header, byte[] receivedBody) { assertSignature(header.BodySignature, ""); await target.MyVoidAsync(); var sendBody = global::Dbus.Encoder.StartNew(); await connection.SendMethodReturnAsync(replySerial, header.Sender, sendBody, ""); }
private async System.Threading.Tasks.Task handleMyEchoAsync(uint replySerial, global::Dbus.MessageHeader header, byte[] receivedBody) { assertSignature(header.BodySignature, "s"); var decoderIndex = 0; var message = global::Dbus.Decoder.GetString(receivedBody, ref decoderIndex); var result = await target.MyEchoAsync(message); var sendBody = global::Dbus.Encoder.StartNew(); var sendIndex = 0; global::Dbus.Encoder.Add(sendBody, ref sendIndex, result); await connection.SendMethodReturnAsync(replySerial, header.Sender, sendBody, "s"); }
private async System.Threading.Tasks.Task handleMyComplexMethodAsync(uint replySerial, global::Dbus.MessageHeader header, byte[] receivedBody) { assertSignature(header.BodySignature, "sii"); var decoderIndex = 0; var p1 = global::Dbus.Decoder.GetString(receivedBody, ref decoderIndex); var p2 = global::Dbus.Decoder.GetInt32(receivedBody, ref decoderIndex); var p3 = global::Dbus.Decoder.GetInt32(receivedBody, ref decoderIndex); var result = await target.MyComplexMethodAsync(p1, p2, p3); var sendBody = global::Dbus.Encoder.StartNew(); var sendIndex = 0; global::Dbus.Encoder.Add(sendBody, ref sendIndex, result.Item1); global::Dbus.Encoder.Add(sendBody, ref sendIndex, result.Item2); await connection.SendMethodReturnAsync(replySerial, header.Sender, sendBody, "si"); }
private async System.Threading.Tasks.Task handleReleaseAsync(uint replySerial, global::Dbus.MessageHeader header, byte[] receivedBody, bool shouldSendReply) { header.BodySignature.AssertEqual(""); await target.ReleaseAsync().ConfigureAwait(false); if (!shouldSendReply) { return; } var sendBody = global::Dbus.Encoder.StartNew(); await connection.SendMethodReturnAsync(replySerial, header.Sender, sendBody, "").ConfigureAwait(false); }