Innovenergy_trunk/csharp/Lib/Protocols/DBus/DBusConnection.cs

55 lines
1.4 KiB
C#

using InnovEnergy.Lib.Protocols.DBus.Daemon;
using InnovEnergy.Lib.Protocols.DBus.Protocol;
using InnovEnergy.Lib.Protocols.DBus.Protocol.DataTypes;
namespace InnovEnergy.Lib.Protocols.DBus;
public class DBusConnection : DBusDaemonConnection
{
public DBusConnection(Bus bus): base(bus)
{
}
public Task<T> CallMethod<T>(String? destination = default,
String? @interface = default,
ObjectPath? objectPath = default,
String? member = default,
Object? payload = default)
{
var msg = Message.MethodCall
(
member: member,
payload: payload,
objectPath: objectPath,
@interface: @interface,
destination: destination,
replyExpected: true
);
return CallMethod<T>(msg);
}
public void BroadcastSignal(String? @interface = default,
ObjectPath? objectPath = default,
String? member = default,
Object? payload = default)
{
var msg = Message.Signal
(
member: member,
payload: payload,
objectPath: objectPath,
@interface: @interface
);
OutgoingMessages.OnNext(msg);
}
}