![]() |
2010-01-16
, 12:36
|
Posts: 27 |
Thanked: 59 times |
Joined on Jan 2010
@ Munich, Germany
|
#2
|
Nokia-N900-51-1:~# gconftool-2 -R / | grep usb sync-usb-mode = false statusbar_icon_name = Schema (type: `string' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') statusbar_dimmed_icon_name = Schema (type: `string' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') statusbar_icon_name = Schema (type: `string' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') statusbar_dimmed_icon_name = Schema (type: `string' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') statusbar_icon_name = Schema (type: `string' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') statusbar_dimmed_icon_name = Schema (type: `string' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') mmc-used-over-usb = Schema (type: `bool' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') usb-mode = Schema (type: `string' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') internal-mmc-used-over-usb = Schema (type: `bool' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') usb-device-name = Schema (type: `string' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') usb-cable-attached = Schema (type: `bool' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') statusbar_icon_name = general_adhocwlan statusbar_dimmed_icon_name = statusarea_internetconnection_no statusbar_icon_name = general_packetdata statusbar_dimmed_icon_name = statusarea_internetconn_packetdata_dimmed statusbar_icon_name = general_wlan statusbar_dimmed_icon_name = statusarea_internetconnection_no mmc-used-over-usb = false usb-mode = idle internal-mmc-used-over-usb = false usb-device-name = unknown usb-cable-attached = false
Nokia-N900-51-1:~# gconftool-2 -R / | grep usb sync-usb-mode = false statusbar_icon_name = Schema (type: `string' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') statusbar_dimmed_icon_name = Schema (type: `string' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') statusbar_icon_name = Schema (type: `string' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') statusbar_dimmed_icon_name = Schema (type: `string' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') statusbar_icon_name = Schema (type: `string' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') statusbar_dimmed_icon_name = Schema (type: `string' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') mmc-used-over-usb = Schema (type: `bool' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') usb-mode = Schema (type: `string' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') internal-mmc-used-over-usb = Schema (type: `bool' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') usb-device-name = Schema (type: `string' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') usb-cable-attached = Schema (type: `bool' list_type: '*invalid*' car_type: '*invalid*' cdr_type: '*invalid*' locale: `C') statusbar_icon_name = general_adhocwlan statusbar_dimmed_icon_name = statusarea_internetconnection_no statusbar_icon_name = general_packetdata statusbar_dimmed_icon_name = statusarea_internetconn_packetdata_dimmed statusbar_icon_name = general_wlan statusbar_dimmed_icon_name = statusarea_internetconnection_no mmc-used-over-usb = false usb-mode = peripheral internal-mmc-used-over-usb = true usb-device-name = USB-Gerät usb-cable-attached = true
The Following User Says Thank You to BlueGene For This Useful Post: | ||
![]() |
2010-01-16
, 13:56
|
|
Posts: 664 |
Thanked: 160 times |
Joined on Jul 2008
@ Australia
|
#3
|
![]() |
2010-01-18
, 07:24
|
|
Posts: 138 |
Thanked: 375 times |
Joined on Aug 2009
@ Berlin
|
#4
|
The Following User Says Thank You to pH5 For This Useful Post: | ||
![]() |
2010-01-18
, 09:24
|
|
Posts: 664 |
Thanked: 160 times |
Joined on Jul 2008
@ Australia
|
#5
|
#include <hal/libhal.h> #include <stdio.h> #include <string.h> //void set_up(LibHalContext*); void _device_added(LibHalContext*, const char*); void _device_removed(LibHalContext*, const char*); void _property_modified(LibHalContext*, const char*, const char*, dbus_bool_t, dbus_bool_t); int main(int argc, char *argv[]){ printf("Starting hal\n"); LibHalContext *ctx = libhal_ctx_new(); DBusConnection *dbus; dbus = dbus_bus_get(DBUS_BUS_SYSTEM, NULL); if (dbus == NULL) printf("ERROR CONNECTION DBUS.\n"); else printf("Successfully connected to DBus.\n"); printf("connecting hal to dbus.\n"); libhal_ctx_set_dbus_connection(ctx, dbus); libhal_ctx_set_device_added(ctx, _device_added); libhal_ctx_set_device_removed(ctx, _device_removed); libhal_ctx_init(ctx, NULL); printf("Watching devices...\n"); libhal_device_property_watch_all(ctx, NULL); return 0; } void _device_added(LibHalContext *ctx, const char *udi){ printf("UDI: %s\n", udi); if (strcmp(udi, "/org/freedesktop/Hal/devices/usb_device_1d6b_2_musb_hdrc") == 0){ printf("Usb added.\n"); }else printf("Unidentified device added.\n"); } void _device_removed(LibHalContext *ctx, const char *udi){ printf("UDI: %s\n", udi); if (strcmp(udi, "/org/freedesktop/Hal/devices/usb_device_1d6b_2_musb_hdrc") == 0){ printf("Usb removed.\n"); }else printf("Unidentified device removed.\n"); }
I was wondering if anyone can help me as to how I can check if the device is in usb or pc suite mode. I checked libosso but couldn't get any clue and also checked the mce-dev but couldn't see usb/pc modes anywhere. Also I tried going through dbus api but couldn't figure out where to look. So, I would be very grateful for any hints/help coz I'm completely noob when it comes to these api. Thanks