Hello again all,
So I've been trying to use this gwconnect api (http://maemo.org/platform/docs/osso-gwconnect.html) in order to find, select, bind, and finally get data from a bluetooth device. I wrote an email earlier asking how to get signals from the btsearch service because it didn't seem like anything i was trying was able to receive any signals from the btsearch service. At that time I just assumed the btsearch and other bt-related services (btsdp, btcond) were available, however I checked with dbus_bus_name_has_owner(), and was suprised to see that it failed for 2/3 bt-services when running on the device, and all 3/3 failed when running within scratchbox. looking for btsearch and btsdp failed, but btcond seems to be available. Can anyone confirm this??

Would anyone know why these services wouldn't be available? Do I have to start them somehow? It was my understanding they'd be automatically started when calling their methods with dbus. Below is basically all i did to check, including some pseudo-code for brevity.

Many thanks in advance,
kurt



main() {
    osso_context_t * osso_context;
    DBusConnection *bus;
    DBusError  dbus_error;
    dbus_bool_t owned;

    if( (osso_context = osso_initialize("btapp", "0.1", TRUE, NULL)) == NULL )
        output message & quit

    /* tried also DBUS_BUS_SESSION */
    if( !( bus = dbus_bus_get(DBUS_BUS_SYSTEM, NULL) ) )
        output message & quit

const char *services [4] = {"com.nokia.btsearch","com.nokia.btsdp","com.nokia.btcond",""};

    for(int i=0; services[i] != ""; ++i)
    {
       dbus_error_init(&dbus_error);
       owned = dbus_bus_name_has_owner(bus, services[i], &dbus_error);

       if(!owned)
           output fail message
        else
           output success message
    }

    free, de-init, and return
}
_______________________________________________
maemo-developers mailing list
[email protected]
https://maemo.org/mailman/listinfo/maemo-developers

Reply via email to