Updated comments and fixed tabbing
[profile/ivi/automotive-message-broker.git] / plugins / common / bluetoothserialproxy.c
1 /*
2  * Generated by gdbus-codegen 2.32.1. DO NOT EDIT.
3  *
4  * The license of this code is the same as for the source it was derived from.
5  */
6
7 #ifdef HAVE_CONFIG_H
8 #  include "config.h"
9 #endif
10
11 #include "bluetoothserialproxy.h"
12
13 #ifdef G_OS_UNIX
14 #  include <gio/gunixfdlist.h>
15 #endif
16
17 typedef struct
18 {
19   GDBusArgInfo parent_struct;
20   gboolean use_gvariant;
21 } _ExtendedGDBusArgInfo;
22
23 typedef struct
24 {
25   GDBusMethodInfo parent_struct;
26   const gchar *signal_name;
27   gboolean pass_fdlist;
28 } _ExtendedGDBusMethodInfo;
29
30 typedef struct
31 {
32   GDBusSignalInfo parent_struct;
33   const gchar *signal_name;
34 } _ExtendedGDBusSignalInfo;
35
36 typedef struct
37 {
38   GDBusPropertyInfo parent_struct;
39   const gchar *hyphen_name;
40   gboolean use_gvariant;
41 } _ExtendedGDBusPropertyInfo;
42
43 typedef struct
44 {
45   GDBusInterfaceInfo parent_struct;
46   const gchar *hyphen_name;
47 } _ExtendedGDBusInterfaceInfo;
48
49 typedef struct
50 {
51   const _ExtendedGDBusPropertyInfo *info;
52   guint prop_id;
53   GValue orig_value; /* the value before the change */
54 } ChangedProperty;
55
56 static void
57 _changed_property_free (ChangedProperty *data)
58 {
59   g_value_unset (&data->orig_value);
60   g_free (data);
61 }
62
63 static gboolean
64 _g_strv_equal0 (gchar **a, gchar **b)
65 {
66   gboolean ret = FALSE;
67   guint n;
68   if (a == NULL && b == NULL)
69     {
70       ret = TRUE;
71       goto out;
72     }
73   if (a == NULL || b == NULL)
74     goto out;
75   if (g_strv_length (a) != g_strv_length (b))
76     goto out;
77   for (n = 0; a[n] != NULL; n++)
78     if (g_strcmp0 (a[n], b[n]) != 0)
79       goto out;
80   ret = TRUE;
81 out:
82   return ret;
83 }
84
85 static gboolean
86 _g_variant_equal0 (GVariant *a, GVariant *b)
87 {
88   gboolean ret = FALSE;
89   if (a == NULL && b == NULL)
90     {
91       ret = TRUE;
92       goto out;
93     }
94   if (a == NULL || b == NULL)
95     goto out;
96   ret = g_variant_equal (a, b);
97 out:
98   return ret;
99 }
100
101 G_GNUC_UNUSED static gboolean
102 _g_value_equal (const GValue *a, const GValue *b)
103 {
104   gboolean ret = FALSE;
105   g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
106   switch (G_VALUE_TYPE (a))
107     {
108       case G_TYPE_BOOLEAN:
109         ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
110         break;
111       case G_TYPE_UCHAR:
112         ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
113         break;
114       case G_TYPE_INT:
115         ret = (g_value_get_int (a) == g_value_get_int (b));
116         break;
117       case G_TYPE_UINT:
118         ret = (g_value_get_uint (a) == g_value_get_uint (b));
119         break;
120       case G_TYPE_INT64:
121         ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
122         break;
123       case G_TYPE_UINT64:
124         ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
125         break;
126       case G_TYPE_DOUBLE:
127         ret = (g_value_get_double (a) == g_value_get_double (b));
128         break;
129       case G_TYPE_STRING:
130         ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
131         break;
132       case G_TYPE_VARIANT:
133         ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
134         break;
135       default:
136         if (G_VALUE_TYPE (a) == G_TYPE_STRV)
137           ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
138         else
139           g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
140         break;
141     }
142   return ret;
143 }
144
145 /* ------------------------------------------------------------------------
146  * Code for interface org.bluez.Serial
147  * ------------------------------------------------------------------------
148  */
149
150 /**
151  * SECTION:OrgBluezSerial
152  * @title: OrgBluezSerial
153  * @short_description: Generated C code for the org.bluez.Serial D-Bus interface
154  *
155  * This section contains code for working with the <link linkend="gdbus-interface-org-bluez-Serial.top_of_page">org.bluez.Serial</link> D-Bus interface in C.
156  */
157
158 /* ---- Introspection data for org.bluez.Serial ---- */
159
160 static const _ExtendedGDBusArgInfo _org_bluez_serial_method_info_connect_IN_ARG_unnamed_arg0 =
161 {
162   {
163     -1,
164     "unnamed_arg0",
165     "s",
166     NULL
167   },
168   FALSE
169 };
170
171 static const _ExtendedGDBusArgInfo * const _org_bluez_serial_method_info_connect_IN_ARG_pointers[] =
172 {
173   &_org_bluez_serial_method_info_connect_IN_ARG_unnamed_arg0,
174   NULL
175 };
176
177 static const _ExtendedGDBusArgInfo _org_bluez_serial_method_info_connect_OUT_ARG_unnamed_arg1 =
178 {
179   {
180     -1,
181     "unnamed_arg1",
182     "s",
183     NULL
184   },
185   FALSE
186 };
187
188 static const _ExtendedGDBusArgInfo * const _org_bluez_serial_method_info_connect_OUT_ARG_pointers[] =
189 {
190   &_org_bluez_serial_method_info_connect_OUT_ARG_unnamed_arg1,
191   NULL
192 };
193
194 static const _ExtendedGDBusMethodInfo _org_bluez_serial_method_info_connect =
195 {
196   {
197     -1,
198     "Connect",
199     (GDBusArgInfo **) &_org_bluez_serial_method_info_connect_IN_ARG_pointers,
200     (GDBusArgInfo **) &_org_bluez_serial_method_info_connect_OUT_ARG_pointers,
201     NULL
202   },
203   "handle-connect",
204   FALSE
205 };
206
207 static const _ExtendedGDBusArgInfo _org_bluez_serial_method_info_connect_fd_IN_ARG_unnamed_arg0 =
208 {
209   {
210     -1,
211     "unnamed_arg0",
212     "s",
213     NULL
214   },
215   FALSE
216 };
217
218 static const _ExtendedGDBusArgInfo * const _org_bluez_serial_method_info_connect_fd_IN_ARG_pointers[] =
219 {
220   &_org_bluez_serial_method_info_connect_fd_IN_ARG_unnamed_arg0,
221   NULL
222 };
223
224 static const _ExtendedGDBusArgInfo _org_bluez_serial_method_info_connect_fd_OUT_ARG_unnamed_arg1 =
225 {
226   {
227     -1,
228     "unnamed_arg1",
229     "h",
230     NULL
231   },
232   FALSE
233 };
234
235 static const _ExtendedGDBusArgInfo * const _org_bluez_serial_method_info_connect_fd_OUT_ARG_pointers[] =
236 {
237   &_org_bluez_serial_method_info_connect_fd_OUT_ARG_unnamed_arg1,
238   NULL
239 };
240
241 static const _ExtendedGDBusMethodInfo _org_bluez_serial_method_info_connect_fd =
242 {
243   {
244     -1,
245     "ConnectFD",
246     (GDBusArgInfo **) &_org_bluez_serial_method_info_connect_fd_IN_ARG_pointers,
247     (GDBusArgInfo **) &_org_bluez_serial_method_info_connect_fd_OUT_ARG_pointers,
248     NULL
249   },
250   "handle-connect-fd",
251   FALSE
252 };
253
254 static const _ExtendedGDBusArgInfo _org_bluez_serial_method_info_disconnect_IN_ARG_unnamed_arg0 =
255 {
256   {
257     -1,
258     "unnamed_arg0",
259     "s",
260     NULL
261   },
262   FALSE
263 };
264
265 static const _ExtendedGDBusArgInfo * const _org_bluez_serial_method_info_disconnect_IN_ARG_pointers[] =
266 {
267   &_org_bluez_serial_method_info_disconnect_IN_ARG_unnamed_arg0,
268   NULL
269 };
270
271 static const _ExtendedGDBusMethodInfo _org_bluez_serial_method_info_disconnect =
272 {
273   {
274     -1,
275     "Disconnect",
276     (GDBusArgInfo **) &_org_bluez_serial_method_info_disconnect_IN_ARG_pointers,
277     NULL,
278     NULL
279   },
280   "handle-disconnect",
281   FALSE
282 };
283
284 static const _ExtendedGDBusMethodInfo * const _org_bluez_serial_method_info_pointers[] =
285 {
286   &_org_bluez_serial_method_info_connect,
287   &_org_bluez_serial_method_info_connect_fd,
288   &_org_bluez_serial_method_info_disconnect,
289   NULL
290 };
291
292 static const _ExtendedGDBusInterfaceInfo _org_bluez_serial_interface_info =
293 {
294   {
295     -1,
296     "org.bluez.Serial",
297     (GDBusMethodInfo **) &_org_bluez_serial_method_info_pointers,
298     NULL,
299     NULL,
300     NULL
301   },
302   "org-bluez-serial",
303 };
304
305
306 /**
307  * org_bluez_serial_interface_info:
308  *
309  * Gets a machine-readable description of the <link linkend="gdbus-interface-org-bluez-Serial.top_of_page">org.bluez.Serial</link> D-Bus interface.
310  *
311  * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
312  */
313 GDBusInterfaceInfo *
314 org_bluez_serial_interface_info (void)
315 {
316   return (GDBusInterfaceInfo *) &_org_bluez_serial_interface_info;
317 }
318
319 /**
320  * org_bluez_serial_override_properties:
321  * @klass: The class structure for a #GObject<!-- -->-derived class.
322  * @property_id_begin: The property id to assign to the first overridden property.
323  *
324  * Overrides all #GObject properties in the #OrgBluezSerial interface for a concrete class.
325  * The properties are overridden in the order they are defined.
326  *
327  * Returns: The last property id.
328  */
329 guint
330 org_bluez_serial_override_properties (GObjectClass *klass, guint property_id_begin)
331 {
332   return property_id_begin - 1;
333 }
334
335
336
337 /**
338  * OrgBluezSerial:
339  *
340  * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-bluez-Serial.top_of_page">org.bluez.Serial</link>.
341  */
342
343 /**
344  * OrgBluezSerialIface:
345  * @parent_iface: The parent interface.
346  * @handle_connect: Handler for the #OrgBluezSerial::handle-connect signal.
347  * @handle_connect_fd: Handler for the #OrgBluezSerial::handle-connect-fd signal.
348  * @handle_disconnect: Handler for the #OrgBluezSerial::handle-disconnect signal.
349  *
350  * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-bluez-Serial.top_of_page">org.bluez.Serial</link>.
351  */
352
353 static void
354 org_bluez_serial_default_init (OrgBluezSerialIface *iface)
355 {
356   /* GObject signals for incoming D-Bus method calls: */
357   /**
358    * OrgBluezSerial::handle-connect:
359    * @object: A #OrgBluezSerial.
360    * @invocation: A #GDBusMethodInvocation.
361    * @arg_unnamed_arg0: Argument passed by remote caller.
362    *
363    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-Serial.Connect">Connect()</link> D-Bus method.
364    *
365    * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_serial_complete_connect() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
366    *
367    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
368    */
369   g_signal_new ("handle-connect",
370     G_TYPE_FROM_INTERFACE (iface),
371     G_SIGNAL_RUN_LAST,
372     G_STRUCT_OFFSET (OrgBluezSerialIface, handle_connect),
373     g_signal_accumulator_true_handled,
374     NULL,
375     g_cclosure_marshal_generic,
376     G_TYPE_BOOLEAN,
377     2,
378     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
379
380   /**
381    * OrgBluezSerial::handle-connect-fd:
382    * @object: A #OrgBluezSerial.
383    * @invocation: A #GDBusMethodInvocation.
384    * @arg_unnamed_arg0: Argument passed by remote caller.
385    *
386    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-Serial.ConnectFD">ConnectFD()</link> D-Bus method.
387    *
388    * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_serial_complete_connect_fd() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
389    *
390    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
391    */
392   g_signal_new ("handle-connect-fd",
393     G_TYPE_FROM_INTERFACE (iface),
394     G_SIGNAL_RUN_LAST,
395     G_STRUCT_OFFSET (OrgBluezSerialIface, handle_connect_fd),
396     g_signal_accumulator_true_handled,
397     NULL,
398     g_cclosure_marshal_generic,
399     G_TYPE_BOOLEAN,
400     2,
401     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
402
403   /**
404    * OrgBluezSerial::handle-disconnect:
405    * @object: A #OrgBluezSerial.
406    * @invocation: A #GDBusMethodInvocation.
407    * @arg_unnamed_arg0: Argument passed by remote caller.
408    *
409    * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-bluez-Serial.Disconnect">Disconnect()</link> D-Bus method.
410    *
411    * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call org_bluez_serial_complete_disconnect() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
412    *
413    * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
414    */
415   g_signal_new ("handle-disconnect",
416     G_TYPE_FROM_INTERFACE (iface),
417     G_SIGNAL_RUN_LAST,
418     G_STRUCT_OFFSET (OrgBluezSerialIface, handle_disconnect),
419     g_signal_accumulator_true_handled,
420     NULL,
421     g_cclosure_marshal_generic,
422     G_TYPE_BOOLEAN,
423     2,
424     G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);
425
426 }
427
428 typedef OrgBluezSerialIface OrgBluezSerialInterface;
429 G_DEFINE_INTERFACE (OrgBluezSerial, org_bluez_serial, G_TYPE_OBJECT);
430
431 /**
432  * org_bluez_serial_call_connect:
433  * @proxy: A #OrgBluezSerialProxy.
434  * @arg_unnamed_arg0: Argument to pass with the method invocation.
435  * @cancellable: (allow-none): A #GCancellable or %NULL.
436  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
437  * @user_data: User data to pass to @callback.
438  *
439  * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-Serial.Connect">Connect()</link> D-Bus method on @proxy.
440  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
441  * You can then call org_bluez_serial_call_connect_finish() to get the result of the operation.
442  *
443  * See org_bluez_serial_call_connect_sync() for the synchronous, blocking version of this method.
444  */
445 void
446 org_bluez_serial_call_connect (
447     OrgBluezSerial *proxy,
448     const gchar *arg_unnamed_arg0,
449     GCancellable *cancellable,
450     GAsyncReadyCallback callback,
451     gpointer user_data)
452 {
453   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
454     "Connect",
455     g_variant_new ("(s)",
456                    arg_unnamed_arg0),
457     G_DBUS_CALL_FLAGS_NONE,
458     -1,
459     cancellable,
460     callback,
461     user_data);
462 }
463
464 /**
465  * org_bluez_serial_call_connect_finish:
466  * @proxy: A #OrgBluezSerialProxy.
467  * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore.
468  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_serial_call_connect().
469  * @error: Return location for error or %NULL.
470  *
471  * Finishes an operation started with org_bluez_serial_call_connect().
472  *
473  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
474  */
475 gboolean
476 org_bluez_serial_call_connect_finish (
477     OrgBluezSerial *proxy,
478     gchar **out_unnamed_arg1,
479     GAsyncResult *res,
480     GError **error)
481 {
482   GVariant *_ret;
483   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
484   if (_ret == NULL)
485     goto _out;
486   g_variant_get (_ret,
487                  "(s)",
488                  out_unnamed_arg1);
489   g_variant_unref (_ret);
490 _out:
491   return _ret != NULL;
492 }
493
494 /**
495  * org_bluez_serial_call_connect_sync:
496  * @proxy: A #OrgBluezSerialProxy.
497  * @arg_unnamed_arg0: Argument to pass with the method invocation.
498  * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore.
499  * @cancellable: (allow-none): A #GCancellable or %NULL.
500  * @error: Return location for error or %NULL.
501  *
502  * Synchronously invokes the <link linkend="gdbus-method-org-bluez-Serial.Connect">Connect()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
503  *
504  * See org_bluez_serial_call_connect() for the asynchronous version of this method.
505  *
506  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
507  */
508 gboolean
509 org_bluez_serial_call_connect_sync (
510     OrgBluezSerial *proxy,
511     const gchar *arg_unnamed_arg0,
512     gchar **out_unnamed_arg1,
513     GCancellable *cancellable,
514     GError **error)
515 {
516   GVariant *_ret;
517   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
518     "Connect",
519     g_variant_new ("(s)",
520                    arg_unnamed_arg0),
521     G_DBUS_CALL_FLAGS_NONE,
522     -1,
523     cancellable,
524     error);
525   if (_ret == NULL)
526     goto _out;
527   g_variant_get (_ret,
528                  "(s)",
529                  out_unnamed_arg1);
530   g_variant_unref (_ret);
531 _out:
532   return _ret != NULL;
533 }
534
535 /**
536  * org_bluez_serial_call_connect_fd:
537  * @proxy: A #OrgBluezSerialProxy.
538  * @arg_unnamed_arg0: Argument to pass with the method invocation.
539  * @cancellable: (allow-none): A #GCancellable or %NULL.
540  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
541  * @user_data: User data to pass to @callback.
542  *
543  * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-Serial.ConnectFD">ConnectFD()</link> D-Bus method on @proxy.
544  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
545  * You can then call org_bluez_serial_call_connect_fd_finish() to get the result of the operation.
546  *
547  * See org_bluez_serial_call_connect_fd_sync() for the synchronous, blocking version of this method.
548  */
549 void
550 org_bluez_serial_call_connect_fd (
551     OrgBluezSerial *proxy,
552     const gchar *arg_unnamed_arg0,
553     GCancellable *cancellable,
554     GAsyncReadyCallback callback,
555     gpointer user_data)
556 {
557   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
558     "ConnectFD",
559     g_variant_new ("(s)",
560                    arg_unnamed_arg0),
561     G_DBUS_CALL_FLAGS_NONE,
562     -1,
563     cancellable,
564     callback,
565     user_data);
566 }
567
568 /**
569  * org_bluez_serial_call_connect_fd_finish:
570  * @proxy: A #OrgBluezSerialProxy.
571  * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore.
572  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_serial_call_connect_fd().
573  * @error: Return location for error or %NULL.
574  *
575  * Finishes an operation started with org_bluez_serial_call_connect_fd().
576  *
577  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
578  */
579 gboolean
580 org_bluez_serial_call_connect_fd_finish (
581     OrgBluezSerial *proxy,
582     GVariant **out_unnamed_arg1,
583     GAsyncResult *res,
584     GError **error)
585 {
586   GVariant *_ret;
587   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
588   if (_ret == NULL)
589     goto _out;
590   g_variant_get (_ret,
591                  "(@h)",
592                  out_unnamed_arg1);
593   g_variant_unref (_ret);
594 _out:
595   return _ret != NULL;
596 }
597
598 /**
599  * org_bluez_serial_call_connect_fd_sync:
600  * @proxy: A #OrgBluezSerialProxy.
601  * @arg_unnamed_arg0: Argument to pass with the method invocation.
602  * @out_unnamed_arg1: (out): Return location for return parameter or %NULL to ignore.
603  * @cancellable: (allow-none): A #GCancellable or %NULL.
604  * @error: Return location for error or %NULL.
605  *
606  * Synchronously invokes the <link linkend="gdbus-method-org-bluez-Serial.ConnectFD">ConnectFD()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
607  *
608  * See org_bluez_serial_call_connect_fd() for the asynchronous version of this method.
609  *
610  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
611  */
612 gboolean
613 org_bluez_serial_call_connect_fd_sync (
614     OrgBluezSerial *proxy,
615     const gchar *arg_unnamed_arg0,
616     GVariant **out_unnamed_arg1,
617     GCancellable *cancellable,
618     GError **error)
619 {
620   GVariant *_ret;
621   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
622     "ConnectFD",
623     g_variant_new ("(s)",
624                    arg_unnamed_arg0),
625     G_DBUS_CALL_FLAGS_NONE,
626     -1,
627     cancellable,
628     error);
629   if (_ret == NULL)
630     goto _out;
631   g_variant_get (_ret,
632                  "(@h)",
633                  out_unnamed_arg1);
634   g_variant_unref (_ret);
635 _out:
636   return _ret != NULL;
637 }
638
639 /**
640  * org_bluez_serial_call_disconnect:
641  * @proxy: A #OrgBluezSerialProxy.
642  * @arg_unnamed_arg0: Argument to pass with the method invocation.
643  * @cancellable: (allow-none): A #GCancellable or %NULL.
644  * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
645  * @user_data: User data to pass to @callback.
646  *
647  * Asynchronously invokes the <link linkend="gdbus-method-org-bluez-Serial.Disconnect">Disconnect()</link> D-Bus method on @proxy.
648  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
649  * You can then call org_bluez_serial_call_disconnect_finish() to get the result of the operation.
650  *
651  * See org_bluez_serial_call_disconnect_sync() for the synchronous, blocking version of this method.
652  */
653 void
654 org_bluez_serial_call_disconnect (
655     OrgBluezSerial *proxy,
656     const gchar *arg_unnamed_arg0,
657     GCancellable *cancellable,
658     GAsyncReadyCallback callback,
659     gpointer user_data)
660 {
661   g_dbus_proxy_call (G_DBUS_PROXY (proxy),
662     "Disconnect",
663     g_variant_new ("(s)",
664                    arg_unnamed_arg0),
665     G_DBUS_CALL_FLAGS_NONE,
666     -1,
667     cancellable,
668     callback,
669     user_data);
670 }
671
672 /**
673  * org_bluez_serial_call_disconnect_finish:
674  * @proxy: A #OrgBluezSerialProxy.
675  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_serial_call_disconnect().
676  * @error: Return location for error or %NULL.
677  *
678  * Finishes an operation started with org_bluez_serial_call_disconnect().
679  *
680  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
681  */
682 gboolean
683 org_bluez_serial_call_disconnect_finish (
684     OrgBluezSerial *proxy,
685     GAsyncResult *res,
686     GError **error)
687 {
688   GVariant *_ret;
689   _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
690   if (_ret == NULL)
691     goto _out;
692   g_variant_get (_ret,
693                  "()");
694   g_variant_unref (_ret);
695 _out:
696   return _ret != NULL;
697 }
698
699 /**
700  * org_bluez_serial_call_disconnect_sync:
701  * @proxy: A #OrgBluezSerialProxy.
702  * @arg_unnamed_arg0: Argument to pass with the method invocation.
703  * @cancellable: (allow-none): A #GCancellable or %NULL.
704  * @error: Return location for error or %NULL.
705  *
706  * Synchronously invokes the <link linkend="gdbus-method-org-bluez-Serial.Disconnect">Disconnect()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
707  *
708  * See org_bluez_serial_call_disconnect() for the asynchronous version of this method.
709  *
710  * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
711  */
712 gboolean
713 org_bluez_serial_call_disconnect_sync (
714     OrgBluezSerial *proxy,
715     const gchar *arg_unnamed_arg0,
716     GCancellable *cancellable,
717     GError **error)
718 {
719   GVariant *_ret;
720   _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
721     "Disconnect",
722     g_variant_new ("(s)",
723                    arg_unnamed_arg0),
724     G_DBUS_CALL_FLAGS_NONE,
725     -1,
726     cancellable,
727     error);
728   if (_ret == NULL)
729     goto _out;
730   g_variant_get (_ret,
731                  "()");
732   g_variant_unref (_ret);
733 _out:
734   return _ret != NULL;
735 }
736
737 /**
738  * org_bluez_serial_complete_connect:
739  * @object: A #OrgBluezSerial.
740  * @invocation: (transfer full): A #GDBusMethodInvocation.
741  * @unnamed_arg1: Parameter to return.
742  *
743  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-Serial.Connect">Connect()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
744  *
745  * This method will free @invocation, you cannot use it afterwards.
746  */
747 void
748 org_bluez_serial_complete_connect (
749     OrgBluezSerial *object,
750     GDBusMethodInvocation *invocation,
751     const gchar *unnamed_arg1)
752 {
753   g_dbus_method_invocation_return_value (invocation,
754     g_variant_new ("(s)",
755                    unnamed_arg1));
756 }
757
758 /**
759  * org_bluez_serial_complete_connect_fd:
760  * @object: A #OrgBluezSerial.
761  * @invocation: (transfer full): A #GDBusMethodInvocation.
762  * @unnamed_arg1: Parameter to return.
763  *
764  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-Serial.ConnectFD">ConnectFD()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
765  *
766  * This method will free @invocation, you cannot use it afterwards.
767  */
768 void
769 org_bluez_serial_complete_connect_fd (
770     OrgBluezSerial *object,
771     GDBusMethodInvocation *invocation,
772     GVariant *unnamed_arg1)
773 {
774   g_dbus_method_invocation_return_value (invocation,
775     g_variant_new ("(@h)",
776                    unnamed_arg1));
777 }
778
779 /**
780  * org_bluez_serial_complete_disconnect:
781  * @object: A #OrgBluezSerial.
782  * @invocation: (transfer full): A #GDBusMethodInvocation.
783  *
784  * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-bluez-Serial.Disconnect">Disconnect()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
785  *
786  * This method will free @invocation, you cannot use it afterwards.
787  */
788 void
789 org_bluez_serial_complete_disconnect (
790     OrgBluezSerial *object,
791     GDBusMethodInvocation *invocation)
792 {
793   g_dbus_method_invocation_return_value (invocation,
794     g_variant_new ("()"));
795 }
796
797 /* ------------------------------------------------------------------------ */
798
799 /**
800  * OrgBluezSerialProxy:
801  *
802  * The #OrgBluezSerialProxy structure contains only private data and should only be accessed using the provided API.
803  */
804
805 /**
806  * OrgBluezSerialProxyClass:
807  * @parent_class: The parent class.
808  *
809  * Class structure for #OrgBluezSerialProxy.
810  */
811
812 struct _OrgBluezSerialProxyPrivate
813 {
814   GData *qdata;
815 };
816
817 static void org_bluez_serial_proxy_iface_init (OrgBluezSerialIface *iface);
818
819 G_DEFINE_TYPE_WITH_CODE (OrgBluezSerialProxy, org_bluez_serial_proxy, G_TYPE_DBUS_PROXY,
820                          G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_SERIAL, org_bluez_serial_proxy_iface_init));
821
822 static void
823 org_bluez_serial_proxy_finalize (GObject *object)
824 {
825   OrgBluezSerialProxy *proxy = ORG_BLUEZ_SERIAL_PROXY (object);
826   g_datalist_clear (&proxy->priv->qdata);
827   G_OBJECT_CLASS (org_bluez_serial_proxy_parent_class)->finalize (object);
828 }
829
830 static void
831 org_bluez_serial_proxy_get_property (GObject      *object,
832   guint         prop_id,
833   GValue       *value,
834   GParamSpec   *pspec)
835 {
836 }
837
838 static void
839 org_bluez_serial_proxy_set_property (GObject      *object,
840   guint         prop_id,
841   const GValue *value,
842   GParamSpec   *pspec)
843 {
844 }
845
846 static void
847 org_bluez_serial_proxy_g_signal (GDBusProxy *proxy,
848   const gchar *sender_name,
849   const gchar *signal_name,
850   GVariant *parameters)
851 {
852   _ExtendedGDBusSignalInfo *info;
853   GVariantIter iter;
854   GVariant *child;
855   GValue *paramv;
856   guint num_params;
857   guint n;
858   guint signal_id;
859   info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_org_bluez_serial_interface_info, signal_name);
860   if (info == NULL)
861     return;
862   num_params = g_variant_n_children (parameters);
863   paramv = g_new0 (GValue, num_params + 1);
864   g_value_init (&paramv[0], TYPE_ORG_BLUEZ_SERIAL);
865   g_value_set_object (&paramv[0], proxy);
866   g_variant_iter_init (&iter, parameters);
867   n = 1;
868   while ((child = g_variant_iter_next_value (&iter)) != NULL)
869     {
870       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
871       if (arg_info->use_gvariant)
872         {
873           g_value_init (&paramv[n], G_TYPE_VARIANT);
874           g_value_set_variant (&paramv[n], child);
875           n++;
876         }
877       else
878         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
879       g_variant_unref (child);
880     }
881   signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_BLUEZ_SERIAL);
882   g_signal_emitv (paramv, signal_id, 0, NULL);
883   for (n = 0; n < num_params + 1; n++)
884     g_value_unset (&paramv[n]);
885   g_free (paramv);
886 }
887
888 static void
889 org_bluez_serial_proxy_g_properties_changed (GDBusProxy *_proxy,
890   GVariant *changed_properties,
891   const gchar *const *invalidated_properties)
892 {
893   OrgBluezSerialProxy *proxy = ORG_BLUEZ_SERIAL_PROXY (_proxy);
894   guint n;
895   const gchar *key;
896   GVariantIter *iter;
897   _ExtendedGDBusPropertyInfo *info;
898   g_variant_get (changed_properties, "a{sv}", &iter);
899   while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
900     {
901       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_serial_interface_info, key);
902       g_datalist_remove_data (&proxy->priv->qdata, key);
903       if (info != NULL)
904         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
905     }
906   g_variant_iter_free (iter);
907   for (n = 0; invalidated_properties[n] != NULL; n++)
908     {
909       info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_serial_interface_info, invalidated_properties[n]);
910       g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
911       if (info != NULL)
912         g_object_notify (G_OBJECT (proxy), info->hyphen_name);
913     }
914 }
915
916 static void
917 org_bluez_serial_proxy_init (OrgBluezSerialProxy *proxy)
918 {
919   proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, TYPE_ORG_BLUEZ_SERIAL_PROXY, OrgBluezSerialProxyPrivate);
920   g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), org_bluez_serial_interface_info ());
921 }
922
923 static void
924 org_bluez_serial_proxy_class_init (OrgBluezSerialProxyClass *klass)
925 {
926   GObjectClass *gobject_class;
927   GDBusProxyClass *proxy_class;
928
929   g_type_class_add_private (klass, sizeof (OrgBluezSerialProxyPrivate));
930
931   gobject_class = G_OBJECT_CLASS (klass);
932   gobject_class->finalize     = org_bluez_serial_proxy_finalize;
933   gobject_class->get_property = org_bluez_serial_proxy_get_property;
934   gobject_class->set_property = org_bluez_serial_proxy_set_property;
935
936   proxy_class = G_DBUS_PROXY_CLASS (klass);
937   proxy_class->g_signal = org_bluez_serial_proxy_g_signal;
938   proxy_class->g_properties_changed = org_bluez_serial_proxy_g_properties_changed;
939
940 }
941
942 static void
943 org_bluez_serial_proxy_iface_init (OrgBluezSerialIface *iface)
944 {
945 }
946
947 /**
948  * org_bluez_serial_proxy_new:
949  * @connection: A #GDBusConnection.
950  * @flags: Flags from the #GDBusProxyFlags enumeration.
951  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
952  * @object_path: An object path.
953  * @cancellable: (allow-none): A #GCancellable or %NULL.
954  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
955  * @user_data: User data to pass to @callback.
956  *
957  * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-bluez-Serial.top_of_page">org.bluez.Serial</link>. See g_dbus_proxy_new() for more details.
958  *
959  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
960  * You can then call org_bluez_serial_proxy_new_finish() to get the result of the operation.
961  *
962  * See org_bluez_serial_proxy_new_sync() for the synchronous, blocking version of this constructor.
963  */
964 void
965 org_bluez_serial_proxy_new (
966     GDBusConnection     *connection,
967     GDBusProxyFlags      flags,
968     const gchar         *name,
969     const gchar         *object_path,
970     GCancellable        *cancellable,
971     GAsyncReadyCallback  callback,
972     gpointer             user_data)
973 {
974   g_async_initable_new_async (TYPE_ORG_BLUEZ_SERIAL_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.bluez.Serial", NULL);
975 }
976
977 /**
978  * org_bluez_serial_proxy_new_finish:
979  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_serial_proxy_new().
980  * @error: Return location for error or %NULL
981  *
982  * Finishes an operation started with org_bluez_serial_proxy_new().
983  *
984  * Returns: (transfer full) (type OrgBluezSerialProxy): The constructed proxy object or %NULL if @error is set.
985  */
986 OrgBluezSerial *
987 org_bluez_serial_proxy_new_finish (
988     GAsyncResult        *res,
989     GError             **error)
990 {
991   GObject *ret;
992   GObject *source_object;
993   source_object = g_async_result_get_source_object (res);
994   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
995   g_object_unref (source_object);
996   if (ret != NULL)
997     return ORG_BLUEZ_SERIAL (ret);
998   else
999     return NULL;
1000 }
1001
1002 /**
1003  * org_bluez_serial_proxy_new_sync:
1004  * @connection: A #GDBusConnection.
1005  * @flags: Flags from the #GDBusProxyFlags enumeration.
1006  * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
1007  * @object_path: An object path.
1008  * @cancellable: (allow-none): A #GCancellable or %NULL.
1009  * @error: Return location for error or %NULL
1010  *
1011  * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-bluez-Serial.top_of_page">org.bluez.Serial</link>. See g_dbus_proxy_new_sync() for more details.
1012  *
1013  * The calling thread is blocked until a reply is received.
1014  *
1015  * See org_bluez_serial_proxy_new() for the asynchronous version of this constructor.
1016  *
1017  * Returns: (transfer full) (type OrgBluezSerialProxy): The constructed proxy object or %NULL if @error is set.
1018  */
1019 OrgBluezSerial *
1020 org_bluez_serial_proxy_new_sync (
1021     GDBusConnection     *connection,
1022     GDBusProxyFlags      flags,
1023     const gchar         *name,
1024     const gchar         *object_path,
1025     GCancellable        *cancellable,
1026     GError             **error)
1027 {
1028   GInitable *ret;
1029   ret = g_initable_new (TYPE_ORG_BLUEZ_SERIAL_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.bluez.Serial", NULL);
1030   if (ret != NULL)
1031     return ORG_BLUEZ_SERIAL (ret);
1032   else
1033     return NULL;
1034 }
1035
1036
1037 /**
1038  * org_bluez_serial_proxy_new_for_bus:
1039  * @bus_type: A #GBusType.
1040  * @flags: Flags from the #GDBusProxyFlags enumeration.
1041  * @name: A bus name (well-known or unique).
1042  * @object_path: An object path.
1043  * @cancellable: (allow-none): A #GCancellable or %NULL.
1044  * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
1045  * @user_data: User data to pass to @callback.
1046  *
1047  * Like org_bluez_serial_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
1048  *
1049  * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
1050  * You can then call org_bluez_serial_proxy_new_for_bus_finish() to get the result of the operation.
1051  *
1052  * See org_bluez_serial_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
1053  */
1054 void
1055 org_bluez_serial_proxy_new_for_bus (
1056     GBusType             bus_type,
1057     GDBusProxyFlags      flags,
1058     const gchar         *name,
1059     const gchar         *object_path,
1060     GCancellable        *cancellable,
1061     GAsyncReadyCallback  callback,
1062     gpointer             user_data)
1063 {
1064   g_async_initable_new_async (TYPE_ORG_BLUEZ_SERIAL_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.bluez.Serial", NULL);
1065 }
1066
1067 /**
1068  * org_bluez_serial_proxy_new_for_bus_finish:
1069  * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to org_bluez_serial_proxy_new_for_bus().
1070  * @error: Return location for error or %NULL
1071  *
1072  * Finishes an operation started with org_bluez_serial_proxy_new_for_bus().
1073  *
1074  * Returns: (transfer full) (type OrgBluezSerialProxy): The constructed proxy object or %NULL if @error is set.
1075  */
1076 OrgBluezSerial *
1077 org_bluez_serial_proxy_new_for_bus_finish (
1078     GAsyncResult        *res,
1079     GError             **error)
1080 {
1081   GObject *ret;
1082   GObject *source_object;
1083   source_object = g_async_result_get_source_object (res);
1084   ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
1085   g_object_unref (source_object);
1086   if (ret != NULL)
1087     return ORG_BLUEZ_SERIAL (ret);
1088   else
1089     return NULL;
1090 }
1091
1092 /**
1093  * org_bluez_serial_proxy_new_for_bus_sync:
1094  * @bus_type: A #GBusType.
1095  * @flags: Flags from the #GDBusProxyFlags enumeration.
1096  * @name: A bus name (well-known or unique).
1097  * @object_path: An object path.
1098  * @cancellable: (allow-none): A #GCancellable or %NULL.
1099  * @error: Return location for error or %NULL
1100  *
1101  * Like org_bluez_serial_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
1102  *
1103  * The calling thread is blocked until a reply is received.
1104  *
1105  * See org_bluez_serial_proxy_new_for_bus() for the asynchronous version of this constructor.
1106  *
1107  * Returns: (transfer full) (type OrgBluezSerialProxy): The constructed proxy object or %NULL if @error is set.
1108  */
1109 OrgBluezSerial *
1110 org_bluez_serial_proxy_new_for_bus_sync (
1111     GBusType             bus_type,
1112     GDBusProxyFlags      flags,
1113     const gchar         *name,
1114     const gchar         *object_path,
1115     GCancellable        *cancellable,
1116     GError             **error)
1117 {
1118   GInitable *ret;
1119   ret = g_initable_new (TYPE_ORG_BLUEZ_SERIAL_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.bluez.Serial", NULL);
1120   if (ret != NULL)
1121     return ORG_BLUEZ_SERIAL (ret);
1122   else
1123     return NULL;
1124 }
1125
1126
1127 /* ------------------------------------------------------------------------ */
1128
1129 /**
1130  * OrgBluezSerialSkeleton:
1131  *
1132  * The #OrgBluezSerialSkeleton structure contains only private data and should only be accessed using the provided API.
1133  */
1134
1135 /**
1136  * OrgBluezSerialSkeletonClass:
1137  * @parent_class: The parent class.
1138  *
1139  * Class structure for #OrgBluezSerialSkeleton.
1140  */
1141
1142 struct _OrgBluezSerialSkeletonPrivate
1143 {
1144   GValue *properties;
1145   GList *changed_properties;
1146   GSource *changed_properties_idle_source;
1147   GMainContext *context;
1148   GMutex lock;
1149 };
1150
1151 static void
1152 _org_bluez_serial_skeleton_handle_method_call (
1153   GDBusConnection *connection,
1154   const gchar *sender,
1155   const gchar *object_path,
1156   const gchar *interface_name,
1157   const gchar *method_name,
1158   GVariant *parameters,
1159   GDBusMethodInvocation *invocation,
1160   gpointer user_data)
1161 {
1162   OrgBluezSerialSkeleton *skeleton = ORG_BLUEZ_SERIAL_SKELETON (user_data);
1163   _ExtendedGDBusMethodInfo *info;
1164   GVariantIter iter;
1165   GVariant *child;
1166   GValue *paramv;
1167   guint num_params;
1168   guint num_extra;
1169   guint n;
1170   guint signal_id;
1171   GValue return_value = G_VALUE_INIT;
1172   info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
1173   g_assert (info != NULL);
1174   num_params = g_variant_n_children (parameters);
1175   num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
1176   n = 0;
1177   g_value_init (&paramv[n], TYPE_ORG_BLUEZ_SERIAL);
1178   g_value_set_object (&paramv[n++], skeleton);
1179   g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
1180   g_value_set_object (&paramv[n++], invocation);
1181   if (info->pass_fdlist)
1182     {
1183 #ifdef G_OS_UNIX
1184       g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
1185       g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
1186 #else
1187       g_assert_not_reached ();
1188 #endif
1189     }
1190   g_variant_iter_init (&iter, parameters);
1191   while ((child = g_variant_iter_next_value (&iter)) != NULL)
1192     {
1193       _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
1194       if (arg_info->use_gvariant)
1195         {
1196           g_value_init (&paramv[n], G_TYPE_VARIANT);
1197           g_value_set_variant (&paramv[n], child);
1198           n++;
1199         }
1200       else
1201         g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
1202       g_variant_unref (child);
1203     }
1204   signal_id = g_signal_lookup (info->signal_name, TYPE_ORG_BLUEZ_SERIAL);
1205   g_value_init (&return_value, G_TYPE_BOOLEAN);
1206   g_signal_emitv (paramv, signal_id, 0, &return_value);
1207   if (!g_value_get_boolean (&return_value))
1208     g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
1209   g_value_unset (&return_value);
1210   for (n = 0; n < num_params + num_extra; n++)
1211     g_value_unset (&paramv[n]);
1212   g_free (paramv);
1213 }
1214
1215 static GVariant *
1216 _org_bluez_serial_skeleton_handle_get_property (
1217   GDBusConnection *connection,
1218   const gchar *sender,
1219   const gchar *object_path,
1220   const gchar *interface_name,
1221   const gchar *property_name,
1222   GError **error,
1223   gpointer user_data)
1224 {
1225   OrgBluezSerialSkeleton *skeleton = ORG_BLUEZ_SERIAL_SKELETON (user_data);
1226   GValue value = G_VALUE_INIT;
1227   GParamSpec *pspec;
1228   _ExtendedGDBusPropertyInfo *info;
1229   GVariant *ret;
1230   ret = NULL;
1231   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_serial_interface_info, property_name);
1232   g_assert (info != NULL);
1233   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1234   if (pspec == NULL)
1235     {
1236       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1237     }
1238   else
1239     {
1240       g_value_init (&value, pspec->value_type);
1241       g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
1242       ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
1243       g_value_unset (&value);
1244     }
1245   return ret;
1246 }
1247
1248 static gboolean
1249 _org_bluez_serial_skeleton_handle_set_property (
1250   GDBusConnection *connection,
1251   const gchar *sender,
1252   const gchar *object_path,
1253   const gchar *interface_name,
1254   const gchar *property_name,
1255   GVariant *variant,
1256   GError **error,
1257   gpointer user_data)
1258 {
1259   OrgBluezSerialSkeleton *skeleton = ORG_BLUEZ_SERIAL_SKELETON (user_data);
1260   GValue value = G_VALUE_INIT;
1261   GParamSpec *pspec;
1262   _ExtendedGDBusPropertyInfo *info;
1263   gboolean ret;
1264   ret = FALSE;
1265   info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_org_bluez_serial_interface_info, property_name);
1266   g_assert (info != NULL);
1267   pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
1268   if (pspec == NULL)
1269     {
1270       g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
1271     }
1272   else
1273     {
1274       if (info->use_gvariant)
1275         g_value_set_variant (&value, variant);
1276       else
1277         g_dbus_gvariant_to_gvalue (variant, &value);
1278       g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
1279       g_value_unset (&value);
1280       ret = TRUE;
1281     }
1282   return ret;
1283 }
1284
1285 static const GDBusInterfaceVTable _org_bluez_serial_skeleton_vtable =
1286 {
1287   _org_bluez_serial_skeleton_handle_method_call,
1288   _org_bluez_serial_skeleton_handle_get_property,
1289   _org_bluez_serial_skeleton_handle_set_property
1290 };
1291
1292 static GDBusInterfaceInfo *
1293 org_bluez_serial_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton)
1294 {
1295   return org_bluez_serial_interface_info ();
1296 }
1297
1298 static GDBusInterfaceVTable *
1299 org_bluez_serial_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton)
1300 {
1301   return (GDBusInterfaceVTable *) &_org_bluez_serial_skeleton_vtable;
1302 }
1303
1304 static GVariant *
1305 org_bluez_serial_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
1306 {
1307   OrgBluezSerialSkeleton *skeleton = ORG_BLUEZ_SERIAL_SKELETON (_skeleton);
1308
1309   GVariantBuilder builder;
1310   guint n;
1311   g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
1312   if (_org_bluez_serial_interface_info.parent_struct.properties == NULL)
1313     goto out;
1314   for (n = 0; _org_bluez_serial_interface_info.parent_struct.properties[n] != NULL; n++)
1315     {
1316       GDBusPropertyInfo *info = _org_bluez_serial_interface_info.parent_struct.properties[n];
1317       if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
1318         {
1319           GVariant *value;
1320           value = _org_bluez_serial_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.bluez.Serial", info->name, NULL, skeleton);
1321           if (value != NULL)
1322             {
1323               g_variant_take_ref (value);
1324               g_variant_builder_add (&builder, "{sv}", info->name, value);
1325               g_variant_unref (value);
1326             }
1327         }
1328     }
1329 out:
1330   return g_variant_builder_end (&builder);
1331 }
1332
1333 static void
1334 org_bluez_serial_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
1335 {
1336 }
1337
1338 static void org_bluez_serial_skeleton_iface_init (OrgBluezSerialIface *iface);
1339 G_DEFINE_TYPE_WITH_CODE (OrgBluezSerialSkeleton, org_bluez_serial_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
1340                          G_IMPLEMENT_INTERFACE (TYPE_ORG_BLUEZ_SERIAL, org_bluez_serial_skeleton_iface_init));
1341
1342 static void
1343 org_bluez_serial_skeleton_finalize (GObject *object)
1344 {
1345   OrgBluezSerialSkeleton *skeleton = ORG_BLUEZ_SERIAL_SKELETON (object);
1346   g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
1347   if (skeleton->priv->changed_properties_idle_source != NULL)
1348     g_source_destroy (skeleton->priv->changed_properties_idle_source);
1349   g_main_context_unref (skeleton->priv->context);
1350   g_mutex_clear (&skeleton->priv->lock);
1351   G_OBJECT_CLASS (org_bluez_serial_skeleton_parent_class)->finalize (object);
1352 }
1353
1354 static void
1355 org_bluez_serial_skeleton_init (OrgBluezSerialSkeleton *skeleton)
1356 {
1357   skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, TYPE_ORG_BLUEZ_SERIAL_SKELETON, OrgBluezSerialSkeletonPrivate);
1358   g_mutex_init (&skeleton->priv->lock);
1359   skeleton->priv->context = g_main_context_ref_thread_default ();
1360 }
1361
1362 static void
1363 org_bluez_serial_skeleton_class_init (OrgBluezSerialSkeletonClass *klass)
1364 {
1365   GObjectClass *gobject_class;
1366   GDBusInterfaceSkeletonClass *skeleton_class;
1367
1368   g_type_class_add_private (klass, sizeof (OrgBluezSerialSkeletonPrivate));
1369
1370   gobject_class = G_OBJECT_CLASS (klass);
1371   gobject_class->finalize = org_bluez_serial_skeleton_finalize;
1372
1373   skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
1374   skeleton_class->get_info = org_bluez_serial_skeleton_dbus_interface_get_info;
1375   skeleton_class->get_properties = org_bluez_serial_skeleton_dbus_interface_get_properties;
1376   skeleton_class->flush = org_bluez_serial_skeleton_dbus_interface_flush;
1377   skeleton_class->get_vtable = org_bluez_serial_skeleton_dbus_interface_get_vtable;
1378 }
1379
1380 static void
1381 org_bluez_serial_skeleton_iface_init (OrgBluezSerialIface *iface)
1382 {
1383 }
1384
1385 /**
1386  * org_bluez_serial_skeleton_new:
1387  *
1388  * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-bluez-Serial.top_of_page">org.bluez.Serial</link>.
1389  *
1390  * Returns: (transfer full) (type OrgBluezSerialSkeleton): The skeleton object.
1391  */
1392 OrgBluezSerial *
1393 org_bluez_serial_skeleton_new (void)
1394 {
1395   return ORG_BLUEZ_SERIAL (g_object_new (TYPE_ORG_BLUEZ_SERIAL_SKELETON, NULL));
1396 }
1397