Innovenergy_trunk/csharp/lib/Protocols/DBus/Daemon/DBusDaemonApi.cs

26 lines
826 B
C#
Raw Normal View History

2023-02-16 12:57:06 +00:00
using InnovEnergy.Lib.Protocols.DBus.Protocol;
using InnovEnergy.Lib.Protocols.DBus.Protocol.DataTypes;
using InnovEnergy.Lib.Protocols.DBus.Protocol.Header;
namespace InnovEnergy.Lib.Protocols.DBus.Daemon;
public static class DBusDaemonApi
{
public const String ServiceName = "org.freedesktop.DBus";
public const String Interface = ServiceName;
public static ObjectPath ObjectPath => "/org/freedesktop/DBus";
public static Boolean IsDaemonSignal(Message m)
{
return m is
{
Type: MessageType.Signal,
Sender: ServiceName,
Interface: Interface
};
}
public static Boolean IsBusName(this String? n) => !IsBusId(n);
public static Boolean IsBusId (this String? n) => n != null && (n.StartsWith(":") || n == ServiceName);
}