MCPcopy Create free account
hub / github.com/godbus/dbus / createCall

Method createCall

object.go:101–126  ·  view source on GitHub ↗
(ctx context.Context, method string, flags Flags, ch chan *Call, args ...any)

Source from the content-addressed store, hash-verified

99}
100
101func (o *Object) createCall(ctx context.Context, method string, flags Flags, ch chan *Call, args ...any) *Call {
102 if ctx == nil {
103 panic("nil context")
104 }
105 iface := ""
106 i := strings.LastIndex(method, ".")
107 if i != -1 {
108 iface = method[:i]
109 }
110 method = method[i+1:]
111 msg := new(Message)
112 msg.Type = TypeMethodCall
113 msg.Flags = flags & (FlagNoAutoStart | FlagNoReplyExpected)
114 msg.Headers = make(map[HeaderField]Variant)
115 msg.Headers[FieldPath] = MakeVariant(o.path)
116 msg.Headers[FieldDestination] = MakeVariant(o.dest)
117 msg.Headers[FieldMember] = MakeVariant(method)
118 if iface != "" {
119 msg.Headers[FieldInterface] = MakeVariant(iface)
120 }
121 msg.Body = args
122 if len(args) > 0 {
123 msg.Headers[FieldSignature] = MakeVariant(SignatureOf(args...))
124 }
125 return o.conn.SendWithContext(ctx, msg, ch)
126}
127
128// GetProperty calls org.freedesktop.DBus.Properties.Get on the given
129// object. The property name must be given in interface.member notation.

Callers 4

CallMethod · 0.95
CallWithContextMethod · 0.95
GoMethod · 0.95
GoWithContextMethod · 0.95

Calls 3

MakeVariantFunction · 0.85
SignatureOfFunction · 0.85
SendWithContextMethod · 0.80

Tested by

no test coverage detected