FreeCalypso > hg > fc-magnetite
comparison src/ui3/bmi/mmiBtipsBmg.h @ 420:e8ddbb0837ed
src/ui3: initial import of TCS3/LoCosto BMI & MFW code
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Sun, 21 Jan 2018 03:09:00 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 419:59143cd42ec7 | 420:e8ddbb0837ed |
|---|---|
| 1 #ifndef _MMIBTIPS_BMG_H_ | |
| 2 #define _MMIBTIPS_BMG_H_ | |
| 3 | |
| 4 /* ========================================================= | |
| 5 * Texas Instruments OMAP(TM) Platform Software | |
| 6 * (c) Copyright Texas Instruments, Incorporated. All Rights Reserved. | |
| 7 * | |
| 8 * Use of this software is controlled by the terms and conditions found | |
| 9 * in the license agreement under which this software has been supplied. | |
| 10 * ========================================================== */ | |
| 11 /* | |
| 12 $Project name: Basic Bluetooth MMI | |
| 13 $Project code: | |
| 14 $Module: Bluetooth BMG APPlication | |
| 15 $File: MmiBtipsBmg.h | |
| 16 $Revision: 1.0 | |
| 17 $Author: Texas Instruments | |
| 18 $Date: 26/06/07 | |
| 19 | |
| 20 ******************************************************************************** | |
| 21 | |
| 22 Description: | |
| 23 | |
| 24 This module provides the BTIPS BMG APPlication functionality. | |
| 25 | |
| 26 ******************************************************************************** | |
| 27 $History: MmiBtipsBmg.h | |
| 28 | |
| 29 26/06/07 Sasken original version | |
| 30 | |
| 31 $End | |
| 32 | |
| 33 *******************************************************************************/ | |
| 34 #define BTL_BMG_MAX_PIN_LENGTH 17 | |
| 35 #define BT_MAX_REM_DEV_NAME 248 | |
| 36 #define BTIPS_MAX_SERVICES_BUFFER 200 //Buffer for the AUI_EDITOR to display the services supported by a particluar paired device | |
| 37 | |
| 38 #define T_MFW_BTIPS_SEARCH_CB BtipsSearchCb | |
| 39 typedef int (*BtipsSearchCb) (BD_ADDR); /* MFW event handler */ | |
| 40 | |
| 41 /* ====================================================== */ | |
| 42 /* | |
| 43 * List Attribute | |
| 44 */ | |
| 45 /* ====================================================== */ | |
| 46 static const MfwMnuAttr BtipsDeviceList_Attrib = | |
| 47 { | |
| 48 &menuArea, | |
| 49 MNU_LEFT| MNU_LIST_ICONS| MNU_CUR_LINE, /* centered page menu */ | |
| 50 (U8)-1, /* use default font */ | |
| 51 NULL, /* with these items */ | |
| 52 0, /* number of items */ | |
| 53 COLOUR_LIST_XX, | |
| 54 #ifdef FF_MMI_BTIPS_APP | |
| 55 TxtBtipsApp, | |
| 56 #endif | |
| 57 NULL, | |
| 58 MNUATTRSPARE | |
| 59 }; | |
| 60 //Structure to access buffer for AUI Editor | |
| 61 typedef struct | |
| 62 { | |
| 63 | |
| 64 char * edt_buf; | |
| 65 } T_MMI_BTIPS_SERVICES_STRUCT; | |
| 66 | |
| 67 /*--------------------------------------------------------------------------- | |
| 68 * BondState type | |
| 69 * | |
| 70 * MMI Bluetooth states for bond process | |
| 71 */ | |
| 72 typedef U8 BondState; | |
| 73 | |
| 74 #define BOND_NOT_STARTED 0x00 /* No request from user*/ | |
| 75 #define BOND_USER_REQUESTED 0x01 /* User has requested but the process is not started*/ | |
| 76 #define BOND_PIN_TAKEN 0x02 /*Pin was taken from user and send to peer device, no response yet */ | |
| 77 #define BOND_CANCELLED 0x03 /* User cancelled the request*/ | |
| 78 #define PIN_REQUEST_RECEIVED 0x04 /* Response received from peer device for the sent PIN request*/ | |
| 79 /* End of BondState */ | |
| 80 | |
| 81 /*--------------------------------------------------------------------------- | |
| 82 * InquiryState type | |
| 83 * | |
| 84 * MMI Bluetooth states for Inquiry process | |
| 85 */ | |
| 86 typedef U8 InquiryState; | |
| 87 | |
| 88 #define INQUIRY_NOT_STARTED 0x00 /* No on-going inquiryprocess*/ | |
| 89 #define INQUIRY_STARTED 0x01 /*Inquiry is on-going, neither cancelled nor complete*/ | |
| 90 #define INQUIRY_CANCELLATION_STARTED 0x02 /* User requested to cancel the inquiry*/ | |
| 91 #define INQUIRY_CANCELLATION_COMPLETE 0x03 /*Cancellation complete*/ | |
| 92 #define INQUIRY_COMPLETE 0x04 /*Inquiry comlpete*/ | |
| 93 /* End of InquiryState */ | |
| 94 | |
| 95 #define SHOW_NO_LIST 0 // this is to keep the window alive, to pop up the pinkey window for bond | |
| 96 #define SHOW_PAIRED_LIST 1 | |
| 97 #define SHOW_SEARCH_LIST 2 | |
| 98 #define SHOW_NONE_EXIT 3//Exit now | |
| 99 | |
| 100 #define SERVICESMASK_NOT_EMPTY 1 | |
| 101 #define SERVICESMASK_EMPTY 0 | |
| 102 typedef struct _T_MMI_Btips_Bmg_DevicesWin_data | |
| 103 { | |
| 104 T_MMI_CONTROL mmi_control; | |
| 105 T_MFW_HND win; | |
| 106 T_MFW_HND mfwwin; | |
| 107 T_MFW_HND parent; | |
| 108 T_MFW_HND kbd; | |
| 109 T_MFW_HND bondCancellationWindow; | |
| 110 SHORT id; | |
| 111 | |
| 112 /*Editor for Pincode request*/ | |
| 113 T_MFW_HND pinCode_editor; | |
| 114 U8 pinCode[4]; | |
| 115 | |
| 116 /*Create a list for displaying devices*/ | |
| 117 ListMenuData *menu_list_data; | |
| 118 T_MFW_HND list_win;//Hanlder for the list | |
| 119 U32 listCount; | |
| 120 BOOL listID; //for Inquiry list = SHOW_SEARCH_LIST, for paired list = SHOW_PAIRED_LIST | |
| 121 | |
| 122 /*Create a list for displaying connected devices*/ | |
| 123 ListMenuData *menu_list_connected_data; | |
| 124 T_MFW_HND list_connected_win;//Hanlder for the list | |
| 125 U32 listCountConnectedDevices; | |
| 126 U32 noConnectedDevices; | |
| 127 Bmg_ConnectedDeviceList connected_deviceList[BT_MAX_DEVICE_LIST]; | |
| 128 //BOOL listID; //for Inquiry list = SHOW_SEARCH_LIST, for paired list = SHOW_PAIRED_LIST | |
| 129 | |
| 130 /*Global Data related to BTIPS Application Statemachine*/ | |
| 131 BOOL searchType; | |
| 132 InquiryState inquiryState; | |
| 133 BondState bondState; | |
| 134 U32 noPairedDevices; | |
| 135 U32 noInquiredDevices; | |
| 136 U32 currentListIndex; | |
| 137 Bmg_DeviceList deviceList[BT_MAX_DEVICE_LIST]; | |
| 138 BtipsSearchCb searchCB; | |
| 139 | |
| 140 }T_MMI_Btips_Bmg_DevicesWin_data; | |
| 141 | |
| 142 typedef enum { | |
| 143 BTIPS_BMG_PAIRED_DEVICES_INIT=0, | |
| 144 BTIPS_BMG_INQUIRY_RESULT_DEVICES_INIT, | |
| 145 BTIPS_BMG_BONDING_REQUEST_INIT, | |
| 146 BTIPS_BMG_BONDING_REQUEST_SENT, | |
| 147 BTIPS_BMG_DEVICES_LIST_WIN_DEINIT, | |
| 148 BTIPS_BMG_DEVICES_EXIT_WIN, | |
| 149 }BTIPS_BMG_DEVICES_WIN_EVENT; | |
| 150 | |
| 151 typedef enum { | |
| 152 BTIPS_BMG_CONNECTED_DEVICES_EXIT_WIN=0, | |
| 153 }BTIPS_BMG_CONNECTED_DEVICES_WIN_EVENT; | |
| 154 /********************************************************************* | |
| 155 BMG Editor Data for PhoneName Editor , PinCode Editor | |
| 156 *********************************************************************/ | |
| 157 typedef enum { | |
| 158 BTIPS_BMG_LOCAL_EDITOR_INIT=0, | |
| 159 BTIPS_BMG_REMOTE_EDITOR_INIT, | |
| 160 BTIPS_BMG_EDITOR_CANCEL | |
| 161 }BTIPS_BMG_PHONENAME_EDITOR_EVENT; | |
| 162 | |
| 163 typedef struct _T_MMI_Btips_Bmg_PhoneName_Win_data | |
| 164 { | |
| 165 T_MMI_CONTROL mmi_control; | |
| 166 T_MFW_HND win; | |
| 167 T_MFW_HND mfwwin; | |
| 168 T_MFW_HND parent; | |
| 169 T_MFW_HND kbd; | |
| 170 SHORT id; | |
| 171 T_MFW_HND phoneName_editor; | |
| 172 UBYTE phoneNameBuffer[BT_MAX_REM_DEV_NAME]; /* pointer of text and number */ | |
| 173 BOOL local_device; //TRUE indicates Local device and FALSE indicates Remote Device | |
| 174 } T_MMI_Btips_Bmg_PhoneName_Win_data; | |
| 175 | |
| 176 typedef struct _T_MMI_Btips_Bmg_PinCode_Win_data | |
| 177 { | |
| 178 T_MMI_CONTROL mmi_control; | |
| 179 T_MFW_HND win; | |
| 180 T_MFW_HND mfwwin; | |
| 181 T_MFW_HND parent; | |
| 182 T_MFW_HND kbd; | |
| 183 SHORT id; | |
| 184 T_MFW_HND pinCode_editor; | |
| 185 UBYTE pinCodeBuffer[16]; /* pointer of text and number *///sundeep changed from 4 | |
| 186 } T_MMI_Btips_Bmg_PinCode_Win_data; | |
| 187 /********************************************************************* | |
| 188 BMG Editor END | |
| 189 *********************************************************************/ | |
| 190 | |
| 191 T_MFW_HND mmi_btips_bmg_pinCode_editor_create(MfwHnd parent_window); | |
| 192 T_MFW_HND mmi_btips_bmg_devices_win_create(T_MFW_HND parent, BOOL searchType, T_MFW_BTIPS_SEARCH_CB searchCB); | |
| 193 T_MFW_HND mmi_btips_bmg_services_editor_create(T_MFW_HND parent_win, SdpServicesMask sdpServicesMask); | |
| 194 #endif |
