00001 /****************************************************************************** 00002 * Copyright (c) 1999-2008 ACCESS CO., LTD. All rights reserved. 00003 * Copyright (c) 2007, ACCESS Systems Americas, Inc. All rights reserved. 00004 *****************************************************************************/ 00012 #ifndef _BTTOOLS_H_ 00013 #define _BTTOOLS_H_ 00014 00015 /****************************************************************************/ 00016 00017 #include <gtk/gtkdialog.h> 00018 #include <gtk/gtkwindow.h> 00019 00020 #include <alp/types.h> 00021 00022 /****************************************************************************/ 00023 00024 #ifdef __cplusplus 00025 extern "C" 00026 { 00027 #endif 00028 00034 /******************************************************************************* 00035 * Errors 00036 *******************************************************************************/ 00037 00042 #define ALP_BLUETOOTH_ERR_NO_ERROR 0 00043 #define ALP_BLUETOOTH_ERR_PENDING (ALP_CLASS_BLUETOOTH|0x01) 00044 #define ALP_BLUETOOTH_ERR_PARAM_ERROR (ALP_CLASS_BLUETOOTH|0x02) 00045 #define ALP_BLUETOOTH_ERR_CANCELED (ALP_CLASS_BLUETOOTH|0x03) 00046 #define ALP_BLUETOOTH_ERR_OUT_OF_MEMORY (ALP_CLASS_BLUETOOTH|0x04) 00047 #define ALP_BLUETOOTH_ERR_ERROR (ALP_CLASS_BLUETOOTH|0xFF) 00048 00053 /******************************************************************************* 00054 * Types 00055 *******************************************************************************/ 00056 00057 //------------------------------------------------------------------------------ 00072 typedef uint32_t AlpBluetoothClassOfDeviceType; 00073 00075 00076 #define ALP_BLUETOOTH_COD_LIMITED_DISCOVERABLE_MODE 0x00002000 00077 #define ALP_BLUETOOTH_COD_RESERVED1 0x00004000 00078 #define ALP_BLUETOOTH_COD_RESERVED2 0x00008000 00079 #define ALP_BLUETOOTH_COD_POSITIONING 0x00010000 00080 #define ALP_BLUETOOTH_COD_NETWORKING 0x00020000 00081 #define ALP_BLUETOOTH_COD_RENDERING 0x00040000 00082 #define ALP_BLUETOOTH_COD_CAPTURING 0x00080000 00083 #define ALP_BLUETOOTH_COD_OBJECT_TRANSFER 0x00100000 00084 #define ALP_BLUETOOTH_COD_AUDIO 0x00200000 00085 #define ALP_BLUETOOTH_COD_TELEPHONY 0x00400000 00086 #define ALP_BLUETOOTH_COD_INFORMATION 0x00800000 00087 #define ALP_BLUETOOTH_COD_SERVICE_ANY 0x00ffE000 00088 00089 00091 00092 #define ALP_BLUETOOTH_COD_MAJOR_MISC 0x00000000 00093 #define ALP_BLUETOOTH_COD_MAJOR_COMPUTER 0x00000100 00094 #define ALP_BLUETOOTH_COD_MAJOR_PHONE 0x00000200 00095 #define ALP_BLUETOOTH_COD_MAJOR_LAN_ACCESS_POINT 0x00000300 00096 #define ALP_BLUETOOTH_COD_MAJOR_AUDIO 0x00000400 00097 #define ALP_BLUETOOTH_COD_MAJOR_PERIPHERAL 0x00000500 00098 #define ALP_BLUETOOTH_COD_MAJOR_IMAGING 0x00000600 00099 #define ALP_BLUETOOTH_COD_MAJOR_WEARABLE 0x00000700 00100 #define ALP_BLUETOOTH_COD_MAJOR_TOY 0x00000800 00101 #define ALP_BLUETOOTH_COD_MAJOR_UNCLASSIFIED 0x00001F00 00102 #define ALP_BLUETOOTH_COD_MAJOR_ANY 0x00001F00 00103 00104 #define ALP_BLUETOOTH_COD_MINOR_ANY 0x000000FC 00105 00106 00108 00109 #define ALP_BLUETOOTH_COD_MINOR_COMP_UNCLASSIFIED 0x00000000 00110 #define ALP_BLUETOOTH_COD_MINOR_COMP_DESKTOP 0x00000004 00111 #define ALP_BLUETOOTH_COD_MINOR_COMP_SERVER 0x00000008 00112 #define ALP_BLUETOOTH_COD_MINOR_COMP_LAPTOP 0x0000000C 00113 #define ALP_BLUETOOTH_COD_MINOR_COMP_HANDHELD 0x00000010 00114 #define ALP_BLUETOOTH_COD_MINOR_COMP_PALM 0x00000014 00115 #define ALP_BLUETOOTH_COD_MINOR_COMP_ANY ALP_BLUETOOTH_COD_MINOR_ANY 00116 00117 00119 00120 #define ALP_BLUETOOTH_COD_MINOR_PHONE_UNCLASSIFIED 0x00000000 00121 #define ALP_BLUETOOTH_COD_MINOR_PHONE_CELLULAR 0x00000004 00122 #define ALP_BLUETOOTH_COD_MINOR_PHONE_CORDLESS 0x00000008 00123 #define ALP_BLUETOOTH_COD_MINOR_PHONE_SMART 0x0000000C 00124 #define ALP_BLUETOOTH_COD_MINOR_PHONE_MODEM 0x00000010 00125 #define ALP_BLUETOOTH_COD_MINOR_PHONE_ISDN 0x00000014 00126 #define ALP_BLUETOOTH_COD_MINOR_PHONE_ANY ALP_BLUETOOTH_COD_MINOR_ANY 00127 00128 00130 00131 #define ALP_BLUETOOTH_COD_MINOR_LAN_0 0x00000000 00132 #define ALP_BLUETOOTH_COD_MINOR_LAN_17 0x00000020 00133 #define ALP_BLUETOOTH_COD_MINOR_LAN_33 0x00000040 00134 #define ALP_BLUETOOTH_COD_MINOR_LAN_50 0x00000060 00135 #define ALP_BLUETOOTH_COD_MINOR_LAN_67 0x00000080 00136 #define ALP_BLUETOOTH_COD_MINOR_LAN_83 0x000000A0 00137 #define ALP_BLUETOOTH_COD_MINOR_LAN_99 0x000000C0 00138 #define ALP_BLUETOOTH_COD_MINOR_LAN_NO_SERVICE 0x000000E0 00139 #define ALP_BLUETOOTH_COD_MINOR_LAN_ANY ALP_BLUETOOTH_COD_MINOR_ANY 00140 00141 00143 00144 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_UNCLASSIFIED 0x00000000 00145 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_HEADSET 0x00000004 00146 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_HANDSFREE 0x00000008 00147 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_MICROPHONE 0x00000010 00148 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_LOUDSPEAKER 0x00000014 00149 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_HEADPHONE 0x00000018 00150 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_PORTABLE_AUDIO 0x0000001C 00151 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_CAR_AUDIO 0x00000020 00152 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_SETTOPBOX 0x00000024 00153 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_HIFI_AUDIO 0x00000028 00154 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_VCR 0x0000002C 00155 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_VIDEO_CAMERA 0x00000030 00156 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_CAMCORDER 0x00000034 00157 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_VIDEO_MONITOR 0x00000038 00158 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_VIDEO_DISPLAY_AND_LOUDSPEAKER 0x0000003C 00159 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_VIDEO_CONF 0x00000040 00160 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_GAME_TOY 0x00000048 00161 #define ALP_BLUETOOTH_COD_MINOR_AUDIO_ANY ALP_BLUETOOTH_COD_MINOR_ANY 00162 00163 00165 00166 #define ALP_BLUETOOTH_COD_MINOR_PERIPHERAL_UNCLASSIFIED 0x00000000 00167 #define ALP_BLUETOOTH_COD_MINOR_PERIPHERAL_KEYBOARD 0x00000040 00168 #define ALP_BLUETOOTH_COD_MINOR_PERIPHERAL_POINTING 0x00000080 00169 #define ALP_BLUETOOTH_COD_MINOR_PERIPHERAL_COMBO 0x000000C0 00170 00171 00173 00174 #define ALP_BLUETOOTH_COD_MINOR_PERIPHERAL_JOYSTICK 0x00000004 00175 #define ALP_BLUETOOTH_COD_MINOR_PERIPHERAL_GAMEPAD 0x00000008 00176 #define ALP_BLUETOOTH_COD_MINOR_PERIPHERAL_REMOTE_CONTROL 0x0000000C 00177 #define ALP_BLUETOOTH_COD_MINOR_PERIPHERAL_SENSING 0x00000010 00178 #define ALP_BLUETOOTH_COD_MINOR_PERIPHERAL_DIGITIZER_TABLET 0x00000014 00179 #define ALP_BLUETOOTH_COD_MINOR_PERIPHERAL_CARD_READER 0x00000018 00180 00181 00183 00184 #define ALP_BLUETOOTH_COD_MINOR_IMAGING_UNCLASSIFIED 0x00000000 00185 #define ALP_BLUETOOTH_COD_MINOR_IMAGING_DISPLAY 0x00000010 00186 #define ALP_BLUETOOTH_COD_MINOR_IMAGING_CAMERA 0x00000020 00187 #define ALP_BLUETOOTH_COD_MINOR_IMAGING_SCANNER 0x00000040 00188 #define ALP_BLUETOOTH_COD_MINOR_IMAGING_PRINTER 0x00000080 00189 00190 00192 00193 #define ALP_BLUETOOTH_COD_MINOR_WEARABLE_WRISTWATCH 0x00000004 00194 #define ALP_BLUETOOTH_COD_MINOR_WEARABLE_PAGER 0x00000008 00195 #define ALP_BLUETOOTH_COD_MINOR_WEARABLE_JACKET 0x0000000C 00196 #define ALP_BLUETOOTH_COD_MINOR_WEARABLE_HELMET 0x00000010 00197 #define ALP_BLUETOOTH_COD_MINOR_WEARABLE_GLASSES 0x00000014 00198 00199 00201 00202 #define ALP_BLUETOOTH_COD_MINOR_TOY_ROBOT 0x00000004 00203 #define ALP_BLUETOOTH_COD_MINOR_TOY_VEHICLE 0x00000008 00204 #define ALP_BLUETOOTH_COD_MINOR_TOY_DOLL 0x0000000C 00205 #define ALP_BLUETOOTH_COD_MINOR_TOY_CONTROLLER 0x00000010 00206 #define ALP_BLUETOOTH_COD_MINOR_TOY_GAME 0x00000014 00207 00208 00209 00211 00212 #define ALP_BLUETOOTH_COD_SERVICE_MASK 0x00ffE000 00213 #define ALP_BLUETOOTH_COD_MAJOR_MASK 0x00001F00 00214 #define ALP_BLUETOOTH_COD_MINOR_MASK 0x000000FC 00215 00216 00221 //-------------------------------------- 00227 #define ALP_BLUETOOTH_MAX_DEVICE_NAME_SIZE 249 00228 00230 #define ALP_BLUETOOTH_DEVICE_ADDRESS_STRING_SIZE 18 00231 00233 #define ALP_BLUETOOTH_UUID_32_128(x) x "-0000-1000-8000-00805f9b34fb" 00234 00236 #define ALP_BLUETOOTH_UUID_16_128(x) "0000" x "-0000-1000-8000-00805f9b34fb" 00237 00249 00250 #define ALP_BLUETOOTH_CONNECT_VERB "bluetooth_connect" 00251 00253 #define ALP_BLUETOOTH_CONNECT_ADDR_PARAM "addr" 00254 00255 00261 /******************************************************************************* 00262 * Misc 00263 *******************************************************************************/ 00264 00281 alp_status_t alp_bluetooth_check(GtkWindow *parent); 00282 00297 alp_status_t alp_bluetooth_get_pixmap_from_cod(GtkWidget * widget, char *major, char *minor, const char * size_name, GdkPixbuf ** icon); 00298 00309 AlpBluetoothClassOfDeviceType alp_bluetooth_cod_from_string(char *major, char *minor, char *subminor, char **services); 00310 00311 //------------------------------------------------------------------------------ 00320 void alp_bluetooth_string_from_cod(AlpBluetoothClassOfDeviceType cod, char **major, char **minor, char **subminor, char ***services); 00321 00332 alp_status_t alp_bluetooth_prepare_afh_channels(uint8_t *afh_map, uint8_t begin, uint8_t count, uint8_t state); 00333 00343 alp_status_t alp_bluetooth_prepare_wifi_channels(uint8_t *afh_map, uint8_t wifi_channel, uint8_t state); 00344 00360 /******************************************************************************* 00361 * Discovery dialog 00362 *******************************************************************************/ 00363 00365 #define ALP_TYPE_BLUETOOTH_DISCOVERY_DIALOG (alp_bluetooth_discovery_dialog_get_type ()) 00366 #define ALP_BLUETOOTH_DISCOVERY_DIALOG(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), ALP_TYPE_BLUETOOTH_DISCOVERY_DIALOG, AlpBluetoothDiscoveryDialog)) 00367 #define ALP_BLUETOOTH_DISCOVERY_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ALP_TYPE_BLUETOOTH_DISCOVERY_DIALOG, AlpBluetoothDiscoveryDialogClass)) 00368 #define ALP_IS_BLUETOOTH_DISCOVERY_DIALOG(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), ALP_TYPE_BLUETOOTH_DISCOVERY_DIALOG)) 00369 #define ALP_IS_BLUETOOTH_DISCOVERY_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ALP_TYPE_BLUETOOTH_DISCOVERY_DIALOG)) 00370 #define ALP_BLUETOOTH_DISCOVERY_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ALP_TYPE_BLUETOOTH_DISCOVERY_DIALOG, AlpBluetoothDiscoveryDialogClass)) 00371 00373 typedef struct _AlpBluetoothDiscoveryDialog 00374 { 00375 /*< private >*/ 00376 GtkDialog parent_instance; 00377 00378 /*< public >*/ 00379 GtkWidget *comboBox; 00380 GtkWidget *label_instruction; 00381 GtkWidget *label_info; 00382 GtkWidget *progress_icon; 00383 GtkWidget *scrollview; 00384 GtkWidget *treeview; 00385 GtkWidget *button_ok; 00386 GtkWidget *button_cancel; 00387 GtkWidget *button_tip; 00388 } AlpBluetoothDiscoveryDialog; 00389 00394 GType alp_bluetooth_discovery_dialog_get_type(void) G_GNUC_CONST; 00395 00412 GtkWidget *alp_bluetooth_discovery_dialog_new(GtkWindow * iParentP, guint iMaxDeviceSelection); 00413 00426 void alp_bluetooth_discovery_dialog_set_filter(AlpBluetoothDiscoveryDialog * ioDialogP, AlpBluetoothClassOfDeviceType * iFilterTableP, guint filterTableLen); 00427 00433 void alp_bluetooth_discovery_dialog_set_instruction(AlpBluetoothDiscoveryDialog * ioDialogP, gchar * iString); 00434 00440 void alp_bluetooth_discovery_dialog_set_action_button_text(AlpBluetoothDiscoveryDialog * ioDialogP, gchar * iString); 00441 00447 void alp_bluetooth_discovery_dialog_set_cancel_button_text(AlpBluetoothDiscoveryDialog * ioDialogP, gchar * iString); 00448 00449 00457 gint alp_bluetooth_discovery_dialog_run(AlpBluetoothDiscoveryDialog * ioDialogP); 00458 00467 guint alp_bluetooth_discovery_dialog_get_selection(AlpBluetoothDiscoveryDialog * ioDialogP, gchar *** oDeviceTableP); 00468 00469 /****************************************************************************/ 00470 00475 #ifdef __cplusplus 00476 } 00477 #endif 00478 00479 /****************************************************************************/ 00480 00481 #endif
Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.