Connect method of org.bluez.Network1 interface throws error "Connect with signature "s" doesn't exist"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am using bluez 5.35 and developing an application using Glib DBUS binding.

As per network-api.txt documentation, my code calls connect API with
String type parameter but while execution it prompts below error.
Can you please let me know why is it giving this error and how can i
resolve this.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Unable to connect with network :
GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: Method "Connect"
with signature "s" on interface "org.bluez.Network1" doesn't exist
////////////////////////////////////////////////////////////////////////////////////////////////////////////

/* For reference please find my code as below*/

int connect_network(char *interface)
{
  int       ret       = 0;
  GError   *error     = NULL;
  GVariant *reply     = NULL;

  GVariant **t = NULL;
  t    = g_new(GVariant *, 1);
  t[0] = g_variant_new_string ("nap");

  GVariant *tuple_variant = g_variant_new_tuple(t, 1);

  /* connect with network */
  reply = g_dbus_connection_call_sync(dbus_conn,
    BLUEZ_BUS_NAME,
    "/org/bluez/hci0",
    "org.bluez.Network1",
    "Connect",
    tuple_variant,
    G_VARIANT_TYPE_STRING,
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    NULL,
    &error);

if (error) {
    printf("Unable to connect with network : %s\n", error->message);
g_free(t);
    return -3;
  }

   g_variant_get(reply, "(s)", &interface);
   printf("interface from connect is = %s\n", interface);
  g_free(t);

  return ret;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux