# HG changeset patch # User Mychaela Falconia # Date 1604795903 0 # Node ID 332bff2bd3b4351546217fd6cc3b85cc7e1e38af # Parent 7160f0d005d254b9e4f1c71ad91ab1a7e7c4275a rm src/ui/bmi/mmiBtips* This code came from LoCosto version of BMI, but it is not compiled in our TCS2/TCS3 hybrid, and it is an area of functionality (Bluetooth) which we principally Do Not Want in FreeCalypso - so remove it. diff -r 7160f0d005d2 -r 332bff2bd3b4 src/ui/bmi/mmiBtips.c --- a/src/ui/bmi/mmiBtips.c Mon Oct 26 23:46:55 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,623 +0,0 @@ -/* ========================================================= -* Texas Instruments OMAP(TM) Platform Software -* (c) Copyright Texas Instruments, Incorporated. All Rights Reserved. -* -* Use of this software is controlled by the terms and conditions found -* in the license agreement under which this software has been supplied. -* ========================================================== */ -/* - $Project name: Basic Bluetooth MMI - $Project code: - $Module: Bluetooth BMG APPlication - $File: MmiBtipsBmg.c - $Revision: 1.0 - $Author: Texas Instruments - $Date: 26/06/07 - -******************************************************************************** - - Description: - - This module provides the BTIPS BMG APPlication functionality. - -******************************************************************************** - $History: MmiBtipsBmg.c - - 26/06/07 Sasken original version - - $End - -*******************************************************************************/ - - - - -/******************************************************************************* - - Include files - -*******************************************************************************/ - -#define ENTITY_MFW - -#include - -/* BTIPS Includes */ -#include "me.h" - -#if defined (NEW_FRAME) - -#include "typedefs.h" -#include "vsi.h" -#include "pei.h" -#include "custom.h" -#include "gsm.h" -#include "prim.h" - -#else - -#include "STDDEFS.H" -#include "custom.h" -#include "gsm.h" -#include "vsi.h" - -#endif - -#include "mfw_mfw.h" -#include "mfw_win.h" -#include "mfw_icn.h" /* included for mfw_mnu.h */ -#include "mfw_mnu.h" -#include "mfw_tim.h" -#include "mfw_kbd.h" -#include "mfw_sat.h" /* included for MmiDummy.h, included for MmiMenu.h */ -#include "MmiBlkLangDB.h" -#include "mmiColours.h" -#include "MmiDialogs.h" -#include "MmiDummy.h" /* included for MmiMenu.h */ -#include "MmiLists.h" -#include "MmiMenu.h" -#include "MmiSoftKeys.h" -#include "AUIEditor.h" -#include "MmiMain.h" -#include "Mmiicons.h" -#include "MmiWindow.h" -#include "MmiCall.h" -#include "mmiBookShared.h" - -/* GPF Includes */ -#include "typedefs.h" -#include "vsi.h" - -#include "Mfw_Btips.h" -#include "Mfw_BtipsBmg.h" -#include "mmiBtips.h" -#include "mmiBtipsBmg.h" - -#ifdef FF_MMI_BTIPS_APP -EXTERN char BTStr[20]; - -T_MFW_HND mmi_btips_app_win_create(T_MFW_HND parent); -static int mmi_btips_app_win_cb (MfwEvt evt, MfwWin *win); -static int mmi_btips_app_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter); -static void mmi_btips_app_exit (T_MFW_HND win); -static void mmi_btips_win_exit (T_MFW_HND win); - -MMI_Btips_data g_btipsData = {0}; -T_MFW_HND g_win_infodialog; - -void mmi_btips_init(void) -{ - TRACE_FUNCTION("mmiBtipsInit: Starting Bluetooth Initialization"); - if(0 == g_btipsData.ipBtipsHandle) - g_btipsData.ipBtipsHandle = aci_create(btipsPrimHandler,NULL); - mfw_btips_init(); -} - - -/******************************************************************************* - - $Function: mmi_btips_radioOnStatus - - $Description: Create the window which is going to have - the viewfinder bitmaps displayed on top of it. - - $Returns: Always returns MFW_EVENT_CONSUMED (1) - - $Arguments: m : pointer to the mnu data for the menu which caused this function to be called. - i : pointer to the item data from the menu. - -*******************************************************************************/ -USHORT mmi_btipsRadioOnStatus(struct MfwMnuTag *m, - struct MfwMnuAttrTag *ma, - struct MfwMnuItemTag *mi) -{ - if(mfw_btips_getRadioStatus()) - return TRUE; - else - return FALSE; -} - -/******************************************************************************* - - $Function: mmi_btips_radioOffStatus - - $Description: Create the window which is going to have - the viewfinder bitmaps displayed on top of it. - - $Returns: Always returns MFW_EVENT_CONSUMED (1) - - $Arguments: m : pointer to the mnu data for the menu which caused this function to be called. - i : pointer to the item data from the menu. - -*******************************************************************************/ -USHORT mmi_btipsRadioOffStatus(struct MfwMnuTag *m, - struct MfwMnuAttrTag *ma, - struct MfwMnuItemTag *mi) -{ - if(mfw_btips_getRadioStatus()) - return FALSE; - else - return TRUE; -} - -/******************************************************************************* - - $Function: mmi_btips_radioOn - - $Description: Create the window which is going to have - the viewfinder bitmaps displayed on top of it. - - $Returns: Always returns MFW_EVENT_CONSUMED (1) - - $Arguments: m : pointer to the mnu data for the menu which caused this function to be called. - i : pointer to the item data from the menu. - -*******************************************************************************/ - int mmi_btipsRadioOn(MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfwParent(mfw_header()); - - TRACE_FUNCTION ("mmi_btipsRadioOn()"); - return mfw_btips_radioOn(); -} - -/******************************************************************************* - - $Function: mmi_btips_radioOff - - $Description: Create the window which is going to have - the viewfinder bitmaps displayed on top of it. - - $Returns: Always returns MFW_EVENT_CONSUMED (1) - - $Arguments: m : pointer to the mnu data for the menu which caused this function to be called. - i : pointer to the item data from the menu. - -*******************************************************************************/ -GLOBAL int mmi_btipsRadioOff(void) -{ - TRACE_FUNCTION ("mmi_btipsRadioOff()"); - - return mfw_btips_radioOff(); -} - - -/****************************************************************************** - MFW Window Module (Creation, Deletion, Callbacks for MFW, Keyboard, etc) -******************************************************************************/ - - -void mmi_btips_app_incoming_pairing_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason) -{ - - TRACE_FUNCTION("mmi_btips_app_incoming_pairing_cb"); - - switch (reason) - { - case INFO_KCD_LEFT: - /*Launch the editor for taking pin-code request, with the parent as btips_main window, not this dialog*/ - g_btipsData.pinCode_editor = mmi_btips_bmg_pinCode_editor_create(win); - SEND_EVENT(g_btipsData.pinCode_editor, BTIPS_BMG_LOCAL_EDITOR_INIT, 0, 0); - break; - case INFO_KCD_HUP: - case INFO_KCD_RIGHT: - /*Reject the pairing operatio*/ - mfw_btips_bmgSendPin(&g_btipsData.bd_addr_incomingPinReq, NULL, 0); - break; - case INFO_KCD_CLEAR: - break; - default: - break; - } -} -/****************************************************************************** - MFW Window Module (Creation, Deletion, Callbacks for MFW, Keyboard, etc) -******************************************************************************/ -static void mmi_btips_app_push_pull_event_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason) -{ - TRACE_FUNCTION("mmi_btips_app_push_pull_event_cb"); - - switch (reason) - { - case INFO_KCD_LEFT: - mfw_btips_oppsAcceptObjectRequest(TRUE); - break; - - case INFO_KCD_HUP: - case INFO_KCD_RIGHT: - mfw_btips_oppsAcceptObjectRequest(FALSE); - break; - - case INFO_KCD_CLEAR: - /* Do nothing */ - break; - - default: - - break; - } -} - -static void mmi_btips_app_ftp_accept_cb (T_MFW_HND win, UBYTE identifier, UBYTE reason) -{ - TRACE_FUNCTION("mmi_btips_app_ftp_accept_cb"); - - switch (reason) - { - case INFO_KCD_LEFT: - TRACE_FUNCTION("mmi_btips_app_ftp_accept_cb: KCD LEFT"); - mfw_btips_ftpsAcceptObjectRequest (TRUE); - break; - - case INFO_KCD_HUP: - case INFO_KCD_RIGHT: - /*Reject the pairing operatio*/ - TRACE_FUNCTION("mmi_btips_app_ftp_accept_cb: KCD RIGHT"); - mfw_btips_ftpsAcceptObjectRequest (FALSE); - break; - case INFO_KCD_CLEAR: - break; - default: - break; - } -} - -static char ftpRequest[256]; - -/******************************************************************************* - - $Function: mmi_btips_app_root_cb - - $Description: This function is the notification from MFW to MMI for the BT Stack events that needs - updation on the BTIPS Main Window - - $Returns: None - - $Arguments: - -*******************************************************************************/ -int mmi_btips_app_root_cb(T_MFW_EVENT evnt, void *para) -{ - T_MFW_HND win = mfw_parent(mfw_header()); - MfwBtBmgEvent bmgBtEvent; - - TRACE_FUNCTION ("mmi_btips_app_root_cb()"); - TRACE_EVENT_P1("mmi_btips_app_root_cb - %d", evnt); - - - if(para != NULL) - { - bmgBtEvent = ((T_BTIPS_MMI_IND * )para)->data.bmgBtEvent; - } - switch (evnt) - { - case E_BTIPS_POWERON_SUCCESS: - TRACE_EVENT("E_BTIPS_POWERON_SUCCESS"); - mmi_btips_app_show_info(0,TxtBtipsApp,TxtBtipsOn,ONE_SECS,NULL); - break; - - case E_BTIPS_POWERON_FAILURE: - TRACE_EVENT("E_BTIPS_POWERON_FAILURE"); - mmi_btips_app_show_info(0,TxtBtipsApp,TxtBtipsFailed,ONE_SECS,NULL); - break; - - case E_BTIPS_BT_NOT_ON: - TRACE_EVENT("E_BTIPS_BT_NOT_ON"); - mmi_btips_app_show_info(0,TxtBtipsApp,TxtBtipsNotOn,ONE_SECS,NULL); - break; - - - case E_BTIPS_POWEROFF_SUCCESS: - TRACE_EVENT("E_BTIPS_POWEROFF_SUCCESS"); - mmi_btips_app_show_info(0,TxtBtipsApp,TxtBtipsOff,ONE_SECS,NULL); - break; - - case E_BTIPS_BMG_NAME_RESULT: - TRACE_EVENT("E_BTIPS_BMG_NAME_RESULT : mmibtips"); - if(TRUE == g_btipsData.incomingPinRequestState) - { - - //if(OS_MemCmp((U8*)&g_btipsData.bd_addr_incomingPinReq, sizeof(BD_ADDR), (U8*)&bmgBtEvent.bdAddr, sizeof(BD_ADDR))) - //{ - strcpy(g_btipsData.deviceName, bmgBtEvent.p.deviceName); - mmi_btips_app_ask_info(0, "Allow connection with", g_btipsData.deviceName, mmi_btips_app_incoming_pairing_cb); - - #if 0 - else - { - g_btipsData.incomingPinRequestState = FALSE; - //This case should not happen. - TRACE_ERROR("INCORRECT NAME RECEIVED FOR PIN_REQ"); - return MFW_EVENT_REJECTED; - } - #endif - } - else - { - return MFW_EVENT_REJECTED; - } - - break; - case E_BTIPS_INCOMING_PIN_REQ: - { - MfwBtBmgEvent bmgBtEvent = ((T_BTIPS_MMI_IND * )para)->data.bmgBtEvent; - TRACE_EVENT("E_BTIPS_INCOMING_PIN_REQ"); - OS_MemSet(g_btipsData.deviceName, 0, BT_MAX_REM_DEV_NAME); - OS_MemCopy((U8*)&g_btipsData.bd_addr_incomingPinReq, (U8*)&bmgBtEvent.bdAddr, sizeof(BD_ADDR)); - g_btipsData.incomingPinRequestState = TRUE; - } - break; - case E_BTIPS_BMG_PAIRING_COMPLETE: - { - MfwBtBmgEvent bmgBtEvent = ((T_BTIPS_MMI_IND * )para)->data.bmgBtEvent; - TRACE_EVENT("E_BTIPS_INCOMING_PIN_REQ"); - mfw_btips_bmgGetDeviceName(&bmgBtEvent.bdAddr, g_btipsData.deviceName); - mmi_btips_app_show_text(0, g_btipsData.deviceName, "Paired",NULL); - break; - } - - case E_BTIPS_FTPS_PUT_EVENT: - { - MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; - TRACE_EVENT("E_BTIPS_FTPS_PUT_EVENT"); -// sprintf (ftpRequest, "FTP Put %s", event.p.ftpPutRequest.objectName); -// mmi_btips_app_ask_info(0, ftpRequest, event.p.ftpPutRequest.deviceName, mmi_btips_app_ftp_accept_cb); - mmi_btips_app_ask_info(0, "FTP", "PUT", mmi_btips_app_ftp_accept_cb); - } - break; - - case E_BTIPS_FTPS_GET_EVENT: - { - MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; - TRACE_EVENT("E_BTIPS_FTPS_GET_EVENT"); - //sprintf (ftpRequest, "FTP Get %s", event.p.ftpGetRequest.objectName); - //mmi_btips_app_ask_info(0, ftpRequest, event.p.ftpGetRequest.deviceName, mmi_btips_app_ftp_accept_cb); - mmi_btips_app_ask_info(0, "FTP", " Get", mmi_btips_app_ftp_accept_cb);//sundeep - } - break; - - case E_BTIPS_FTPS_DELETE_EVENT: - { - MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; - TRACE_EVENT("E_BTIPS_FTPS_DELETE_EVENT"); -// sprintf (ftpRequest, "FTP Delete %s", event.p.ftpDeleteRequest.objectName); -// mmi_btips_app_ask_info(0, ftpRequest, event.p.ftpDeleteRequest.deviceName, mmi_btips_app_ftp_accept_cb); - mmi_btips_app_ask_info(0, "FTP", "DELETE", mmi_btips_app_ftp_accept_cb); - } - break; - /*case E_BTIPS_FTPS_COMPLETE_EVENT: - { - MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; - TRACE_EVENT("E_BTIPS_FTPS_COMPLETE_EVENT"); - //BTStr =GoepOpName1(event->ftpsEvent->oper); - mmi_btips_app_show_text(0, BTStr, "Completed",NULL); - break; - }*/ - case E_BTIPS_FTPS_CONNECT_EVENT: - { - MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; - TRACE_EVENT("E_BTIPS_FTPS_CONNECT_EVENT"); - mmi_btips_app_show_text(0, 0, "Connected",NULL); - } - break; - case E_BTIPS_FTPS_DISCONNECT_EVENT: - { - MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; - TRACE_EVENT("E_BTIPS_FTPS_DISCONNECT_EVENT"); - mmi_btips_app_show_text(0, 0, "Disconnected",NULL); - } - break; - case E_BTIPS_FTPS_ABORTED_EVENT: - { - MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; - TRACE_EVENT("E_BTIPS_FTPS_ABORTED_EVENT"); - mmi_btips_app_show_text(0, 0, "Aborted",NULL); - } - break; - case E_BTIPS_FTPS_PUT_COMP_EVENT: - { - MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; - TRACE_EVENT("E_BTIPS_FTPS_PUT_COMP_EVENT"); - mmi_btips_app_show_text(0, "PUT", "Completed",NULL); - } - break; - /*case E_BTIPS_FTPS_GET_COMP_EVENT: - { - MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; - TRACE_EVENT("E_BTIPS_FTPS_GET_COMP_EVENT"); - mmi_btips_app_show_text(0, "GET", "Completed",NULL); - } - break;*/ - case E_BTIPS_FTPS_DELETE_COMP_EVENT: - { - MfwBtFtpsEvent event = ((T_BTIPS_MMI_IND * )para)->data.ftpsBtEvent; - TRACE_EVENT("E_BTIPS_FTPS_DELETE_COMP_EVENT"); - mmi_btips_app_show_text(0, "DELETE", "Completed",NULL); - } - break; - case E_BTIPS_VG_CONNECT_EVENT: - { - MfwBtVgEvent event = ((T_BTIPS_MMI_IND * )para)->data.vgBtEvent; - mmi_btips_app_show_text (win, event.deviceName, "connected", NULL); - } - break; - - case E_BTIPS_VG_DISCONNECT_EVENT: - { - MfwBtVgEvent event = ((T_BTIPS_MMI_IND * )para)->data.vgBtEvent; - mmi_btips_app_show_text (win, "HF", "disconnected", NULL); - } - break; - - case E_BTIPS_VG_AUDIO_CONNECT_EVENT: - { - MfwBtVgEvent event = ((T_BTIPS_MMI_IND * )para)->data.vgBtEvent; - mmi_btips_app_show_text (win, "Audio", "connected", NULL); - } - break; - - case E_BTIPS_VG_AUDIO_DISCONNECT_EVENT: - { - MfwBtVgEvent event = ((T_BTIPS_MMI_IND * )para)->data.vgBtEvent; - mmi_btips_app_show_text (win, "Audio", "disconnected", NULL); - } - break; - case E_BTIPS_OPPS_PUSH_EVENT: - { - MfwBtOppsEvent oppsBtEvent = ((T_BTIPS_MMI_IND * )para)->data.oppsBtEvent; - U8 tempString1[256]; - TRACE_EVENT("E_BTIPS_OPPS_PUSH_EVENT"); - sprintf(tempString1, "Receive VCard %s from %s", oppsBtEvent.p.opps.oppObjectName, oppsBtEvent.p.opps.deviceName); - mmi_btips_app_ask_info(0, tempString1, oppsBtEvent.p.opps.deviceName, mmi_btips_app_push_pull_event_cb); - break; - } - - case E_BTIPS_OPPS_PULL_EVENT: - { - MfwBtOppsEvent oppsBtEvent = ((T_BTIPS_MMI_IND * )para)->data.oppsBtEvent; - U8 tempString1[256]; - TRACE_EVENT("E_BTIPS_OPPS_PULL_EVENT"); - sprintf(tempString1, "Send default VCard to %s", oppsBtEvent.p.opps.deviceName); - mmi_btips_app_ask_info(0, tempString1, oppsBtEvent.p.opps.deviceName, mmi_btips_app_push_pull_event_cb); - break; - } - -//#if 0 - case E_BTIPS_OPPS_PULL_COMP_EVENT: - { - MfwBtOppsEvent oppsBtEvent = ((T_BTIPS_MMI_IND * )para)->data.oppsBtEvent; - //mmi_btips_app_show_text(0, oppsBtEvent.p.opps.deviceName, "PULL Complete",NULL); - mmi_btips_app_show_text(0, "Sent", "VCard",NULL); - break; - } - - case E_BTIPS_OPPS_PUSH_COMP_EVENT: - { - MfwBtOppsEvent oppsBtEvent = ((T_BTIPS_MMI_IND * )para)->data.oppsBtEvent; - //mmi_btips_app_show_text(0, oppsBtEvent.p.opps.deviceName, "PUSH Complete",NULL); - mmi_btips_app_show_text(0, "Recived", "VCard",NULL); - break; - } - -//#endif - default: - TRACE_EVENT_P1("E_BTIPS_DEFAULT %d", evnt); - return MFW_EVENT_REJECTED; - } - dspl_Enable(1); - return MFW_EVENT_CONSUMED; -} - -/******************************************************************************* - - $Function: mmi_btips_app_show_info - - $Description: Displays the dialog box - - $Returns: Dialog window - - $Arguments: parent -parent window for dialog - str1- String to be displayed in dialog - str2 -String to be displayed in dialog - callback- Callback function - -*******************************************************************************/ -MfwHnd mmi_btips_app_show_info(T_MFW_HND parent, int str1, int str2, int timer,T_VOID_FUNC callback) -{ - T_DISPLAY_DATA display_info; - T_MFW_HND win; - - TRACE_FUNCTION ("mmi_btips_app_show_info()"); - - /* - ** Create a timed dialog to display the Message . - */ - dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, str1, str2, COLOUR_STATUS); - dlg_initDisplayData_events( &display_info, callback, timer, KEY_LEFT|KEY_RIGHT | KEY_CLEAR | KEY_HUP); - - win = info_dialog(parent, &display_info); - return win; -} - - -/******************************************************************************* - - $Function: mmi_fmRadio_app_show_info - - $Description: Displays the dialog box - - $Returns: Dialog window - - $Arguments: parent -parent window for dialog - str1- String to be displayed in dialog - str2 -String to be displayed in dialog - callback- Callback function - -*******************************************************************************/ -MfwHnd mmi_btips_app_show_text(T_MFW_HND parent, char * str1, char * str2, T_VOID_FUNC callback) -{ - T_DISPLAY_DATA display_info; - T_MFW_HND win; - /* - ** Create a timed dialog to display the Message . - */ - dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtNull, str1, str2, COLOUR_STATUS); - dlg_initDisplayData_events( &display_info, callback, ONE_SECS, KEY_LEFT|KEY_RIGHT | KEY_CLEAR | KEY_HUP); - - win = info_dialog(parent, &display_info); - return win; -} - -T_MFW_HND mmi_btips_app_ask_info(T_MFW_HND parent, char * str1, char * str2, T_VOID_FUNC callback) -{ - T_DISPLAY_DATA display_info; - - TRACE_FUNCTION("mmi_btips_app_ask_info"); - dlg_initDisplayData_TextStr( &display_info, TxtYes, TxtNo, str1, str2, COLOUR_STATUS); - dlg_initDisplayData_events( &display_info, callback, FOREVER, KEY_LEFT|KEY_RIGHT | KEY_CLEAR | KEY_HUP); - return info_dialog(parent,&display_info); -} - -GLOBAL int mmi_btips_services(MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfw_parent(mfw_header()); - - BOOL discoverServices = FALSE ; - - BOOL status; - - TRACE_EVENT_P1 ("mmi_btips_services() %d",discoverServices); - - status = mmi_btips_bmgDeviceShowServices(parent_win, discoverServices); - - if(status == SERVICESMASK_EMPTY) - { - discoverServices = TRUE; - g_win_infodialog = mmi_btips_app_show_info(0,TxtBtipsRefreshing,NULL,TEN_SECS,NULL); - mmi_btips_bmgDeviceShowServices(parent_win, discoverServices); - } - - return MFW_EVENT_CONSUMED; -} - -#endif diff -r 7160f0d005d2 -r 332bff2bd3b4 src/ui/bmi/mmiBtips.h --- a/src/ui/bmi/mmiBtips.h Mon Oct 26 23:46:55 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -#ifndef _MMIBTIPS_H_ -#define _MMIBTIPS_H_ - -/* ========================================================= -* Texas Instruments OMAP(TM) Platform Software -* (c) Copyright Texas Instruments, Incorporated. All Rights Reserved. -* -* Use of this software is controlled by the terms and conditions found -* in the license agreement under which this software has been supplied. -* ========================================================== */ -/* - $Project name: Basic Bluetooth MMI - $Project code: - $Module: Bluetooth BMG APPlication - $File: MmiBtipsBmg.h - $Revision: 1.0 - $Author: Texas Instruments - $Date: 26/06/07 - -******************************************************************************** - - Description: - - This module provides the BTIPS BMG APPlication functionality. - -******************************************************************************** - $History: MmiBtipsBmg.h - - 26/06/07 Sasken original version - - $End - -*******************************************************************************/ -#include "Bttypes.h" - -typedef struct _MMI_Btips_data -{ - int ipBtipsHandle; - /*Editor for Pincode request*/ - T_MFW_HND pinCode_editor; - /*Global Data related to BTIPS Application Statemachine*/ - U8 incomingPinRequestState; //TRUE for incoming and FALSE for bond request(out-going) - BD_ADDR bd_addr_incomingPinReq; - U8 deviceName[BT_MAX_REM_DEV_NAME + 1]; //of the current Bonding (IN/OUT) device -} MMI_Btips_data; - -/******************************************************************************* - - Public methods - -*******************************************************************************/ - -T_MFW_HND mfw_btips_create(T_MFW_HND hWin, T_MFW_EVENT event, MfwTyp type, T_MFW_CB cbfunc); -GLOBAL MfwHnd mmi_btips_app_show_info(T_MFW_HND parent, int str1, int str2,int timer, T_VOID_FUNC callback); -MfwHnd mmi_btips_app_show_text(T_MFW_HND parent, char * str1, char * str2, T_VOID_FUNC callback); -T_MFW_HND mmi_btips_app_ask_info(T_MFW_HND parent, char * str1, char * str2, T_VOID_FUNC callback); - -#endif diff -r 7160f0d005d2 -r 332bff2bd3b4 src/ui/bmi/mmiBtipsA2dp.c --- a/src/ui/bmi/mmiBtipsA2dp.c Mon Oct 26 23:46:55 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,610 +0,0 @@ -/* ========================================================= -* Texas Instruments OMAP(TM) Platform Software -* (c) Copyright Texas Instruments, Incorporated. All Rights Reserved. -* -* Use of this software is controlled by the terms and conditions found -* in the license agreement under which this software has been supplied. -* ========================================================== */ -/* - $Project name: Basic Bluetooth MMI - $Project code: - $Module: Bluetooth BMG APPlication - $File: MmiBtipsA2dp.c - $Revision: 1.0 - $Author: Texas Instruments - $Date: 26/06/07 - -******************************************************************************** - - Description: - - This module provides the BTIPS BMG APPlication functionality. - -******************************************************************************** - $History: MmiBtipsA2dp.c - - 26/06/07 Sasken original version - - $End - -*******************************************************************************/ - - - - -/******************************************************************************* - - Include files - -*******************************************************************************/ - -#define ENTITY_MFW - -#include - -/* BTIPS Includes */ -#include "me.h" - - -#if defined (NEW_FRAME) - -#include "typedefs.h" -#include "vsi.h" -#include "pei.h" -#include "custom.h" -#include "gsm.h" -#include "prim.h" - -#else - -#include "STDDEFS.H" -#include "custom.h" -#include "gsm.h" -#include "vsi.h" - -#endif - -#include "mfw_mfw.h" -#include "mfw_win.h" -#include "mfw_icn.h" /* included for mfw_mnu.h */ -#include "mfw_mnu.h" -#include "mfw_tim.h" -#include "mfw_kbd.h" -#include "mfw_sat.h" /* included for MmiDummy.h, included for MmiMenu.h */ -#include "MmiBlkLangDB.h" -#include "mmiColours.h" -#include "MmiDialogs.h" -#include "MmiDummy.h" /* included for MmiMenu.h */ -#include "MmiLists.h" -#include "MmiMenu.h" -#include "MmiSoftKeys.h" -#include "AUIEditor.h" -#include "MmiMain.h" -#include "Mmiicons.h" -#include "MmiWindow.h" -#include "MmiCall.h" -#include "mmiBookShared.h" - -#include "mmiBtips.h" -#include "mfw_btips.h" -#include "mfw_BtipsA2dp.h" -#include "mmiBtipsA2dp.h" -#include "mfw_BtipsBmg.h" -#include "mmiBtipsBmg.h" -#include "btl_a2dp.h" - - -int a2dp_files_count; -extern BtlA2dpStreamId streamId; -//Array to load fileNames in content directory -char* a2dp_file_names[A2DP_MAX_FILES]; -char* szSelectedFileExt; -char szSelectedFileName[256]; -#define A2DP_INFO_SCRN_TIMEOUT 1500//Timeout for InfoDialog -T_MFW_HND hA2dpDeviceWnd; - -#define A2DP_BMG_DEVICES_EXIT_WIN 5 - - -#ifdef FF_MMI_BTIPS_APP - -static T_MFW_HND mmi_btips_a2dpBuildMenu( MfwHnd parent_window); -static int mmi_btips_a2dpWinCb (MfwEvt e, MfwWin *w) ; - -static void mmi_btips_a2dpListMenuCb(T_MFW_HND Parent, ListMenuData * ListData); -static void mmi_btips_a2dpListMenuDestroy(MfwHnd window); -static MfwHnd mmi_btips_a2dpShowInfoDlg(T_MFW_HND parent, int str1, int str2, - T_VOID_FUNC callback); - - int mmi_btips_a2dpHandler(MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND win; - T_MFW_HND parent_win = mfw_parent(mfw_header()); - int numFiles=0; - - TRACE_FUNCTION ("mmi_btips_a2dpHandler"); - //mfw_btips_a2dpInit(); - a2dp_files_count = A2DP_MAX_FILES; - a2dp_files_count=mfw_btips_a2dpPopulateFiles(a2dp_file_names,A2DP_MAX_FILES, - BT_DEMO_FOLDER_PATH); - TRACE_FUNCTION_P1("mmi_btips_a2dpHandler: a2dp_files_count - %d", a2dp_files_count); - numFiles = mfw_btips_a2dpGetNumFiles(); - - TRACE_FUNCTION_P1("mmi_btips_a2dpHandler FileCount = %d",numFiles); - - if(numFiles <= 0) - { - mmi_btips_a2dpShowInfoDlg(0, TxtMidiFileNotLoaded, TxtNull, NULL); - - } - else - { - win = mmi_btips_a2dpBuildMenu(parent_win); - if (win NEQ NULL) - { - SEND_EVENT (win, BTIPS_A2DP_LIST_INIT, 0, 0); - } - - } - return MFW_EVENT_CONSUMED; - -} - -/******************************************************************************* - - $Function: mmi_btips_a2dpBuildMenu - - $Description: To hold list window - - $Returns: Window handle - - $Arguments: -*******************************************************************************/ - -static T_MFW_HND mmi_btips_a2dpBuildMenu( MfwHnd parent_window) -{ - T_MMI_Btips_A2dp_Win_data * data = (T_MMI_Btips_A2dp_Win_data *)mfwAlloc(sizeof (T_MMI_Btips_A2dp_Win_data)); - T_MFW_WIN * win; - - TRACE_FUNCTION ("mmi_btips_a2dpBuildMenu"); - - /* - * Create window handler - */ - - data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)mmi_btips_a2dpWinCb); - if (data->win EQ NULL) - { - return NULL; - } - - TRACE_EVENT("list holder window created: " ); - /* - * connect the dialog data to the MFW-window - */ - - data->mmi_control.dialog = (T_DIALOG_FUNC)mmi_btips_a2dpExecCb; - data->mmi_control.data = data; - win = ((T_MFW_HDR *)data->win)->data; - win->user = (void *)data; - data->parent = parent_window; - winShow(data->win); - /* - * return window handle - */ - - return data->win; -} - - -// Description: MIDI Player: Back Key malfunctions in MIDI application. -// Solution: A window is created to hold list window. When the user presses Back key, the newly -// created window is deleted along with list window, bringing the control back to Midi options -// screen. -/******************************************************************************* - - $Function: mmi_btips_a2dpWinCb - - $Description: Window event handler - - $Returns: MFW_EVENT_REJECTED: - MFW_EVENT_CONSUMED: - - $Arguments: - -*******************************************************************************/ -static int mmi_btips_a2dpWinCb(MfwEvt e, MfwWin *win) -{ - T_MMI_Btips_A2dp_Win_data *data = (T_MMI_Btips_A2dp_Win_data *)win->user; - - TRACE_FUNCTION ("mmi_btips_a2dpWinCb()"); - switch (e) - { - case MfwWinFocussed: /* input focus / selected */ - TRACE_EVENT("MfwWinFocussed"); - case MfwWinDelete: /* window will be deleted */ - TRACE_EVENT("MfwWinDelete"); - case MfwWinVisible: /* window is visible */ - TRACE_EVENT("MfwWinVisible"); - break; - case MfwWinSuspend: /* window is suspended */ - TRACE_EVENT("MfwWinSuspend"); - break; - case MfwWinResume: /* window is resumed */ - TRACE_EVENT("MfwWinResume"); - default: - return MFW_EVENT_REJECTED; - } - return MFW_EVENT_CONSUMED; -} - -// Description: MIDI Player: Back Key malfunctions in MIDI application. -// Solution: A window is created to hold list window. When the user presses Back key, the newly -// created window is deleted along with list window, bringing the control back to Midi options -// screen. -/******************************************************************************* - - $Function: mmi_btips_a2dpExecCb - - $Description: Call back function - - $Returns: none - - $Arguments: - -*******************************************************************************/ -void mmi_btips_a2dpExecCb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_MMI_Btips_A2dp_Win_data * data = (T_MMI_Btips_A2dp_Win_data *)win_data->user; - int max_file_number; - int i; - - ListWinInfo * mnu_data = (ListWinInfo *)parameter; - - TRACE_FUNCTION ("mmi_btips_a2dpExecCb()"); - switch (event) - { - T_MFW A2dpListCreationStatus; - case BTIPS_A2DP_LIST_INIT: - { - - TRACE_EVENT(" midi_test_files_exec_cb() Event:E_INIT"); - - /* initialization of administrative data */ - - data->menu_list_data = (ListMenuData *)ALLOC_MEMORY(sizeof(ListMenuData)); - - if(data->menu_list_data == 0) - { - TRACE_EVENT("Failed memory alloc 1 "); - return; - } - - max_file_number = mfw_btips_a2dpGetNumFiles(); - //In case no files have been loaded display info message - //In case no files have been loaded return info message - if(max_file_number == 0) - { - return; - } - - - data->menu_list_data->List = (T_MFW_MNU_ITEM *)ALLOC_MEMORY( max_file_number * sizeof(T_MFW_MNU_ITEM) ); - - if(data->menu_list_data->List == 0) - { - TRACE_EVENT("Failed memory alloc 2"); - return; - } - for (i = 0; i < max_file_number ; i++) - { - mnuInitDataItem(&data->menu_list_data->List[i]); - data->menu_list_data->List[i].flagFunc = item_flag_none; - //Display the A2DP file names in the list - data->menu_list_data->List[i].str = - (char *)mfw_btips_a2dpGetFileName(data->a2dp_file_count++); - } - - data->menu_list_data->ListLength =max_file_number; - data->menu_list_data->ListPosition = 1; - data->menu_list_data->CursorPosition = 1; - data->menu_list_data->SnapshotSize = max_file_number; - data->menu_list_data->Font = 0; - data->menu_list_data->LeftSoftKey = TxtSoftSelect; - data->menu_list_data->RightSoftKey = TxtSoftBack; - data->menu_list_data->KeyEvents = KEY_ALL; - data->menu_list_data->Reason = 0; - data->menu_list_data->Strings = TRUE; - data->menu_list_data->Attr = (MfwMnuAttr*)&BtipsA2dpList_Attrib; - data->menu_list_data->Attr->hdrId = TxtPlayerSelectFile; - data->menu_list_data->autoDestroy = FALSE; - A2dpListCreationStatus = - listDisplayListMenu (win, data->menu_list_data, - (ListCbFunc)mmi_btips_a2dpListMenuCb,0); - if (LISTS_OK == A2dpListCreationStatus) - { - #if 0 - /*If control reached this point then List of files are showed on display*/ - isMidiListON = TRUE; - /*Create one timer and play the file only if that timer expires*/ - /*Play the first file if user hasn't pressed the up and down for half a second */ - mfw_player_currently_playing_idx = 0; - midiBrowseTimer = timCreate( 0, TIME_HALFSECOND, (MfwCb)midi_test_play_browsing); - timStart( midiBrowseTimer ); - #endif - } - } - break; - default: - break; - } - -} -/******************************************************************************* - - $Function: midi_mt_menu_list_listmnu_cb - - $Description: destroy lists and menu in case of back softkey or menu exit - - $Returns: - - $Arguments: - -*******************************************************************************/ -static void mmi_btips_a2dpListMenuCb(T_MFW_HND Parent, ListMenuData * ListData) -{ - T_MFW_WIN *win_data = ((T_MFW_HDR *)Parent)->data; - T_MMI_Btips_A2dp_Win_data *data = (T_MMI_Btips_A2dp_Win_data *)win_data->user; - - TRACE_FUNCTION ("mmi_btips_a2dpListMenuCb()"); - - if ((ListData->Reason EQ LISTS_REASON_BACK) || - (ListData->Reason EQ LISTS_REASON_CLEAR) || - (ListData->Reason EQ LISTS_REASON_HANGUP)) - { - mfw_btips_a2dpCloseStream(); - /* - ** Destroy the window --- Not sure if this is required! ... leave it out for now - */ - listsDestroy(ListData->win); - - /* - ** Free the memory set aside for ALL the devices to be listed. - */ - if (data->menu_list_data != NULL) - { - FREE_MEMORY ((void *)data->menu_list_data->List, (U16)(data->a2dp_num_file * sizeof (T_MFW_MNU_ITEM))); - FREE_MEMORY ((void *)data->menu_list_data, sizeof (ListMenuData)); - } - - mmi_btips_a2dpListMenuDestroy(data->win); - #if 0 - // June 19, 2006 REF: DRT OMAPS00076378 x0012849 - /*At this point the MIDI list is destroyed*/ - isMidiListON = FALSE; - /* At this point the play need to be stopped. If user wants the file need to - be played while going across menu then 'play' or 'play all' need to be selected */ - midi_stop_player (NULL, NULL); - if (midiBrowseTimer != NULL) - { - // Delete the timer. It's not required any more. - timDelete (midiBrowseTimer); - } - #endif - } - else if(ListData->Reason EQ LISTS_REASON_SELECT) - { - OS_MemSet(szSelectedFileName, 0, sizeof(szSelectedFileName)); - OS_StrCpy(szSelectedFileName, BT_DEMO_FOLDER_PATH); - OS_StrCat(szSelectedFileName, "/"); - OS_StrCat(szSelectedFileName, mfw_btips_a2dpGetFileName(ListData->CursorPosition)); - TRACE_EVENT_P1("szSelectedFileName: %s", szSelectedFileName); - //szSelectedFileName = mfw_btips_a2dpGetFileName(ListData->CursorPosition); - - //OS_StrCpy(szSelectedFileName, "/MfwBtDemo/base_fadeout.wav"); - szSelectedFileExt = mfw_btips_a2dpGetExtension(szSelectedFileName); - if(streamId >= 0) - { - TRACE_EVENT("Closing stream in mmi_btips_a2dpListMenuCb After selecting new file"); - mfw_btips_a2dpCloseStream(); - } - if(FALSE == data->deviceSearchStarted) - { - - data->deviceSearchStarted = TRUE; - if ( (strcmp(szSelectedFileExt, "mp3") == 0)) - { - - mmi_btips_a2dpDeviceSearchWnd(); - } - else if ( (strcmp(szSelectedFileExt, "pcm") == 0)) - { - - mmi_btips_a2dpDeviceSearchWnd(); - } - else if ( (strcmp(szSelectedFileExt, "wav") == 0)) - { - - mmi_btips_a2dpDeviceSearchWnd(); - } - else - { - //It should never come here - TRACE_ERROR("invalid file name"); - } - } - #if 0 - TRACE_EVENT_P1("list position is %d",ListData->ListPosition); - mt_menu_data.mt_list_idx = ListData->ListPosition; - //call mfw to save selected index - mfw_player_save_selected_file_idx(mt_menu_data.mt_list_idx); - //display a "file selected" text here - mmi_midi_test_show_info(0, TxtMidiFileSelected, TxtNull, NULL); - #endif - } - - - return; -} -/******************************************************************************* - - $Function: mmi_btips_a2dpListMenuDestroy - - $Description: destroy menu window - - $Returns: - - $Arguments: window to be destroyed - -*******************************************************************************/ -static void mmi_btips_a2dpListMenuDestroy(MfwHnd window) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *)window)->data; - T_MMI_Btips_A2dp_Win_data * data = (T_MMI_Btips_A2dp_Win_data *)win_data->user; - - TRACE_FUNCTION ("mmi_btips_a2dpListMenuDestroy"); - - if (window == NULL) - { - return; - } - - if (data) - { - win_delete(data->win); - - /* - ** Free Memory - */ - mfwFree((void *)data, sizeof (T_MMI_Btips_A2dp_Win_data)); - } -} -/******************************************************************************* - - $Function: mmi_btips_a2dpShowInfoDlg - - $Description: Display the Dialog - - $Returns: - - $Arguments: - -*******************************************************************************/ -static MfwHnd mmi_btips_a2dpShowInfoDlg(T_MFW_HND parent, int str1, int str2, T_VOID_FUNC callback) -{ - T_DISPLAY_DATA display_info; - - TRACE_FUNCTION ("mmi_btips_a2dpShowInfoDlg()"); - - /* - ** Create a timed dialog to display the Message "Failed" - */ - dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, str1, str2, COLOUR_STATUS); - dlg_initDisplayData_events( &display_info, callback, A2DP_INFO_SCRN_TIMEOUT, KEY_LEFT | KEY_CLEAR | KEY_HUP); - - return info_dialog(parent, &display_info); -} -/******************************************************************************* - - $Function: mmi_btips_a2dpPlayOnSingleDevice - - $Description: - - $Returns: - - $Arguments: - -*******************************************************************************/ -int mmi_btips_a2dpPlayOnSingleDevice(MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfwParent(mfw_header()); - TRACE_FUNCTION("mmi_btips_a2dpPlayOnSingleDevice"); - mfw_btips_bmgSearch(BTIPS_A2DP_DEVICE_SEARCH); - return MFW_EVENT_CONSUMED; -} -/******************************************************************************* - - $Function: mmi_btips_a2dpPlayOnMultipleDevice - - $Description: - - $Returns: - - $Arguments: - -*******************************************************************************/ -int mmi_btips_a2dpPlayOnMultipleDevice(MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfwParent(mfw_header()); - //mmi_btips_app_show_info(parent_win,TxtBtipsShowPhone,TxtSelected,ONE_SECS,NULL); - //mfw_BtipsBmgSetPhoneVisibility(True); - return MFW_EVENT_CONSUMED; -} - -int mmi_btips_a2dpDeviceSearchWnd() -{ - T_MFW_HND parent_win = mfwParent(mfw_header()); - hA2dpDeviceWnd = (T_MFW_HND)mmi_btips_bmg_devices_win_create(parent_win, BTIPS_A2DP_DEVICE_SEARCH, mmi_btips_a2dpDeviceSearchCallback); - return MFW_EVENT_CONSUMED; -} - -T_MFW_HND mmi_btips_a2dp_ask_cancelStreaming(T_MFW_HND parent, char * str1, char * str2, T_VOID_FUNC callback) -{ - T_DISPLAY_DATA display_info; - - TRACE_FUNCTION("mmi_btips_a2dp_ask_cancelStreaming"); - dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtStop, str1, str2, COLOUR_STATUS); - dlg_initDisplayData_events( &display_info, callback, FOREVER, KEY_LEFT|KEY_RIGHT | KEY_CLEAR | KEY_HUP); - return info_dialog(parent,&display_info); -} - -void mmi_btips_a2dp_streaming_stop_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason) -{ - - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_dialog_info * data = (T_dialog_info *)win_data->user; - - T_MFW_WIN *parent_win_data = ((T_MFW_HDR *) data->parent_win)->data; - /* T_MMI_Btips_Bmg_DevicesWin_data * parent_data = (T_MMI_Btips_Bmg_DevicesWin_data *)parent_win_data->user; - T_MFW_HND parent_win = parent_data->win; -*/ - TRACE_FUNCTION_P1("mmi_btips_a2dp_streaming_stop_cb %d", reason); - - switch (reason) - { - case INFO_KCD_LEFT: - TRACE_ERROR("No LSK"); - break; - case INFO_KCD_HUP: - case INFO_KCD_RIGHT: - mfw_btips_a2dpCloseStream(); - break; - case INFO_KCD_CLEAR: - break; - default: - break; - } -} - - - -int mmi_btips_a2dpDeviceSearchCallback(BD_ADDR bdAddr) -{ - T_MFW_HND parent_win = mfwParent(mfw_header()); - - BtStatus status; - static char szDevName[128]; - SEND_EVENT ( hA2dpDeviceWnd, BTIPS_BMG_DEVICES_EXIT_WIN, 0, (void *)NULL); - vsi_t_sleep(0, 10); - mfw_btips_bmgGetDeviceName(&bdAddr, szDevName); - TRACE_EVENT_P1("mmi_btips_a2dpDeviceSearchCallback with Dev Name %s", szDevName); - - /*Now update the state machine so that when user comes back to this menu - He should be able to STOP playing A2DP OR Select another file to Play*/ -// mmi_btips_a2dp_ask_cancelStreaming(NULL, "Streaming Audio to", szDevName, mmi_btips_a2dp_streaming_stop_cb); - status = mfw_btips_a2dpConnectStream(bdAddr); - return status; -} -#endif - diff -r 7160f0d005d2 -r 332bff2bd3b4 src/ui/bmi/mmiBtipsA2dp.h --- a/src/ui/bmi/mmiBtipsA2dp.h Mon Oct 26 23:46:55 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -#ifndef _MMIBTIPS_A2DP_H_ -#define _MMIBTIPS_A2DP_H_ - -/* ========================================================= -* Texas Instruments OMAP(TM) Platform Software -* (c) Copyright Texas Instruments, Incorporated. All Rights Reserved. -* -* Use of this software is controlled by the terms and conditions found -* in the license agreement under which this software has been supplied. -* ========================================================== */ -/* - $Project name: Basic Bluetooth A2DP MMI - $Project code: - $Module: Bluetooth A2DP APPlication - $File: MmiBtipsA2dp.h - $Revision: 1.0 - $Author: Texas Instruments - $Date: 26/06/07 - -******************************************************************************** - - Description: - - This module provides the BTIPS BMG APPlication functionality. - -******************************************************************************** - $History: MmiBtipsA2dp.h - - 26/06/07 Sasken original version - - $End - -*******************************************************************************/ - - -/* ====================================================== */ -/* -* List Attribute -*/ -/* ====================================================== */ -static const MfwMnuAttr BtipsA2dpList_Attrib = -{ - &menuArea, - MNU_LEFT| MNU_LIST_ICONS| MNU_CUR_LINE, /* centered page menu */ - (U8)-1, /* use default font */ - NULL, /* with these items */ - 0, /* number of items */ - COLOUR_LIST_XX, - TxtBtipsA2dp, - NULL, - MNUATTRSPARE -}; - - -typedef struct _T_MMI_Btips_A2dp_Win_data -{ - T_MMI_CONTROL mmi_control; - T_MFW_HND parent; - T_MFW_HND win; - T_MFW_HND kbd; - T_MFW_HND kbd_long; - T_MFW_HND a2dp_optionsMenu; - - - T_VOID_FUNC func_cb; - T_VOID_FUNC cancel_cb; - UBYTE a2dp_num_file; - UBYTE a2dp_file_count; - ListCbFunc a2dp_list_cb; - UBYTE a2dp_list_idx; - UBYTE IsMfwInit; - ListMenuData * menu_list_data; - BOOL deviceSearchStarted; - -}T_MMI_Btips_A2dp_Win_data; - -typedef enum { - BTIPS_A2DP_LIST_INIT=0, - BTIPS_A2DP_LIST_DEINIT -}BTIPS_A2DP_WIN_EVENT; - -/*Function Declarations*/ - int mmi_btips_a2dpHandler(MfwMnu* m, MfwMnuItem* i); -void mmi_btips_a2dpExecCb (T_MFW_HND win, USHORT event, SHORT value, void * parameter); -int mmi_btips_a2dpDeviceSearchCallback(BD_ADDR bdAddr); - -#endif diff -r 7160f0d005d2 -r 332bff2bd3b4 src/ui/bmi/mmiBtipsBmg.c --- a/src/ui/bmi/mmiBtipsBmg.c Mon Oct 26 23:46:55 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2338 +0,0 @@ -/* ========================================================= -* Texas Instruments OMAP(TM) Platform Software -* (c) Copyright Texas Instruments, Incorporated. All Rights Reserved. -* -* Use of this software is controlled by the terms and conditions found -* in the license agreement under which this software has been supplied. -* ========================================================== */ -/* - $Project name: Basic Bluetooth MMI - $Project code: - $Module: Bluetooth BMG APPlication - $File: MmiBtipsBmg.c - $Revision: 1.0 - $Author: Texas Instruments - $Date: 26/06/07 - -******************************************************************************** - - Description: - - This module provides the BTIPS BMG APPlication functionality. - -******************************************************************************** - $History: MmiBtipsBmg.c - - 26/06/07 Sasken original version - - $End - -*******************************************************************************/ - - - - -/******************************************************************************* - - Include files - -*******************************************************************************/ - -#define ENTITY_MFW - -#include - -/* BTIPS Includes */ -#include "me.h" - - -#if defined (NEW_FRAME) - -#include "typedefs.h" -#include "vsi.h" -#include "pei.h" -#include "custom.h" -#include "gsm.h" -#include "prim.h" - -#else - -#include "STDDEFS.H" -#include "custom.h" -#include "gsm.h" -#include "vsi.h" - -#endif - -#include "mfw_mfw.h" -#include "mfw_win.h" -#include "mfw_icn.h" /* included for mfw_mnu.h */ -#include "mfw_mnu.h" -#include "mfw_tim.h" -#include "mfw_kbd.h" -#include "mfw_sat.h" /* included for MmiDummy.h, included for MmiMenu.h */ -#include "MmiBlkLangDB.h" -#include "mmiColours.h" -#include "MmiDialogs.h" -#include "MmiDummy.h" /* included for MmiMenu.h */ -#include "MmiLists.h" -#include "MmiMenu.h" -#include "MmiSoftKeys.h" -#include "AUIEditor.h" -#include "MmiMain.h" -#include "Mmiicons.h" -#include "MmiWindow.h" -#include "MmiCall.h" -#include "mmiBookShared.h" - -#include "mfw_Btips.h" -#include "Mfw_BtipsBmg.h" - -#include "mmiBtips.h" -#include "MmiBtipsBmg.h" -#include "AUIEditor_i.h" -CHAR noDeviceString[] = "No Devices"; -CHAR FindNewDeviceString[] = "Find New Device"; -CHAR SearchingDeviceString[] = "Searching Devices..."; - -extern MMI_Btips_data g_btipsData; -//UBYTE g_device_name[BT_MAX_REM_DEV_NAME] ; -T_MMI_BTIPS_SERVICES_STRUCT *services_data; -extern T_MFW_HND g_win_infodialog; - -#ifdef FF_MMI_BTIPS_APP -//Global Function calls -static int mmi_btips_bmg_devices_root_cb(T_MFW_EVENT evnt, void *para); -//static int mmi_btips_bmg_connected_devices_root_cb(T_MFW_EVENT evnt, void *para); -static int mmi_btips_bmg_devices_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter); -static int mmi_btips_bmg_connected_devices_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter); -static int mmi_btips_bmg_devices_win_cb (MfwEvt evt, MfwWin *win); -static int mmi_btips_bmg_connected_devices_win_cb (MfwEvt evt, MfwWin *win) ; -static int mmi_btips_bmg_devices_kbd_cntrl (MfwEvt e, MfwKbd *k); -static void mmi_btips_bmg_devices_win_exit (T_MFW_HND win); -static void mmi_btips_bmg_connected_devices_win_exit (T_MFW_HND win); -static T_MFW_HND mmi_btips_bmg_phoneName_editor_create(MfwHnd parent_window); -static void mmi_btips_bmg_phoneName_editor_exec_cb(T_MFW_HND win, USHORT event, void *parameter); -static void mmi_btips_bmg_phoneName_editor_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason); -static void mmi_btips_bmg_phoneName_editor_destroy(MfwHnd own_window); -T_MFW_HND mmi_btips_bmg_ShowPairedDeviceList(T_MFW_HND win); -T_MFW_HND mmi_btips_bmg_ShowConnectedDevicesList(T_MFW_HND win); -T_MFW_HND mmi_btips_bmg_ShowInquiredDeviceList(T_MFW_HND win); -static void mmi_btips_bmg_device_list_cb(T_MFW_HND * parent, ListMenuData * ListData); -static void mmi_btips_bmg_connected_device_list_cb(T_MFW_HND * parent, ListMenuData* ListConnectedData); -static void mmi_btips_bmg_pinCode_editor_exec_cb(T_MFW_HND win, USHORT event, void *parameter); -static void mmi_btips_bmg_pinCode_editor_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason); -static void mmi_btips_bmg_pinCode_editor_destroy(MfwHnd own_window); -static int mmi_btips_bmg_SetConnectPermission(T_MFW_HND win, BOOL permission); -BOOL mmi_btips_bmgDeviceShowServices(T_MFW_HND win , BOOL discoverServices); -static void mmi_btips_bmg_services_editor_exec_cb(T_MFW_HND win, USHORT identifier, SHORT reason); -void mmi_btips_bmg_services_editor_destroy(void); -T_MFW_HND mmi_btips_bmg_ask_cancelBond(T_MFW_HND parent, char * str1, char * str2, T_VOID_FUNC callback); -void mmi_btips_bmg_bonding_cancelled_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason); -void mmi_btips_refreshScreen(T_MFW_HND win, UBYTE identifier, UBYTE reason); -void mmi_btips_ResumeBTMainMenu(T_MFW_HND win, UBYTE identifier, UBYTE reason); -extern void mmi_btips_app_incoming_pairing_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason); -/****************************************************************************** - MFW BTIPS BMG Window Module (Creation, Deletion, Callbacks for MFW, Keyboard, etc) -******************************************************************************/ - -/******************************************************************************* - - $Function: mmi_btips_bmg_devices_win_create - - $Description: This function performs the necessary steps to create the a window to handle the - viewfinder related softkeys and the viewfinder bitmaps. It will be removed, - or rather remove itself on returning the data to the Mfw. - - $Returns: T_MFW_HND : Window Handle to the New Window, Null if failed. - - $Arguments: parent : pointer to the parent window. - -*******************************************************************************/ -T_MFW_HND mmi_btips_bmg_devices_win_create(T_MFW_HND parent, BOOL searchType, T_MFW_BTIPS_SEARCH_CB searchCB) -{ - T_MMI_Btips_Bmg_DevicesWin_data *data; - T_MFW_WIN * win; - - TRACE_FUNCTION ("mmi_btips_bmg_devices_win_create()"); - data = (T_MMI_Btips_Bmg_DevicesWin_data *)mfwAlloc((U16)sizeof(T_MMI_Btips_Bmg_DevicesWin_data)); - - data->win =(T_MFW_WIN * ) winCreate(parent, 0, MfwWinVisible|MfwWinSuspend|MfwWinResume|MfwWinDelete, - (MfwCb)mmi_btips_bmg_devices_win_cb); - TRACE_EVENT_P2("New window - %x , parent = %x",parent,data->win); - - if (data->win == NULL) - { - - //Failed to start : Free Memory, and exit - mfwFree((U8 *)data, (U16)sizeof(T_MMI_Btips_Bmg_DevicesWin_data)); - data = NULL; - return data; - } - else - { - - /* - ** Setup the Dialog control functions - */ - data->mmi_control.dialog = (T_DIALOG_FUNC)mmi_btips_bmg_devices_exec_cb; - data->mmi_control.data = data; - data->parent=parent; - win = (T_MFW_WIN *)getWinData(data->win); - win->user = (void *)data; - - //Create a BTIPS MFW component - if (data->mfwwin == NULL) - { - data->mfwwin = (T_MFW_HND)mfw_btips_create(data->win, - E_BTIPS_BMG_NAME_RESULT|E_BTIPS_BMG_SEARCH_COMPLETE| - E_BTIPS_BMG_SEARCH_CANCELLED|E_BTIPS_BMG_BOND_COMPLETE| - E_BTIPS_BMG_DEVICE_SERVICES|E_BTIPS_BMG_BOND_CANCELLED, - MfwTyBtipsBmg, (MfwCb)mmi_btips_bmg_devices_root_cb); - } - if (data->mfwwin== NULL) - { - TRACE_EVENT ("mfwwin create failed"); - /* - ** BTIPS mfw Component Failed to start - */ - winDelete(data->win); - return NULL; - } - - data->bondState = BOND_NOT_STARTED; - data->inquiryState = INQUIRY_NOT_STARTED; - data->searchCB = searchCB; - data->searchType = searchType; - - if (data->win NEQ NULL) - { - data->listID= SHOW_PAIRED_LIST; - data->list_win = mmi_btips_bmg_ShowPairedDeviceList(data->win); - } - - } - - /*Do the initialization of MMI BTIPS state-machine here, if any*/ - TRACE_EVENT_P1("mmi_btips_bmg_devices_win_create - new window %x", data->win); - - return data->win; - -} -/******************************************************************************* - - $Function: mmi_btips_bmg_connected_devices_win_create - - $Description: This function performs the necessary steps to create the a window to handle the - viewfinder related softkeys and the viewfinder bitmaps. It will be removed, - or rather remove itself on returning the data to the Mfw. - - $Returns: T_MFW_HND : Window Handle to the New Window, Null if failed. - - $Arguments: parent : pointer to the parent window. - -*******************************************************************************/ -T_MFW_HND mmi_btips_bmg_connected_devices_win_create(T_MFW_HND parent, BOOL searchType, T_MFW_BTIPS_SEARCH_CB searchCB) //CONNECTED -{ - - T_MMI_Btips_Bmg_DevicesWin_data *data; - T_MFW_WIN * win; - - TRACE_FUNCTION ("mmi_btips_bmg_connected_devices_win_create()"); - data = (T_MMI_Btips_Bmg_DevicesWin_data *)mfwAlloc((U16)sizeof(T_MMI_Btips_Bmg_DevicesWin_data)); - - data->win =(T_MFW_WIN * ) winCreate(parent, 0, MfwWinVisible|MfwWinSuspend|MfwWinResume|MfwWinDelete, (MfwCb)mmi_btips_bmg_connected_devices_win_cb); - TRACE_EVENT_P2("New window - %x , parent = %x",parent,data->win); - - if (data->win == NULL) - { - - //Failed to start : Free Memory, and exit - mfwFree((U8 *)data, (U16)sizeof(T_MMI_Btips_Bmg_DevicesWin_data)); - data = NULL; - return data; - } - else - { - - /* - ** Setup the Dialog control functions - */ - data->mmi_control.dialog = (T_DIALOG_FUNC)mmi_btips_bmg_connected_devices_exec_cb; - data->mmi_control.data = data; - data->parent=parent; - win = (T_MFW_WIN *)getWinData(data->win); - win->user = (void *)data; - - - if (data->win NEQ NULL) - { - //data->listID= SHOW_PAIRED_LIST; - TRACE_FUNCTION("data->win NEQ NULL"); - data->list_connected_win = mmi_btips_bmg_ShowConnectedDevicesList(data->win); - } - - } - - /*Do the initialization of MMI BTIPS state-machine here, if any*/ - TRACE_EVENT_P1("mmi_btips_bmg_devices_win_create - new window %x", data->win); - - return data->win; -} -/******************************************************************************* - - $Function: mmi_btips_bmg_devices_root_cb - - $Description: This function is the notification from MFW to MMI for the FM Stack events that needs - updation on the FM Radio Main Window - - $Returns: None - - $Arguments: - -*******************************************************************************/ -static int mmi_btips_bmg_devices_root_cb(T_MFW_EVENT evnt, void *para) -{ - T_MFW_HND win = mfw_parent(mfw_header()); - T_MFW_WIN * win_data; - T_MMI_Btips_Bmg_DevicesWin_data *data; - MfwBtBmgEvent bmgBtEvent; - - win_data = ((T_MFW_HDR *) win)->data; - data = (T_MMI_Btips_Bmg_DevicesWin_data *)win_data->user; - if(para != NULL) - { - bmgBtEvent = ((T_BTIPS_MMI_IND * )para)->data.bmgBtEvent; - } - - TRACE_FUNCTION_P1("mmi_btips_bmg_devices_root_cb - %d", evnt); - switch (evnt) - { - case E_BTIPS_BMG_NAME_RESULT: - /*Copy BD_ADDR and DeviceName from the Para*/ - if(INQUIRY_STARTED == data->inquiryState) - { - OS_MemCopy((U8*)&data->deviceList[data->noInquiredDevices].bdAddr, (U8*)&bmgBtEvent.bdAddr, sizeof(BD_ADDR)); - strcpy(data->deviceList[data->noInquiredDevices].name, bmgBtEvent.p.deviceName); - data->deviceList[data->noInquiredDevices].myIndex = data->noInquiredDevices; - data->noInquiredDevices++; - - /*Signal to create a new list with all newly found devices once the current list is deleted*/ - SEND_EVENT (data->win, BTIPS_BMG_INQUIRY_RESULT_DEVICES_INIT,0, (void *)NULL); - /*Delete the current list whatever - previous window showing paired devices or - the window showing the devices being discovered*/ - SEND_EVENT (data->win, BTIPS_BMG_DEVICES_LIST_WIN_DEINIT, 0, (void *)NULL); - } - else - return MFW_EVENT_REJECTED; - break; - - case E_BTIPS_BMG_SEARCH_COMPLETE: - data->inquiryState = INQUIRY_COMPLETE; - /*Signal to create a new list with all newly found devices once the current list is deleted*/ - SEND_EVENT (data->win, BTIPS_BMG_INQUIRY_RESULT_DEVICES_INIT,0, (void *)NULL); - /*Delete the current list : window showing the devices being discovered - Title should change to Find New Device*/ - SEND_EVENT (data->win, BTIPS_BMG_DEVICES_LIST_WIN_DEINIT, 0, (void *)NULL); - break; - - case E_BTIPS_BMG_SEARCH_CANCELLED: -#if 0 -/*We fail to get this event, hence commented for the time-being*/ - /*User might have requested to do a bonding while the inquiry was ongoing - Now that the inquiry is cancelled, start the bond-process*/ - if(BOND_USER_REQUESTED == data->bondState) - SEND_EVENT (data->win, BTIPS_BMG_BONDING_REQUEST_INIT, 0, (void *)NULL); -#endif - break; - - case E_BTIPS_BMG_BOND_COMPLETE: - { - MfwBtBmgEvent bmgBtEvent = ((T_BTIPS_MMI_IND * )para)->data.bmgBtEvent; - TRACE_EVENT_P1("E_BTIPS_BMG_BOND_COMPLETE: current state = %d", data->bondState); - - - if(BOND_PIN_TAKEN == data->bondState) - { - data->bondState = BOND_NOT_STARTED; - - if (bmgBtEvent.errCode == 0) //Success - { - mmi_btips_app_show_text(win, "Bonded with",data->deviceList[data->currentListIndex-1].name, NULL); - } - else - { - mmi_btips_app_show_text(win, "Bond failed with",data->deviceList[data->currentListIndex-1].name, NULL); - } - //26-07-07 - mfw_btips_bmgSetDeviceNameInRecord(&data->deviceList[data->currentListIndex-1].bdAddr, data->deviceList[data->currentListIndex-1].name); - - dialog_info_destroy(data->bondCancellationWindow); - data->bondCancellationWindow = NULL; - - if(BTIPS_GENERIC_DEVICE_SEARCH == data->searchType) - { - SEND_EVENT (data->win, BTIPS_BMG_PAIRED_DEVICES_INIT,0, (void *)NULL); - } - else - { - if (bmgBtEvent.errCode == 0) - data->searchCB(data->deviceList[data->currentListIndex-1].bdAddr); - else - { - BD_ADDR bdAddr = {0}; - data->searchCB(bdAddr); - } - } - } - break; - } - case E_BTIPS_BMG_BOND_CANCELLED: -#if 0 - /*Signal to create a new list with all newly found devices once the current list is deleted*/ - SEND_EVENT (data->win, BTIPS_BMG_PAIRED_DEVICES_INIT,0, (void *)NULL); - /*Delete the current list whatever - previous window showing paired devices or - the window showing the devices being discovered*/ - SEND_EVENT (data->win, BTIPS_BMG_DEVICES_LIST_WIN_DEINIT, 0, (void *)NULL); -#endif - break; - - case E_BTIPS_BMG_DEVICE_SERVICES : - - TRACE_EVENT_P1(" mmi_btips_bmg_devices_root_cb services mask %x",bmgBtEvent.p.discoveredServicesMask); - dialog_info_destroy (g_win_infodialog); - if(bmgBtEvent.p.discoveredServicesMask) - mfw_btips_bmgSetDeviceRecord(&bmgBtEvent.bdAddr, bmgBtEvent.p.discoveredServicesMask); - - mmi_btips_bmg_services_editor_create(win , bmgBtEvent.p.discoveredServicesMask); - break; - - default: - TRACE_EVENT("E_BTIPS_BMG_DEFAULT"); - return MFW_EVENT_REJECTED; - } - - dspl_Enable(1); - return MFW_EVENT_CONSUMED; -} - - -/******************************************************************************* - - $Function: mmi_btips_bmg_devices_exec_cb - - $Description: This is the dialog control function for the FMRadio Window. It - receives the signals from the MFW and determines what action, if any, to take. - - $Returns: None - - $Arguments: win : The pointer to the window handler, so the function can reference the - dynamic user data, if any. - event : The incoming event - value : Generic incoming Parameter, it will be 'event' dependant - parameter : Generic incoming Parameter, it will be 'event' dependant - -*******************************************************************************/ -static int mmi_btips_bmg_devices_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_MMI_Btips_Bmg_DevicesWin_data * data = (T_MMI_Btips_Bmg_DevicesWin_data *)win_data->user; - - TRACE_FUNCTION("mmi_btips_bmg_devices_exec_cb()"); - TRACE_EVENT_P2("mmi_btips_bmg_devices_exec_cb - list-win - %x %d", data->list_win, event); - - switch (event) - { - case BTIPS_BMG_PAIRED_DEVICES_INIT: - /*Create the Paired device List in Resume of mmi_btips_bmg_devices_win_cb*/ - data->listID = SHOW_PAIRED_LIST; - break; - - case BTIPS_BMG_INQUIRY_RESULT_DEVICES_INIT: - /* create the list with the newly discovered devices Resume of mmi_btips_bmg_devices_win_cb*/ - data->listID = SHOW_SEARCH_LIST; - break; - - case BTIPS_BMG_DEVICES_LIST_WIN_DEINIT: - if(data->list_win) - { - listsDestroy(data->list_win); - } - break; - - case BTIPS_BMG_BONDING_REQUEST_INIT: - TRACE_EVENT("BTIPS_BMG_BONDING_REQUEST_INIT"); - if(INQUIRY_NOT_STARTED == data->inquiryState || INQUIRY_COMPLETE == data->inquiryState) - { - - data->inquiryState = INQUIRY_NOT_STARTED; - /*Launch the editor for taking pin-code request*/ - data->pinCode_editor = mmi_btips_bmg_pinCode_editor_create(win); - SEND_EVENT(data->pinCode_editor, BTIPS_BMG_LOCAL_EDITOR_INIT, 0, 0); - } - break; - - case BTIPS_BMG_BONDING_REQUEST_SENT: - data->bondCancellationWindow = mmi_btips_bmg_ask_cancelBond(win, "Bonding", "in Progress", mmi_btips_bmg_bonding_cancelled_cb); - break; - - case BTIPS_BMG_DEVICES_EXIT_WIN: - mmi_btips_bmg_devices_win_exit(data->win); - break; - case LISTS_REASON_RESUME: - break; - case LISTS_REASON_SUSPEND: - break; - case LISTS_REASON_VISIBLE: - break; - - default: - TRACE_EVENT("BTIPS BMG DEVICES DEFAULT "); - } - - TRACE_EVENT_P2("EXEC CB LEAVE - list-win - %x %d", data->list_win, event); - - return MFW_EVENT_CONSUMED; -} - - -/******************************************************************************* - - $Function: mmi_btips_bmg_connected_devices_exec_cb - - $Description: This is the dialog control function for the FMRadio Window. It - receives the signals from the MFW and determines what action, if any, to take. - - $Returns: None - - $Arguments: win : The pointer to the window handler, so the function can reference the - dynamic user data, if any. - event : The incoming event - value : Generic incoming Parameter, it will be 'event' dependant - parameter : Generic incoming Parameter, it will be 'event' dependant - -*******************************************************************************/ -static int mmi_btips_bmg_connected_devices_exec_cb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) //CONNECTED -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_MMI_Btips_Bmg_DevicesWin_data * data = (T_MMI_Btips_Bmg_DevicesWin_data *)win_data->user; - - TRACE_FUNCTION("mmi_btips_bmg_connected_devices_exec_cb()"); - TRACE_EVENT_P2("mmi_btips_bmg_connected_devices_exec_cb - list-win - %x %d", data->list_win, event); - - switch (event) - { - case BTIPS_BMG_CONNECTED_DEVICES_EXIT_WIN: - TRACE_FUNCTION("BTIPS_BMG_CONNECTED_DEVICES_EXIT_WIN"); - mmi_btips_bmg_connected_devices_win_exit(data->win); - break; - case LISTS_REASON_RESUME: - break; - case LISTS_REASON_SUSPEND: - break; - case LISTS_REASON_VISIBLE: - break; - - default: - TRACE_EVENT("BTIPS_BMG_CONNECTED_DEVICES_DEFAULT "); - } - - TRACE_EVENT_P2("EXEC CB LEAVE - list-win - %x %d", data->list_win, event); - - return MFW_EVENT_CONSUMED; -} - -/******************************************************************************* - - $Function: mmi_btips_bmg_devices_win_cb - - $Description: This function is the windows callback function for the mmi FMRadio Root window. - It has no display. - - $Returns: MFW_EVENT_CONSUMED - - $Arguments: event - window handle event - win - FMRadio window - -*******************************************************************************/ -static int mmi_btips_bmg_devices_win_cb (MfwEvt evt, MfwWin *win) -{ - T_MMI_Btips_Bmg_DevicesWin_data *data = (T_MMI_Btips_Bmg_DevicesWin_data *)win->user; - - TRACE_FUNCTION("mmi_btips_bmg_devices_win_cb()"); - TRACE_EVENT_P2("mmi_btips_bmg_devices_win_cb - list-data - %x %d",data->list_win, data->listID); - - switch (evt) - { - case MfwWinVisible: /* window is visible */ - TRACE_EVENT("MfwWinVisible"); - break; - case MfwWinSuspend: /* window is suspended */ - TRACE_EVENT("MfwWinSuspend"); - break; - case MfwWinResume: /* window is resumed */ - TRACE_EVENT("MfwWinResume"); - - if(BOND_PIN_TAKEN != data->bondState ) - { - /*Thsi window is resumed because - 1. User navigated back from the Device List OR wanted to refresh the list - 2. After bonding process, the editor is destroyed. In this case, there is no - menu_list_data to be destroyed*/ - if (data->menu_list_data != NULL) - { - mfwFree( (U8 *)data->menu_list_data->List,((data->listCount) * sizeof(T_MFW_MNU_ITEM) )); - mfwFree ((U8 *)data->menu_list_data, sizeof(ListMenuData)); - } - } - if(SHOW_PAIRED_LIST == data->listID) - data->list_win = mmi_btips_bmg_ShowPairedDeviceList(data->win); - else if(SHOW_SEARCH_LIST == data->listID) - data->list_win = mmi_btips_bmg_ShowInquiredDeviceList(data->win); - else if(SHOW_NONE_EXIT == data->listID) - {} - else if(SHOW_NO_LIST == data->listID) - {/*No action*/} - - break; - case MfwWinDelete: /* window will be deleted */ - TRACE_EVENT("MfwWinDelete"); - break; - case MfwWinFocussed: /* input focus / selected */ - TRACE_EVENT("MfwWinFocussed"); - break; - default: - TRACE_EVENT("DEFAULT"); - return MFW_EVENT_REJECTED; - } - dspl_Enable(1); - - return MFW_EVENT_CONSUMED; - -} - - -/******************************************************************************* - - $Function: mmi_btips_bmg_connected_devices_win_cb - - $Description: This function is the windows callback function for the mmi FMRadio Root window. - It has no display. - - $Returns: MFW_EVENT_CONSUMED - - $Arguments: event - window handle event - win - FMRadio window - -*******************************************************************************/ -static int mmi_btips_bmg_connected_devices_win_cb (MfwEvt evt, MfwWin *win) //CONNECTED -{ - T_MMI_Btips_Bmg_DevicesWin_data *data = (T_MMI_Btips_Bmg_DevicesWin_data *)win->user; - - TRACE_FUNCTION("mmi_btips_bmg_connected_devices_win_cb()"); - TRACE_EVENT_P1("mmi_btips_bmg_connected_devices_win_cb - list-data - %x ",data->list_connected_win); - - switch (evt) - { - case MfwWinVisible: /* window is visible */ - TRACE_EVENT("MfwWinVisible"); - break; - case MfwWinSuspend: /* window is suspended */ - TRACE_EVENT("MfwWinSuspend"); - break; - case MfwWinResume: /* window is resumed */ - TRACE_EVENT("MfwWinResume"); - if (data->menu_list_data != NULL) - { - mfwFree( (U8 *)data->menu_list_connected_data->List,((data->listCountConnectedDevices) * sizeof(T_MFW_MNU_ITEM) )); - mfwFree ((U8 *)data->menu_list_connected_data, sizeof(ListMenuData)); - } - /*noConnectedDevices:- This value was just now computed in the List Menu creation. - Now the control is here because the a device was disconnected and - the list may have to be recreated depending on noConnectedDevices */ - if(data->noConnectedDevices) - { - data->list_win = mmi_btips_bmg_ShowConnectedDevicesList(data->win); - } - break; - case MfwWinDelete: /* window will be deleted */ - TRACE_EVENT("MfwWinDelete"); - break; - case MfwWinFocussed: /* input focus / selected */ - TRACE_EVENT("MfwWinFocussed"); - break; - default: - TRACE_EVENT("DEFAULT"); - return MFW_EVENT_REJECTED; - } - - - return MFW_EVENT_CONSUMED; - -} -/******************************************************************************* - - $Function: mmi_btips_bmg_devices_exit - - $Description: exits the FM application - - $Returns: None - - $Arguments: win - -*******************************************************************************/ -static void mmi_btips_bmg_devices_win_exit (T_MFW_HND win) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_MMI_Btips_Bmg_DevicesWin_data * data = (T_MMI_Btips_Bmg_DevicesWin_data *)win_data->user; - - TRACE_FUNCTION("mmi_btips_bmg_devices_exit()"); - - mfw_btips_delete(data->mfwwin); - if(data->win != NULL) - { - winDelete (data->win); - mfwFree((void *)data, sizeof (T_MMI_Btips_Bmg_DevicesWin_data)); - } - return; -} - -/******************************************************************************* - - $Function: mmi_btips_bmg_connected_devices_win_exit - - $Description: exits the FM application - - $Returns: None - - $Arguments: win - -*******************************************************************************/ -static void mmi_btips_bmg_connected_devices_win_exit (T_MFW_HND win) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_MMI_Btips_Bmg_DevicesWin_data * data = (T_MMI_Btips_Bmg_DevicesWin_data *)win_data->user; - - TRACE_FUNCTION("mmi_btips_bmg_connected_devices_win_exit()"); - - mfw_btips_delete(data->mfwwin); - if(data->win != NULL) - { - winDelete (data->win); - mfwFree((void *)data, sizeof (T_MMI_Btips_Bmg_DevicesWin_data)); - } - return; -} - -/****************************************************************************** - BTIPS BMG EDITOR for Phone Name -******************************************************************************/ - -/******************************************************************************* - - $Function: mmi_btips_bmg_phoneName_editor_create - - $Description: Create a window for entering the text - - $Returns: window handle - - $Arguments: parent_window - parent window. - -*******************************************************************************/ - -static T_MFW_HND mmi_btips_bmg_phoneName_editor_create(MfwHnd parent_window) -{ - - T_MMI_Btips_Bmg_PhoneName_Win_data * data = (T_MMI_Btips_Bmg_PhoneName_Win_data *)mfwAlloc (sizeof (T_MMI_Btips_Bmg_PhoneName_Win_data)); - T_MFW_WIN * win; - TRACE_FUNCTION ("mmi_btips_bmg_phoneName_editor_create()"); - - // Create window handler - data->win = win_create (parent_window, 0, E_WIN_VISIBLE, NULL); - if (data->win EQ NULL) - { - return NULL; - } - - // connect the dialog data to the MFW-window - data->mmi_control.dialog = (T_DIALOG_FUNC)mmi_btips_bmg_phoneName_editor_exec_cb; - data->mmi_control.data = data; - win = ((T_MFW_HDR *)data->win)->data; - win->user = (void *)data; - data->parent = parent_window; - - winShow(data->win); - return data->win; -} - -/******************************************************************************* - - $Function: mmi_btips_bmg_phoneName_editor_exec_cb - - $Description: Callback handler for events sent by the CENTREEDIT editor - - $Returns: none - - $Arguments: win - current window - event - event id - parameter - optional data. -*******************************************************************************/ - -static void mmi_btips_bmg_phoneName_editor_exec_cb(T_MFW_HND win, USHORT event, void *parameter) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_MMI_Btips_Bmg_PhoneName_Win_data * data = (T_MMI_Btips_Bmg_PhoneName_Win_data *)win_data->user; - -#ifdef NEW_EDITOR - T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */ -#else - T_EDITOR_DATA editor_data; -#endif - - TRACE_FUNCTION ("mmi_btips_bmg_phoneName_editor_exec_cb()"); - - switch (event) - { - case BTIPS_BMG_LOCAL_EDITOR_INIT: - /* SPR#1428 - SH - New Editor changes */ - data->local_device = TRUE; //Indicates we are setting a local device name - memset(data->phoneNameBuffer,0,BT_MAX_REM_DEV_NAME); - /*Display the current value*/ - mfw_btips_bmgGetLocalDeviceName(data->phoneNameBuffer); -#ifdef NEW_EDITOR - AUI_edit_SetDefault(&editor_data); - AUI_edit_SetDisplay(&editor_data, CENTRE_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT); - AUI_edit_SetEvents(&editor_data, *(USHORT*)parameter, TRUE, FOREVER, (T_AUI_EDIT_CB)mmi_btips_bmg_phoneName_editor_edit_cb); - AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtBtipsPhoneName, NULL); - AUI_edit_SetAltTextStr(&editor_data, 1, TxtNull, TRUE, TxtSoftBack); - AUI_edit_SetMode(&editor_data, ED_MODE_ALPHA, ED_CURSOR_UNDERLINE); - AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, data->phoneNameBuffer, PHB_MAX_LEN); - data->phoneName_editor = AUI_edit_Start(data->win, &editor_data); -#else /* NEW_EDITOR */ - - SmsSend_loadEditDefault(&editor_data); - bookSetEditAttributes( CENTRE_EDITOR, COLOUR_EDITOR_XX, 0, edtCurBar1, 0, - (char *) data->phoneNameBuffer, NUMBER_LENGTH, &editor_data.editor_attr); - - editor_data.TextId = TxtBtipsPhoneName; - editor_data.editor_attr.text = (char *)data->phoneNameBuffer; - editor_data.editor_attr.size = PHB_MAX_LEN; - editor_data.LeftSoftKey = TxtSoftOK; - editor_data.RightSoftKey = TxtDelete; - editor_data.Identifier = *(USHORT*)parameter; - editor_data.Callback = (T_EDIT_CB)mmi_btips_bmg_phoneName_editor_edit_cb; - editor_data.mode = E_EDIT_ALPHA_MODE; - editor_data.destroyEditor = TRUE ; - data->phoneName_editor = editor_start(data->win,&editor_data); - /* start the Service Centre Number editor */ -#endif /* NEW_EDITOR */ - break; - case BTIPS_BMG_REMOTE_EDITOR_INIT: - { - T_MMI_Btips_Bmg_DevicesWin_data *parent_data = (T_MMI_Btips_Bmg_DevicesWin_data *)win_data->user; - - /* SPR#1428 - SH - New Editor changes */ - /*T_MFW_WIN * win_data_remote = ((T_MFW_HDR *) win)->data; - tBookStandard * data_remote = (tBookStandard *)win_data_remote->user; - - T_MFW_WIN *parent_win_data = ((T_MFW_HDR *) data_remote->parent_win)->data; - T_MMI_Btips_Bmg_DevicesWin_data * parent_data = (T_MMI_Btips_Bmg_DevicesWin_data *)parent_win_data->user; - T_MFW_HND parent_win = parent_data->win;*/ - data->local_device = FALSE; //Indicates we are setting a local device name -#ifdef NEW_EDITOR - AUI_edit_SetDefault(&editor_data); - AUI_edit_SetDisplay(&editor_data, CENTRE_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT); - AUI_edit_SetEvents(&editor_data, *(USHORT*)parameter, TRUE, FOREVER, (T_AUI_EDIT_CB)mmi_btips_bmg_phoneName_editor_edit_cb); - AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtBtipsPhoneName, NULL); - AUI_edit_SetAltTextStr(&editor_data, 1, TxtNull, TRUE, TxtSoftBack); - AUI_edit_SetMode(&editor_data, ED_MODE_ALPHA, ED_CURSOR_UNDERLINE); - AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, data->phoneNameBuffer, PHB_MAX_LEN); - data->phoneName_editor = AUI_edit_Start(data->win, &editor_data); -#else /* NEW_EDITOR */ - - SmsSend_loadEditDefault(&editor_data); - bookSetEditAttributes( CENTRE_EDITOR, COLOUR_EDITOR_XX, 0, edtCurBar1, 0, - (char *) data->phoneNameBuffer, NUMBER_LENGTH, &editor_data.editor_attr); - - editor_data.TextId = TxtBtipsPhoneName; - editor_data.editor_attr.text = (char *)data->phoneNameBuffer; - editor_data.editor_attr.size = PHB_MAX_LEN; - editor_data.LeftSoftKey = TxtSoftOK; - editor_data.RightSoftKey = TxtDelete; - editor_data.Identifier = *(USHORT*)parameter; - editor_data.Callback = (T_EDIT_CB)mmi_btips_bmg_phoneName_editor_edit_cb; - editor_data.mode = E_EDIT_ALPHA_MODE; - editor_data.destroyEditor = TRUE ; - data->phoneName_editor = editor_start(data->win,&editor_data); - /* start the Service Centre Number editor */ -#endif /* NEW_EDITOR */ - break; - } - case BTIPS_BMG_EDITOR_CANCEL: - - break; - default: - TRACE_EVENT("Err: Default"); - return; - } -} - -/******************************************************************************* - - $Function: mmi_btips_bmg_phoneName_editor_edit_cb - - $Description: Callback function for the center number editor - - $Returns: none - - $Arguments: win - current window - Identifier - unique id - reason - event cause -*******************************************************************************/ - -static void mmi_btips_bmg_phoneName_editor_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_MMI_Btips_Bmg_PhoneName_Win_data * data = (T_MMI_Btips_Bmg_PhoneName_Win_data *)win_data->user; - - TRACE_FUNCTION ("mmi_btips_bmg_phoneName_editor_edit_cb()"); - - TRACE_EVENT_P1("PhoneName Editor: %s", data->phoneNameBuffer); - - switch (reason) - { - case INFO_KCD_LEFT: - TRACE_EVENT("mmi_btips_bmg_phoneName_editor_edit_cb,INFO_KCD_LEFT "); - - if(data->local_device) - { - if(!mfw_btips_bmgSetLocalDeviceName(data->phoneNameBuffer)) - mmi_btips_app_show_info(win,TxtBtipsRename,TxtFailed,ONE_SECS,NULL); - /* SPR#1428 - SH - New Editor changes */ -#ifdef NEW_EDITOR - AUI_edit_Destroy(data->phoneName_editor); -#else /* NEW_EDITOR */ - editor_destroy(data->phoneName_editor); -#endif /* NEW_EDITOR */ - } - else - { - T_MMI_Btips_Bmg_DevicesWin_data *parent_data= (T_MMI_Btips_Bmg_DevicesWin_data *)win_data->user ; - if(!mfw_btips_bmgSetRemoteDeviceName(&parent_data->deviceList[parent_data->currentListIndex-1].bdAddr, data->phoneNameBuffer)) - mmi_btips_app_show_info(win,TxtBtipsRename,TxtFailed,ONE_SECS,NULL); - #ifdef NEW_EDITOR - AUI_edit_Destroy(data->phoneName_editor); -#else /* NEW_EDITOR */ - editor_destroy(data->phoneName_editor); -#endif /* NEW_EDITOR */ - } - - mmi_btips_bmg_phoneName_editor_destroy(win); - break; - - case INFO_KCD_RIGHT: - case INFO_KCD_HUP: - #ifdef NEW_EDITOR - AUI_edit_Destroy(data->phoneName_editor); -#else /* NEW_EDITOR */ - editor_destroy(data->phoneName_editor); -#endif /* NEW_EDITOR */ - - mmi_btips_bmg_phoneName_editor_destroy(win); - data->phoneName_editor= 0; - break; - default: - - break; - } -} -/******************************************************************************* - - $Function: mmi_btips_bmg_phoneName_editor_destroy - - $Description: Destroy the windows for entering the text - - $Returns: none - - $Arguments: own_window - window. - -*******************************************************************************/ - -static void mmi_btips_bmg_phoneName_editor_destroy(MfwHnd own_window) -{ - T_MFW_WIN * win_data; - T_MMI_Btips_Bmg_PhoneName_Win_data * data = NULL; - - TRACE_FUNCTION ("mmi_btips_bmg_phoneName_editor_destroy()"); - - if (own_window) - { - win_data = ((T_MFW_HDR *)own_window)->data; - if (win_data != NULL) - data = (T_MMI_Btips_Bmg_PhoneName_Win_data *)win_data->user; - - if (data) - { - - - // Delete WIN handler - win_delete (data->win); - - // Free Memory - mfwFree ((void *)data, sizeof (T_MMI_Btips_Bmg_PhoneName_Win_data)); - //win_data->user = NULL; - } - else - { - TRACE_EVENT ("mmi_btips_bmg_phoneName_editor_destroy() called twice"); - } - } -} - - - - - -/******************************************************************************* - - $Function: mmi_btips_bmg_pinCode_editor_create - - $Description: Create a window for entering the text - - $Returns: window handle - - $Arguments: parent_window - parent window. - -*******************************************************************************/ - -T_MFW_HND mmi_btips_bmg_pinCode_editor_create(MfwHnd parent_window) -{ - - T_MMI_Btips_Bmg_PinCode_Win_data * data = (T_MMI_Btips_Bmg_PinCode_Win_data *)mfwAlloc (sizeof (T_MMI_Btips_Bmg_PinCode_Win_data)); - T_MFW_WIN * win; - TRACE_FUNCTION ("mmi_btips_bmg_pinCode_editor_create()"); - TRACE_EVENT_P1 ("mmi_btips_bmg_pinCode_editor_create - %x", parent_window); - // Create window handler - data->win = win_create (parent_window, 0, E_WIN_VISIBLE, NULL); - if (data->win EQ NULL) - { - return NULL; - } - - // connect the dialog data to the MFW-window - data->mmi_control.dialog = (T_DIALOG_FUNC)mmi_btips_bmg_pinCode_editor_exec_cb; - data->mmi_control.data = data; - win = ((T_MFW_HDR *)data->win)->data; - win->user = (void *)data; - data->parent = parent_window; - - winShow(data->win); - return data->win; -} - - -/******************************************************************************* - - $Function: mmi_btips_bmg_pinCode_editor_exec_cb - - $Description: Callback handler for events sent by the CENTREEDIT editor - - $Returns: none - - $Arguments: win - current window - event - event id - parameter - optional data. -*******************************************************************************/ - -static void mmi_btips_bmg_pinCode_editor_exec_cb(T_MFW_HND win, USHORT event, void *parameter) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_MMI_Btips_Bmg_PinCode_Win_data * data = (T_MMI_Btips_Bmg_PinCode_Win_data *)win_data->user; - -#ifdef NEW_EDITOR - T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */ -#else - T_EDITOR_DATA editor_data; -#endif - - TRACE_FUNCTION ("mmi_btips_bmg_pinCode_editor_exec_cb()"); - memset(data->pinCodeBuffer,0,4); - switch (event) - { - case BTIPS_BMG_LOCAL_EDITOR_INIT: - /* SPR#1428 - SH - New Editor changes */ -#ifdef NEW_EDITOR - AUI_edit_SetDefault(&editor_data); - AUI_edit_SetDisplay(&editor_data, CENTRE_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT); - AUI_edit_SetEvents(&editor_data, *(USHORT*)parameter, TRUE, FOREVER, (T_AUI_EDIT_CB)mmi_btips_bmg_pinCode_editor_edit_cb); - AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtBtipsEnterPassKey, NULL); - AUI_edit_SetAltTextStr(&editor_data, 1, TxtNull, TRUE, TxtSoftBack); - AUI_edit_SetMode(&editor_data, 0, ED_CURSOR_UNDERLINE); - AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, data->pinCodeBuffer,BTL_BMG_MAX_PIN_LENGTH );//PHB_MAX_LEN sundeep - data->pinCode_editor = AUI_edit_Start(data->win, &editor_data); -#else /* NEW_EDITOR */ - - SmsSend_loadEditDefault(&editor_data); - bookSetEditAttributes( CENTRE_EDITOR, COLOUR_EDITOR_XX, 0, edtCurBar1, 0, - (char *) data->pinCodeBuffer, NUMBER_LENGTH, &editor_data.editor_attr); - - - editor_data.TextId = TxtBtipsEnterPassKey; - editor_data.editor_attr.text = (char *)data->pinCodeBuffer; - editor_data.editor_attr.size = PHB_MAX_LEN; - editor_data.LeftSoftKey = TxtSoftOK; - editor_data.RightSoftKey = TxtDelete; - editor_data.Identifier = *(USHORT*)parameter; - editor_data.Callback = (T_EDIT_CB)mmi_btips_bmg_pinCode_editor_edit_cb; - editor_data.mode = E_EDIT_ALPHA_MODE; - editor_data.destroyEditor = TRUE ; - data->phoneName_editor = editor_start(data->win,&editor_data); - /* start the Service Centre Number editor */ -#endif /* NEW_EDITOR */ - break; - - case BTIPS_BMG_EDITOR_CANCEL: - - break; - default: - TRACE_EVENT("Err: Default"); - return; - } -} - -/******************************************************************************* - - $Function: mmi_btips_bmg_pinCode_editor_edit_cb - - $Description: Callback function for the center number editor - - $Returns: none - - $Arguments: win - current window - Identifier - unique id - reason - event cause -*******************************************************************************/ - -static void mmi_btips_bmg_pinCode_editor_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_MMI_Btips_Bmg_PinCode_Win_data * data = (T_MMI_Btips_Bmg_PinCode_Win_data *)win_data->user; - T_MFW_HND parent_win = data->parent; - T_MFW_WIN * parent_win_data = ((T_MFW_HDR *) parent_win)->data; - - TRACE_FUNCTION_P1 ("mmi_btips_bmg_pinCode_editor_edit_cb: pincodeEditor = %s", data->pinCodeBuffer); - - switch (reason) - { - case INFO_KCD_LEFT: - TRACE_EVENT("mmi_btips_bmg_pinCode_editor_edit_cb,INFO_KCD_LEFT "); - - if(strlen(data->pinCodeBuffer) > 16)// sundeep - { - //mmi_btips_app_show_info(win,TxtBtipsApp, TxtBtipsFailed,ONE_SECS, mmi_btips_refreshScreen);//sundeep - mmi_btips_app_show_text(win,"Passkey Invalid", "Try Again", NULL); - memset(data->pinCodeBuffer,0,16); - SEND_EVENT (data->win, BTIPS_BMG_INQUIRY_RESULT_DEVICES_INIT,0, (void *)NULL); - //SEND_EVENT (data->parent, BTIPS_BMG_PAIRED_DEVICES_INIT,0,0); - - } - - if(TRUE == g_btipsData.incomingPinRequestState) - { - mfw_btips_bmgSendPin((const BD_ADDR *) &(g_btipsData.bd_addr_incomingPinReq), data->pinCodeBuffer, strlen(data->pinCodeBuffer)); - g_btipsData.incomingPinRequestState = FALSE; - } - else - { - T_MMI_Btips_Bmg_DevicesWin_data *parent_data = (T_MMI_Btips_Bmg_DevicesWin_data * )parent_win_data->user; - parent_data->bondState = BOND_PIN_TAKEN; - /*When the Bond is cancelled or it completes successfully, we need to display the - Paired device list. The list gets actually created and displayed only when the WinResume - event is received for the parent window*/ - SEND_EVENT (parent_data->win, BTIPS_BMG_INQUIRY_RESULT_DEVICES_INIT,0, (void *)NULL); - - if(mmi_btips_bmgBond(data->parent, data->pinCodeBuffer)) - SEND_EVENT(data->parent, BTIPS_BMG_BONDING_REQUEST_SENT, 0, 0); - } - /* SPR#1428 - SH - New Editor changes */ -#ifdef NEW_EDITOR - AUI_edit_Destroy(data->pinCode_editor); -#else /* NEW_EDITOR */ - editor_destroy(data->pinCode_editor); -#endif /* NEW_EDITOR */ - - mmi_btips_bmg_pinCode_editor_destroy(win); - break; - - case INFO_KCD_RIGHT: - case INFO_KCD_HUP: - - if(TRUE == g_btipsData.incomingPinRequestState) - { - g_btipsData.incomingPinRequestState = FALSE; - } - else - { - T_MMI_Btips_Bmg_DevicesWin_data *parent_data = (T_MMI_Btips_Bmg_DevicesWin_data * )parent_win_data->user; - parent_data->bondState = BOND_NOT_STARTED; - - /*We need to display the Paired device list. The list gets actually created and displayed only when the WinResume - event is received for the parent window*/ - SEND_EVENT (parent_data->win, BTIPS_BMG_PAIRED_DEVICES_INIT,0, (void *)NULL); - } - - #ifdef NEW_EDITOR - AUI_edit_Destroy(data->pinCode_editor); -#else /* NEW_EDITOR */ - editor_destroy(data->pinCode_editor); -#endif /* NEW_EDITOR */ - - mmi_btips_bmg_pinCode_editor_destroy(win); - data->pinCode_editor= 0; - - break; - default: - - break; - } -} -/******************************************************************************* - - $Function: mmi_btips_bmg_pinCode_editor_destroy - - $Description: Destroy the windows for entering the text - - $Returns: none - - $Arguments: own_window - window. - -*******************************************************************************/ - -static void mmi_btips_bmg_pinCode_editor_destroy(MfwHnd own_window) -{ - T_MFW_WIN * win_data; - T_MMI_Btips_Bmg_PinCode_Win_data * data = NULL; - - TRACE_FUNCTION ("mmi_btips_bmg_pinCode_editor_destroy()"); - - if (own_window) - { - win_data = ((T_MFW_HDR *)own_window)->data; - if (win_data != NULL) - data = (T_MMI_Btips_Bmg_PinCode_Win_data *)win_data->user; - - if (data) - { - - - // Delete WIN handler - win_delete (data->win); - - // Free Memory - mfwFree ((void *)data, sizeof (T_MMI_Btips_Bmg_PinCode_Win_data)); - //win_data->user = NULL; - } - else - { - TRACE_EVENT ("mmi_btips_bmg_pinCode_editor_destroy() called twice"); - } - } -} - -/******************************************************************************* - BMG Editors END -*******************************************************************************/ - - -/******************************************************************************* - - $Function: mmi_BtipsDevices - - $Description: - - $Returns: - - $Arguments: - -*******************************************************************************/ -int mmi_btips_bmgDevices(MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfwParent(mfw_header()); - if(mfw_btips_getRadioStatus() == TRUE)//sundeep - mmi_btips_bmg_devices_win_create(parent_win, BTIPS_GENERIC_DEVICE_SEARCH, NULL); - else - mmi_btips_app_show_info(parent_win,TxtBtipsApp, TxtBtipsNotOn,ONE_SECS, mmi_btips_refreshScreen);//sundeep - return MFW_EVENT_CONSUMED; -} - - -/******************************************************************************* - - $Function: mmi_btips_bmgSetVisibility - - $Description: - - $Returns: - - $Arguments: - -*******************************************************************************/ -int mmi_btips_bmgSetVisibility(MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfwParent(mfw_header()); - bookMenuStart(parent_win, (MfwMnuAttr *)btipsBmgSetVisibilityMenuAttributes(),0); - return MFW_EVENT_CONSUMED; - -} - -/******************************************************************************* - - $Function: mmi_btips_bmgConnectedDevices - - $Description: - - $Returns: - - $Arguments: - -*******************************************************************************/ -int mmi_btips_bmgConnectedDevices(MfwMnu* m,MfwMnuItem* i) //CONNECTED -{ - T_MFW_HND parent_win = mfwParent(mfw_header()); - - if(mfw_btips_bmg_getConnectedDevicesCount()!=0) - { - mmi_btips_bmg_connected_devices_win_create(parent_win, BTIPS_CONNECTED_DEVICES_SEARCH, NULL); - } - else - { - mmi_btips_app_show_info(parent_win, TxtNo, TxtBtipsDevices,ONE_SECS, mmi_btips_refreshScreen); - } - - return MFW_EVENT_CONSUMED; - -} - -/******************************************************************************* - - $Function: mmi_BtipsPhoneName - - $Description: - - $Returns: - - $Arguments: - -*******************************************************************************/ -int mmi_btips_bmgPhoneName(MfwMnu* m, MfwMnuItem* i) -{ -/* -Display current name -Give LSK - Change, RSK - Back -*/ - T_MFW_HND parent_win = mfwParent(mfw_header()); - T_MFW_HND phoneName_editor_win; - phoneName_editor_win = mmi_btips_bmg_phoneName_editor_create(parent_win); - SEND_EVENT(phoneName_editor_win, BTIPS_BMG_LOCAL_EDITOR_INIT,0,0); - return MFW_EVENT_CONSUMED; -} - -/******************************************************************************* - - $Function: mmi_BtipsHidePhone - - $Description: - - $Returns: - - $Arguments: - -*******************************************************************************/ -int mmi_btips_bmgHidePhone(MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfwParent(mfw_header()); - mfw_btips_bmgSetPhoneVisibility(FALSE); - win_delete(parent_win); - dspl_Enable(1); - return MFW_EVENT_CONSUMED; -} - -/******************************************************************************* - - $Function: mmi_btips_bmgSetConnectPermissionAllow - - $Description: - - $Returns: - - $Arguments: - -*******************************************************************************/ -int mmi_btips_bmgSetConnectPermissionAllow(MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfwParent(mfw_header()); - - TRACE_EVENT_P1("parent of mmi_btips_bmgSetConnectPermissionAllow %x",parent_win); - if(mmi_btips_bmg_SetConnectPermission(parent_win,TRUE)) - mmi_btips_app_show_info(0,TxtBtipsApp,TxtBtipsAlwaysAllow,ONE_SECS,NULL); - else - mmi_btips_app_show_info(0,TxtBtipsAlwaysAllow,TxtFailed,ONE_SECS,NULL); - - return MFW_EVENT_CONSUMED; -} -/******************************************************************************* - - $Function: mmi_btips_bmgSetConnectPermissionAsk - - $Description: - - $Returns: - - $Arguments: - -*******************************************************************************/ -int mmi_btips_bmgSetConnectPermissionAsk(MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfwParent(mfw_header()); -// mfw_btips_bmgDeviceSetConnectPermissionAsk(); - - TRACE_EVENT_P1("parent of mmi_btips_bmgSetConnectPermissionAllow %x",parent_win); - - if(mmi_btips_bmg_SetConnectPermission(parent_win,FALSE)) - mmi_btips_app_show_info(0,TxtBtipsApp,TxtBtipsAlwaysAsk,ONE_SECS,NULL); - else - mmi_btips_app_show_info(0,TxtBtipsAlwaysAsk,TxtFailed,ONE_SECS,NULL); - return MFW_EVENT_CONSUMED; -} -/******************************************************************************* - - $Function: mmi_btips_bmgDeviceShowServices - - $Description: - - $Returns: - - $Arguments: - -*******************************************************************************/ -BOOL mmi_btips_bmgDeviceShowServices(T_MFW_HND win , BOOL discoverServices) -{ - SdpServicesMask sdpServicesMask =0; - - BtStatus btStatus; - char bdAddrstring[256]; - - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - tBookStandard * data = (tBookStandard *)win_data->user; - - T_MFW_WIN *parent_win_data = ((T_MFW_HDR *) data->parent_win)->data; - T_MMI_Btips_Bmg_DevicesWin_data * parent_data = (T_MMI_Btips_Bmg_DevicesWin_data *)parent_win_data->user; - T_MFW_HND parent_win = parent_data->win; - - TRACE_EVENT_P1("parent_win of mmi_btips_bmgDeviceShowServices %x",parent_win); - - if(discoverServices==TRUE) - { - sdpServicesMask = (SDP_SERVICE_DUN|SDP_SERVICE_FTP|SDP_SERVICE_A2DP|SDP_SERVICE_HFP|SDP_SERVICE_HSP|SDP_SERVICE_OPP); - //sdpServicesMask= (SDP_SERVICE_SPP | SDP_SERVICE_DUN | SDP_SERVICE_OPP | SDP_SERVICE_FTP | SDP_SERVICE_HSP | SDP_SERVICE_A2DP | SDP_SERVICE_AVRCP | SDP_SERVICE_FAX | SDP_SERVICE_BPP | SDP_SERVICE_BIP | SDP_SERVICE_HFP | SDP_SERVICE_SAP | SDP_SERVICE_PBAP | SDP_SERVICE_HID);//sundeep - bdaddr_ntoa(&parent_data->deviceList[parent_data->currentListIndex-1].bdAddr,bdAddrstring); - TRACE_EVENT_P2("mmi_btips_bmgDeviceShowServices Discover %x, addr = %s",sdpServicesMask,bdAddrstring); - btStatus = mfw_btips_bmg_DiscoverServices(&parent_data->deviceList[parent_data->currentListIndex-1].bdAddr,sdpServicesMask); - if(btStatus !=MFW_BTIPS_SUCCESS ) - { - mmi_btips_app_show_info(0, TxtBtipsServices, TxtError, ONE_SECS,NULL); - - } - - } - else if(discoverServices == FALSE) - { - sdpServicesMask = mfw_btips_bmgDeviceGetServices(&parent_data->deviceList[parent_data->currentListIndex-1].bdAddr); - TRACE_EVENT_P1("sdpServicesMask of mmi_btips_bmgDeviceShowServices %x",sdpServicesMask); - - if(sdpServicesMask) - { - TRACE_EVENT_P1("sdpServicesMask of mmi_btips_bmgDeviceShowServices %x",sdpServicesMask); - mmi_btips_bmg_services_editor_create(win,sdpServicesMask); - return SERVICESMASK_NOT_EMPTY; - } - TRACE_FUNCTION("mmi_btips_bmgDeviceShowServices SERVICESMASK_EMPTY"); - return SERVICESMASK_EMPTY; - - } - return MFW_EVENT_CONSUMED; -} -/******************************************************************************* - - $Function: mmi_btips_bmgDeviceDelete - - $Description: - - $Returns: - - $Arguments: - -*******************************************************************************/ -int mmi_btips_bmgDeviceDelete(MfwMnu* m, MfwMnuItem* i) -{ - - T_MFW_HND win = mfw_parent(mfw_header()); - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - tBookStandard * data = (tBookStandard *)win_data->user; - - T_MFW_WIN *parent_win_data = ((T_MFW_HDR *) data->parent_win)->data; - T_MMI_Btips_Bmg_DevicesWin_data * parent_data = (T_MMI_Btips_Bmg_DevicesWin_data *)parent_win_data->user; - T_MFW_HND parent_win = parent_data->win; - - TRACE_EVENT_P2("current list index = %d , Parent Win = %x",parent_data->currentListIndex,parent_win); - TRACE_EVENT_P1("BdAddr = %s",parent_data->deviceList[parent_data->currentListIndex-1].bdAddr); - if(mfw_btips_bmgDeviceDelete(&parent_data->deviceList[parent_data->currentListIndex-1].bdAddr)) - mmi_btips_app_show_info(0,TxtRecord, TxtDeleted,ONE_SECS, NULL); - else - mmi_btips_app_show_info(0,TxtDelete,TxtFailed,ONE_SECS,NULL); - return MFW_EVENT_CONSUMED; -} -/******************************************************************************* - $Function: mmi_btips_bmgDeviceDisconnect - - $Description: - - $Returns: - - $Arguments: - -*******************************************************************************/ -int mmi_btips_bmgDeviceDisconnect(MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfwParent(mfw_header()); - //mfw_btips_bmgDeviceDisconnect(); - mmi_btips_app_show_info(0,TxtBtipsApp,TxtBtipsDisconnect,ONE_SECS,NULL); - return MFW_EVENT_CONSUMED; -} - - -/******************************************************************************* - - $Function: mmi_btips_bmgDeviceSetRemotename - - $Description: Currently not being used - - $Returns: - - $Arguments: - -*******************************************************************************/ - -int mmi_btips_bmgDeviceSetRemotename(MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfwParent(mfw_header()); - T_MFW_HND phoneName_editor_win; - //T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - //T_MMI_Btips_Bmg_DevicesWin_data * data = (T_MMI_Btips_Bmg_DevicesWin_data *)win_data->user; - - - - TRACE_FUNCTION ("mmi_btips_bmgDeviceSetRemotename()"); - //memset(data->phoneNameBuffer,0,BT_MAX_REM_DEV_NAME); - /*Display the current value*/ - //mfw_btips_bmgGetLocalDeviceName(data->phoneNameBuffer); - phoneName_editor_win = mmi_btips_bmg_phoneName_editor_create(parent_win); - - SEND_EVENT(phoneName_editor_win, BTIPS_BMG_REMOTE_EDITOR_INIT,0,0); - - //mmi_btips_app_show_info(0,TxtBtipsApp,TxtBtipsRename,ONE_SECS,NULL); - return MFW_EVENT_CONSUMED; -} - - -/******************************************************************************* - - $Function: mmi_BtipsShowPhone - - $Description: - - $Returns: - - $Arguments: - -*******************************************************************************/ -int mmi_btips_bmgShowPhone(MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfwParent(mfw_header()); - mfw_btips_bmgSetPhoneVisibility(TRUE); - win_delete(parent_win); - dspl_Enable(1); - return MFW_EVENT_CONSUMED; -} - -USHORT mmi_btips_bmgIsVisible( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi ) -{ - if(mfw_btips_bmgGetPhoneVisibility()) - return TRUE; - - return FALSE; - -} - -USHORT mmi_btips_bmgIsInvisible( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi ) -{ - if(mfw_btips_bmgGetPhoneVisibility()) - return FALSE; - - return TRUE; - -} - -/******************************************************************************* - - $Function: mmi_btips_bmg_pin_req - - $Description: - - $Returns: - - $Arguments: - -*******************************************************************************/ -int mmi_btips_bmg_pin_req(const BD_ADDR *bdAddr) -{ - U8 pin[] = "0000"; - U8 len = 4; - /* - o. Store the BD_ADDR in the context of the Window created to display the editor - 1. Create an editor - 2. Try to get the name of the peer device requesting pairing - 3. Take input from the user for the 4-digit Pass-Key - */ - mfw_btips_bmgSendPin(bdAddr, pin, len); - mmi_btips_app_show_info(0,TxtBtipsApp,TxtBtipsBond,ONE_SECS,NULL); - -} - - -/******************************************************************************* - - $Function: mmi_btips_bmgBond - - $Description: - - $Returns: - - $Arguments: - -*******************************************************************************/ -int mmi_btips_bmgBond(T_MFW_HND win, U8 pin[]) -{ - - U8 len = strlen(pin); - T_MFW_WIN * win_data; - T_MMI_Btips_Bmg_DevicesWin_data *data; - - win_data = ((T_MFW_HDR *) win)->data; - data = (T_MMI_Btips_Bmg_DevicesWin_data *)win_data->user; - - TRACE_FUNCTION ("mmi_btips_bmgBond()"); - return mfw_btips_bmgBond(&data->deviceList[data->currentListIndex-1].bdAddr, pin, len); -} - -/******************************************************************************* - - $Function: mmi_btips_bmg_ShowPairedDeviceList - - $Description: Create a menu list of all paired devices; MMI => MFW => BTL-BMG - - $Returns: - - $Arguments: - -*******************************************************************************/ -T_MFW_HND mmi_btips_bmg_ShowPairedDeviceList(T_MFW_HND win) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_MMI_Btips_Bmg_DevicesWin_data * data = (T_MMI_Btips_Bmg_DevicesWin_data *)win_data->user; - USHORT list_count=0; - //char bdAddr[BDADDR_NTOA_SIZE]; - - TRACE_FUNCTION ("mmi_btips_bmg_ShowPairedDeviceList()"); - data->menu_list_data = (ListMenuData *)mfwAlloc(sizeof(ListMenuData)); - if(data->menu_list_data == NULL ) - { - TRACE_ERROR("Memory failure."); - return; - } - data->inquiryState = INQUIRY_NOT_STARTED; - - /*Find out how many paired devices are present and allocate for the menu-list-data as - noPairedDevices + ONE for the top most entry ("Find new device")*/ - //MFW has populated the (data->deviceList, &data->noInquiredDevices); - - mfw_btips_bmg_getPairedDevices(data->deviceList, &data->noPairedDevices); - data->listCount = data->noPairedDevices + 1; - - data->menu_list_data->List = (T_MFW_MNU_ITEM *)mfwAlloc( (data->listCount) * sizeof(T_MFW_MNU_ITEM) ); - if(data->menu_list_data->List == NULL) - { - TRACE_ERROR("BTIPS BMG Device List Memory failure."); - return; - } - /*First entry : if searching is complete - "Find More" OR it will display "searching"*/ - mnuInitDataItem(&data->menu_list_data->List[list_count]); - data->menu_list_data->CursorPosition = 1; - - data->menu_list_data->List[list_count].str = FindNewDeviceString; - if(data->noPairedDevices) - { - data->menu_list_data->CursorPosition = 2; - } - - data->menu_list_data->List[list_count].flagFunc = item_flag_none; - - - /*Second entry onwards : The newly found Device List*/ - for (list_count=1; list_countnoPairedDevices+1; list_count++) - { - //bdaddr_ntoa(&data->deviceList[list_count-1].bdAddr, bdAddr); - mnuInitDataItem(&data->menu_list_data->List[list_count]); - data->menu_list_data->List[list_count].str = (char *)data->deviceList[list_count-1].name; - data->menu_list_data->List[list_count].flagFunc = item_flag_none; - } - - data->menu_list_data->LeftSoftKey = TxtSelect; - data->menu_list_data->RightSoftKey = TxtSoftBack; - data->menu_list_data->ListLength = data->listCount; //(data->noPairedDevices + 1) - data->menu_list_data->ListPosition = 1; - data->menu_list_data->SnapshotSize =data->listCount; //(data->noPairedDevices + 1) - data->menu_list_data->Font = 1; - data->menu_list_data->KeyEvents = KEY_ALL; - data->menu_list_data->Reason = 0; - data->menu_list_data->Strings = TRUE; - data->menu_list_data->Attr = (MfwMnuAttr*)&BtipsDeviceList_Attrib; - data->menu_list_data->autoDestroy = TRUE; - data->currentListIndex = data->menu_list_data->CursorPosition; - - //Display the List window that was created above - listDisplayListMenu(win, data->menu_list_data, (ListCbFunc)mmi_btips_bmg_device_list_cb, 0); - TRACE_EVENT_P2("Num of Paired Devices %d, CurrIndex %d",data->noPairedDevices, data->currentListIndex); - displaySoftKeys(data->menu_list_data->LeftSoftKey,data->menu_list_data->RightSoftKey); - if(data->menu_list_data->ListLength > 1) - displayMenuKeys(MENU_KEY_UP_DOWN_CENTER); - data->list_win = data->menu_list_data->win; - return data->menu_list_data->win; -} - -/******************************************************************************* - - $Function: mmi_btips_bmg_ShowConnectedDevicesList - - $Description: Create a menu list of all paired devices; MMI => MFW => BTL-BMG - - $Returns: - - $Arguments: - -*******************************************************************************/ -T_MFW_HND mmi_btips_bmg_ShowConnectedDevicesList(T_MFW_HND win) //CONNECTED -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_MMI_Btips_Bmg_DevicesWin_data * data = (T_MMI_Btips_Bmg_DevicesWin_data *)win_data->user; - USHORT list_count=0; - //char bdAddr[BDADDR_NTOA_SIZE]; - - TRACE_FUNCTION ("mmi_btips_bmg_ShowConnectedDevicesList()"); - data->menu_list_connected_data = (ListMenuData *)mfwAlloc(sizeof(ListMenuData)); - if(data->menu_list_connected_data == NULL ) - { - TRACE_ERROR("Memory failure."); - return NULL; - } - - /*Find out how many Connected devices are present and allocate for the menu-list-data as - noConnectedDevices */ - - mfw_btips_bmg_getConnectedDevices(data->connected_deviceList, &data->noConnectedDevices); - data->listCountConnectedDevices = data->noConnectedDevices; - TRACE_EVENT_P1("Total Connected Devices in List = %d", data->noConnectedDevices); - - if(0 == data->noConnectedDevices) - { - return NULL; - } - - data->menu_list_connected_data->List = (T_MFW_MNU_ITEM *)mfwAlloc( (data->listCountConnectedDevices) * sizeof(T_MFW_MNU_ITEM) ); - if(data->menu_list_connected_data->List == NULL) - { - TRACE_ERROR("BTIPS BMG Connected Device List Memory failure."); - return data->menu_list_connected_data->win; - } - - data->menu_list_connected_data->CursorPosition = 1; - for (list_count=0; list_countnoConnectedDevices; list_count++) - { - mnuInitDataItem(&data->menu_list_connected_data->List[list_count]); - data->menu_list_connected_data->List[list_count].str = (char *)data->connected_deviceList[list_count].name; - data->menu_list_connected_data->List[list_count].flagFunc = item_flag_none; - } - - data->menu_list_connected_data->LeftSoftKey = TxtBtipsDisconnect; - data->menu_list_connected_data->RightSoftKey = TxtSoftBack; - data->menu_list_connected_data->ListLength = data->listCountConnectedDevices; - data->menu_list_connected_data->ListPosition = 1; - data->menu_list_connected_data->SnapshotSize =data->listCountConnectedDevices; - data->menu_list_connected_data->Font = 1; - data->menu_list_connected_data->KeyEvents = KEY_ALL; - data->menu_list_connected_data->Reason = 0; - data->menu_list_connected_data->Strings = TRUE; - data->menu_list_connected_data->Attr = (MfwMnuAttr*)&BtipsDeviceList_Attrib; - data->menu_list_connected_data->autoDestroy = TRUE; - data->currentListIndex = data->menu_list_connected_data->CursorPosition; - - //Display the List window that was created above - listDisplayListMenu(win, data->menu_list_connected_data, (ListCbFunc)mmi_btips_bmg_connected_device_list_cb, 0); - TRACE_EVENT_P2("Num of Connected Devices %d, CurrIndex %d",data->noConnectedDevices, data->currentListIndex); - displaySoftKeys(data->menu_list_connected_data->LeftSoftKey,data->menu_list_connected_data->RightSoftKey); - if(data->menu_list_connected_data->ListLength > 1) - displayMenuKeys(MENU_KEY_UP_DOWN_CENTER); - data->list_connected_win = data->menu_list_connected_data->win; - return data->menu_list_connected_data->win; -} - -/******************************************************************************* - - $Function: mmi_btips_bmg_ShowInquiredDeviceList - - $Description: Create a menu list of all paired devices; BTL-BMG => MFW (Context Switch) - MFW => MMI (notification) - MMI (gets data collected device list again from mfw) - - $Returns: - - $Arguments: - -*******************************************************************************/ -T_MFW_HND mmi_btips_bmg_ShowInquiredDeviceList(T_MFW_HND win) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_MMI_Btips_Bmg_DevicesWin_data * data = (T_MMI_Btips_Bmg_DevicesWin_data *)win_data->user; - USHORT list_count=0; - //char bdAddr[BDADDR_NTOA_SIZE]; - - TRACE_FUNCTION ("mmi_btips_bmg_ShowInquiredDeviceList()"); - data->menu_list_data = (ListMenuData *)mfwAlloc(sizeof(ListMenuData)); - if(data->menu_list_data == NULL ) - { - TRACE_ERROR("Memory failure."); - return; - } - data->listCount = data->noInquiredDevices + 1; - - /*Find out how many paired devices are present and allocate for the menu-list-data as - noPairedDevices + ONE for the top most entry ("Find new device") - MFW has populated the (data->deviceList, &data->noInquiredDevices)*/; - data->menu_list_data->List = (T_MFW_MNU_ITEM *)mfwAlloc( (data->listCount) * sizeof(T_MFW_MNU_ITEM) ); - if(data->menu_list_data->List == NULL) - { - TRACE_ERROR("BTIPS BMG Device List Memory failure."); - return; - } - - data->menu_list_data->LeftSoftKey = TxtSelect; - data->menu_list_data->RightSoftKey= TxtCancel; - data->menu_list_data->ListLength = data->listCount; - data->menu_list_data->ListPosition = 1; - data->menu_list_data->CursorPosition = 1; - data->menu_list_data->SnapshotSize =data->listCount; - data->menu_list_data->Font = 1; - data->menu_list_data->KeyEvents = KEY_ALL; - data->menu_list_data->Reason = 0; - data->menu_list_data->Strings = TRUE; - data->menu_list_data->Attr = (MfwMnuAttr*)&BtipsDeviceList_Attrib; - data->menu_list_data->autoDestroy = TRUE; - data->menu_list_data->CursorPosition = 1; - - /*First entry : if searching is complete - "Find More" OR it will display "searching"*/ - mnuInitDataItem(&data->menu_list_data->List[list_count]); - switch(data->inquiryState) - { - case INQUIRY_NOT_STARTED: - data->menu_list_data->List[list_count].str = FindNewDeviceString; - break; - case INQUIRY_STARTED: - data->menu_list_data->List[list_count].str = SearchingDeviceString; - if(data->noInquiredDevices) - { - data->menu_list_data->LeftSoftKey = TxtBtipsBond; - } - else - { - data->menu_list_data->LeftSoftKey = '\0'; - } - break; - case INQUIRY_CANCELLATION_STARTED: - case INQUIRY_CANCELLATION_COMPLETE: - data->menu_list_data->List[list_count].str = FindNewDeviceString; - if(data->noInquiredDevices) - { - data->menu_list_data->LeftSoftKey = TxtBtipsBond; - } - else - { - data->menu_list_data->LeftSoftKey = '\0'; - } - break; - case INQUIRY_COMPLETE: - data->menu_list_data->List[list_count].str = FindNewDeviceString; - data->menu_list_data->RightSoftKey = TxtSoftBack; - if(data->noInquiredDevices) - { - data->menu_list_data->ListPosition = 2; - data->menu_list_data->LeftSoftKey = TxtBtipsBond; - } - break; - } - - data->menu_list_data->List[list_count].flagFunc = item_flag_none; - - /*Second entry onwards : The newly found Device List*/ - for (list_count=1; list_countnoInquiredDevices+1; list_count++) - { - //bdaddr_ntoa(&data->deviceList[list_count-1].bdAddr, bdAddr); - mnuInitDataItem(&data->menu_list_data->List[list_count]); - data->menu_list_data->List[list_count].str = (char *)data->deviceList[list_count-1].name; - data->menu_list_data->List[list_count].flagFunc = item_flag_none; - } - - data->currentListIndex = data->menu_list_data->CursorPosition; - - //Display the List window that was created above - listDisplayListMenu(win, data->menu_list_data, (ListCbFunc)mmi_btips_bmg_device_list_cb, 0); - TRACE_EVENT_P2("Num of Inquired Devices %d, CurrIndex %d",data->noInquiredDevices, data->currentListIndex); - - displaySoftKeys(data->menu_list_data->LeftSoftKey,data->menu_list_data->RightSoftKey); - if(data->menu_list_data->ListLength > 1) - displayMenuKeys(MENU_KEY_UP_DOWN_CENTER); - data->list_win = data->menu_list_data->win; - return data->menu_list_data->win; -} - - -static void mmi_btips_bmg_device_list_cb(T_MFW_HND * parent, ListMenuData * ListData) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) parent)->data; - T_MMI_Btips_Bmg_DevicesWin_data * data = (T_MMI_Btips_Bmg_DevicesWin_data *)win_data->user; - - TRACE_FUNCTION("mmi_btips_bmg_device_list_cb"); - TRACE_EVENT_P2("Reason %d, Current State = %d",ListData->Reason, data->inquiryState); - switch(ListData->Reason) - { - case LISTS_REASON_SELECT: - data->currentListIndex = ListData->CursorPosition; - if(ListData->selectKey==TRUE) - { // Whats this value for - } - TRACE_EVENT_P1("ListData->selectKey = %d", ListData->selectKey); - if(0 == data->currentListIndex) - { - /*User has selected "Find new device" or he just clicked on the display "searching" */ - TRACE_EVENT_P1("Find New Device: Current State = %d", data->inquiryState); - if((INQUIRY_NOT_STARTED == data->inquiryState) || (INQUIRY_COMPLETE== data->inquiryState)) - { - SEND_EVENT (parent, BTIPS_BMG_INQUIRY_RESULT_DEVICES_INIT, 0, (void *)NULL); - data->noInquiredDevices = 0; - data->inquiryState = INQUIRY_STARTED; - mfw_btips_bmgSearch(data->searchType); - } - } - else - { - if(INQUIRY_STARTED == data->inquiryState) - { - /*If the user has selected a particualr device thats currently discovered - he now wishes to Bond/Connect to it. So Stop the inquiry now */ - data->inquiryState = INQUIRY_CANCELLATION_STARTED; - mfw_btips_bmgCancelSearch(); - /*We are not getting the search cancelled event, hence doing it this way*/ - data->inquiryState = INQUIRY_COMPLETE; - } - - switch(data->inquiryState) - { - case INQUIRY_NOT_STARTED: - if(BTIPS_GENERIC_DEVICE_SEARCH == data->searchType) - { - /*There is no Inquiry now and the user is viewing a list of - previously paired devices. Now he has selected the options to - be exercised on paired devices: Services, Delete, Rename, etc..*/ - /* Create the options menu*/ - bookMenuStart(parent, (MfwMnuAttr *)btipsBmgPairedDeviceMenuAttributes(),0); - } - else - { - data->searchCB(data->deviceList[data->currentListIndex-1].bdAddr); - } - break; - case INQUIRY_CANCELLATION_STARTED: - if(data->noInquiredDevices >= 1) - { - /*Mark that Bonding is requested on the currently selected device. - Bonding will statr only when the inquiry cancellation event comes*/ - data->listID = SHOW_NO_LIST; - data->bondState = BOND_USER_REQUESTED; - } - break; - case INQUIRY_COMPLETE: - /*Trigger Bonding on the currently selected device.*/ - data->listID = SHOW_NO_LIST; - data->bondState = BOND_USER_REQUESTED; - SEND_EVENT (parent, BTIPS_BMG_BONDING_REQUEST_INIT, 0, (void *)NULL); - break; - } - } - break; - - case LISTS_REASON_BACK: - TRACE_EVENT("Going back" ); - data->listID = SHOW_NONE_EXIT; - if(INQUIRY_STARTED == data->inquiryState) - { - data->inquiryState = INQUIRY_CANCELLATION_STARTED; - mfw_btips_bmgCancelSearch(); - SEND_EVENT (parent, BTIPS_BMG_PAIRED_DEVICES_INIT, 0, (void *)NULL); - } - else - SEND_EVENT (data->win, BTIPS_BMG_DEVICES_EXIT_WIN, 0, (void *)NULL); - break; - - case LISTS_REASON_DRAWCOMPLETE: - TRACE_EVENT("LISTS_REASON_DRAWCOMPLETE " ); - break; - } -} - -//CONNECTED -static void mmi_btips_bmg_connected_device_list_cb(T_MFW_HND * parent, ListMenuData* ListConnectedData) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) parent)->data; - T_MMI_Btips_Bmg_DevicesWin_data * data = (T_MMI_Btips_Bmg_DevicesWin_data *)win_data->user; - - TRACE_FUNCTION("mmi_btips_bmg_connected_device_list_cb"); - TRACE_EVENT_P2("Reason %d, Current Index = %d",ListConnectedData->Reason, ListConnectedData->CursorPosition); - TRACE_EVENT_P3("List CB ++ ListWin = %x, %x, ListCount = %d",data->menu_list_connected_data->win, data->list_connected_win, data->listCountConnectedDevices); - switch(ListConnectedData->Reason) - { - case LISTS_REASON_SELECT: - TRACE_EVENT("LISTS_REASON_SELECT - Connected Device" ); - data->currentListIndex = ListConnectedData->CursorPosition; - data->noConnectedDevices--; - if(data->connected_deviceList[data->currentListIndex].ServiceId == BTIPS_SDP_SERVICE_FTPS) - { - mfw_btips_ftpsDisconnect(); - } - if(data->connected_deviceList[data->currentListIndex].ServiceId == BTIPS_SDP_SERVICE_OPPC) - { - mfw_btips_oppc_Disconnect(); - } - if(data->connected_deviceList[data->currentListIndex].ServiceId == BTIPS_SDP_SERVICE_OPPS) - { - mfw_btips_opps_Disconnect(); - } - if(data->connected_deviceList[data->currentListIndex].ServiceId == BTIPS_SDP_SERVICE_VG) - { - mfw_btips_vgDisconnect(data->connected_deviceList[data->currentListIndex].bdAddr); - - } - if(data->connected_deviceList[data->currentListIndex].ServiceId == BTIPS_SDP_SERVICE_A2DP) - { - mfw_btips_a2dpDisconnect(data->connected_deviceList[data->currentListIndex].bdAddr); - - } - - if(0 == data->noConnectedDevices) - { - mmi_btips_app_show_info(data->win, TxtNo, TxtBtipsDevices,ONE_SECS, mmi_btips_ResumeBTMainMenu); - SEND_EVENT (data->win, BTIPS_BMG_CONNECTED_DEVICES_EXIT_WIN, 0, (void *)NULL); - } - break; - - case LISTS_REASON_BACK: - TRACE_EVENT("Going back" ); - SEND_EVENT (data->win, BTIPS_BMG_CONNECTED_DEVICES_EXIT_WIN, 0, (void *)NULL); - break; - - case LISTS_REASON_DRAWCOMPLETE: - TRACE_EVENT("LISTS_REASON_DRAWCOMPLETE " ); - break; - - } -} - - - -static int mmi_btips_bmg_SetConnectPermission(T_MFW_HND win, BOOL permission) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - tBookStandard * data = (tBookStandard *)win_data->user; - - T_MFW_WIN *parent_win_data = ((T_MFW_HDR *) data->parent_win)->data; - T_MMI_Btips_Bmg_DevicesWin_data * parent_data = (T_MMI_Btips_Bmg_DevicesWin_data *)parent_win_data->user; - T_MFW_HND parent_win = parent_data->win; - - TRACE_EVENT_P1("parent_win_data value of mmi_btips_bmg_SetConnectPermission %x",parent_win_data); - TRACE_EVENT_P1("parent_win of mmi_btips_bmg_SetConnectPermission %x",parent_win); - TRACE_FUNCTION("mmi_btips_bmg_SetConnectPermission() "); - - if(permission) - { - return mfw_btips_bmgDeviceSetConnectPermissionAllow(&parent_data->deviceList[parent_data->currentListIndex-1].bdAddr, permission); - } - - else - { - return mfw_btips_bmgDeviceSetConnectPermissionAsk(&parent_data->deviceList[parent_data->currentListIndex-1].bdAddr, permission); - } - -} - -/******************************************************************************* - $Function: mmi_btips_bmg_services_editor_create - - $Description: Creates an editor for displaying the services supported by a device - - $Returns: Execution status - - $Arguments: parent_win -Parent window -*******************************************************************************/ -T_MFW_HND mmi_btips_bmg_services_editor_create(T_MFW_HND parent_win, SdpServicesMask sdpServicesMask) -{ - T_MFW_HND win; - T_AUI_EDITOR_DATA editor_data; - T_AUI_EDITOR_INFO *edtdata; - T_MFW_WIN *win_data; - - TRACE_FUNCTION ("mmi_btips_bmg_services_editor_create"); - services_data = (T_MMI_BTIPS_SERVICES_STRUCT *)mfwAlloc(sizeof(T_MMI_BTIPS_SERVICES_STRUCT)); - services_data->edt_buf = (char *)mfwAlloc(BTIPS_MAX_SERVICES_BUFFER); - - - memset(&editor_data,'\0',sizeof(editor_data)); - - //Initialise the editor - - AUI_edit_SetDefault(&editor_data); - - AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII,(UBYTE *) services_data->edt_buf, BTIPS_MAX_SERVICES_BUFFER); - - AUI_edit_SetMode(&editor_data,ED_MODE_ALPHA,0); - - AUI_edit_SetTextStr(&editor_data, TxtNull,TxtSoftOK, TxtBtipsServices,NULL); - - AUI_edit_SetAltTextStr(&editor_data, 1, TxtNull, TRUE, TxtNull); - - AUI_edit_SetEvents(&editor_data, 0, TRUE, FOREVER, (T_AUI_EDIT_CB)mmi_btips_bmg_services_editor_exec_cb); - - win = AUI_edit_Start(parent_win, &editor_data); - - - TRACE_EVENT_P2(" sdpServicesMask = %d , SDP_SERVICE_OPP =%d",sdpServicesMask,sdpServicesMask& SDP_SERVICE_OPP); - if(sdpServicesMask& SDP_SERVICE_OPP ) - { - AUI_edit_InsertString(win , (UBYTE *) "Object Push",ATB_DCS_ASCII); - - AUI_edit_InsertChar(win , ctrlEnter); - - } - - TRACE_EVENT_P2(" sdpServicesMask = %d , SDP_SERVICE_HFP =%d",sdpServicesMask,sdpServicesMask& SDP_SERVICE_HFP); - if(sdpServicesMask& SDP_SERVICE_HFP) - { - AUI_edit_InsertString(win , (UBYTE *) "Handsfree",ATB_DCS_ASCII); - - AUI_edit_InsertChar(win , ctrlEnter); - } - TRACE_EVENT_P2(" sdpServicesMask = %d , SDP_SERVICE_HSP =%d",sdpServicesMask,sdpServicesMask& SDP_SERVICE_HSP ); - if(sdpServicesMask& SDP_SERVICE_HSP ) - { - AUI_edit_InsertString(win , (UBYTE *) "HeadSet",ATB_DCS_ASCII); - - AUI_edit_InsertChar(win , ctrlEnter); - - } - TRACE_EVENT_P2(" sdpServicesMask = %d , SDP_SERVICE_FTP =%d",sdpServicesMask,sdpServicesMask& SDP_SERVICE_FTP ); - if(sdpServicesMask& SDP_SERVICE_FTP ) - { - AUI_edit_InsertString(win , (UBYTE *) "File Transfer",ATB_DCS_ASCII); - AUI_edit_InsertChar(win , ctrlEnter); - } - TRACE_EVENT_P2(" sdpServicesMask = %d , SDP_SERVICE_DUN =%d",sdpServicesMask,sdpServicesMask& SDP_SERVICE_DUN); - if(sdpServicesMask& SDP_SERVICE_DUN ) - { - AUI_edit_InsertString(win , (UBYTE *) "Dial Up Networking",ATB_DCS_ASCII); - - AUI_edit_InsertChar(win , ctrlEnter); - } - TRACE_EVENT_P2(" sdpServicesMask = %d , SDP_SERVICE_A2DP =%d",sdpServicesMask,sdpServicesMask& SDP_SERVICE_A2DP); - if(sdpServicesMask& SDP_SERVICE_A2DP) - { - AUI_edit_InsertString(win , (UBYTE *) "A2DP",ATB_DCS_ASCII); - - AUI_edit_InsertChar(win , ctrlEnter); - } - if(sdpServicesMask ==0) - { - - AUI_edit_InsertString(win , (UBYTE *) "No Services",ATB_DCS_ASCII); - } - TRACE_EVENT_P1("editor_data->editor_attr.mode before %x",editor_data.editor_attr.mode); - - win_data = ((T_MFW_HDR *)win)->data; - edtdata = (T_AUI_EDITOR_INFO *)win_data->user; - edtdata->editor->attr->mode = ED_MODE_READONLY; - - TRACE_EVENT_P1("editor_data->editor_attr.mode after %x",editor_data.editor_attr.mode); - win_show(win); - return win; - - } - - - -/******************************************************************************* - $Function: mmi_btips_bmg_services_editor_exec_cb - - $Description: Event handler for the editor - - $Returns: None - - $Arguments: win -current window - identifier -window id - reason -Event cause. -*******************************************************************************/ -static void mmi_btips_bmg_services_editor_exec_cb(T_MFW_HND win, USHORT identifier, SHORT reason) -{ - TRACE_FUNCTION ("mmi_btips_bmg_services_editor_exec_cb()"); - switch (reason) - { - case INFO_KCD_LEFT: - case INFO_KCD_HUP: - case INFO_KCD_RIGHT: - mmi_btips_bmg_services_editor_destroy( ); - break; - default: - /* otherwise no action to be performed - */ - break; - - } -} - -/******************************************************************************* - $Function: mmi_btips_bmg_services_editor_destroy - - $Description: Frees the allocated memory - - $Returns: None - - $Arguments: None -*******************************************************************************/ -void mmi_btips_bmg_services_editor_destroy(void) -{ - TRACE_FUNCTION ("mmi_btips_bmg_services_editor_destroy"); - mfwFree((U8 *)services_data->edt_buf, BTIPS_MAX_SERVICES_BUFFER); - mfwFree((U8 *)services_data, sizeof(T_MMI_BTIPS_SERVICES_STRUCT)); -} - - -T_MFW_HND mmi_btips_bmg_ask_cancelBond(T_MFW_HND parent, char * str1, char * str2, T_VOID_FUNC callback) -{ - T_DISPLAY_DATA display_info; - - TRACE_FUNCTION("mmi_btips_bmg_cancelBonding_ask"); - dlg_initDisplayData_TextStr( &display_info, TxtNull, TxtCancel, str1, str2, COLOUR_STATUS); - dlg_initDisplayData_events( &display_info, callback, FOREVER, KEY_LEFT|KEY_RIGHT | KEY_CLEAR | KEY_HUP); - return info_dialog(parent,&display_info); -} - -void mmi_btips_bmg_bonding_cancelled_cb(T_MFW_HND win, UBYTE identifier, UBYTE reason) -{ - - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_dialog_info * data = (T_dialog_info *)win_data->user; - - T_MFW_WIN *parent_win_data = ((T_MFW_HDR *) data->parent_win)->data; - T_MMI_Btips_Bmg_DevicesWin_data * parent_data = (T_MMI_Btips_Bmg_DevicesWin_data *)parent_win_data->user; - T_MFW_HND parent_win = parent_data->win; - int oldBondState; - - TRACE_FUNCTION_P1("mmi_btips_bmg_bonding_cancelled_cb %d", reason); - - switch (reason) - { - case INFO_KCD_LEFT: - TRACE_ERROR("No LSK for Bond Cancellation"); - break; - case INFO_KCD_HUP: - case INFO_KCD_RIGHT: - /*Cancel the ongoing bond operation*/ - oldBondState = parent_data->bondState; - parent_data->bondState == BOND_CANCELLED; - TRACE_EVENT_P2("Bond State changed from %d to %d", oldBondState, parent_data->bondState); - mfw_btips_bmgCancelBond(&parent_data->deviceList[parent_data->currentListIndex-1].bdAddr); - break; - case INFO_KCD_CLEAR: - break; - default: - break; - } -} - -void mmi_btips_ResumeBTMainMenu(T_MFW_HND win, UBYTE identifier, UBYTE reason) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_dialog_info * data = (T_dialog_info *)win_data->user; - - TRACE_FUNCTION_P1("mmi_btips_ResumeBTMainMenu %d", reason); - - switch (reason) - { - case INFO_KCD_LEFT: - TRACE_ERROR("No LSK - mmi_btips_refreshScreen"); - break; - case INFO_KCD_HUP: - case INFO_KCD_RIGHT: - TRACE_ERROR("No RSK - mmi_btips_refreshScreen"); - break; - case INFO_KCD_CLEAR: - break; - default: - break; - } - -dspl_Enable(1); -} - - -void mmi_btips_refreshScreen(T_MFW_HND win, UBYTE identifier, UBYTE reason) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_dialog_info * data = (T_dialog_info *)win_data->user; - - TRACE_FUNCTION_P1("mmi_btips_refreshScreen %d", reason); - - switch (reason) - { - case INFO_KCD_LEFT: - TRACE_ERROR("No LSK - mmi_btips_refreshScreen"); - break; - case INFO_KCD_HUP: - case INFO_KCD_RIGHT: - TRACE_ERROR("No RSK - mmi_btips_refreshScreen"); - break; - case INFO_KCD_CLEAR: - break; - default: - break; - } - dspl_Enable(1); -} - - -#endif diff -r 7160f0d005d2 -r 332bff2bd3b4 src/ui/bmi/mmiBtipsBmg.h --- a/src/ui/bmi/mmiBtipsBmg.h Mon Oct 26 23:46:55 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,194 +0,0 @@ -#ifndef _MMIBTIPS_BMG_H_ -#define _MMIBTIPS_BMG_H_ - -/* ========================================================= -* Texas Instruments OMAP(TM) Platform Software -* (c) Copyright Texas Instruments, Incorporated. All Rights Reserved. -* -* Use of this software is controlled by the terms and conditions found -* in the license agreement under which this software has been supplied. -* ========================================================== */ -/* - $Project name: Basic Bluetooth MMI - $Project code: - $Module: Bluetooth BMG APPlication - $File: MmiBtipsBmg.h - $Revision: 1.0 - $Author: Texas Instruments - $Date: 26/06/07 - -******************************************************************************** - - Description: - - This module provides the BTIPS BMG APPlication functionality. - -******************************************************************************** - $History: MmiBtipsBmg.h - - 26/06/07 Sasken original version - - $End - -*******************************************************************************/ -#define BTL_BMG_MAX_PIN_LENGTH 17 -#define BT_MAX_REM_DEV_NAME 248 -#define BTIPS_MAX_SERVICES_BUFFER 200 //Buffer for the AUI_EDITOR to display the services supported by a particluar paired device - -#define T_MFW_BTIPS_SEARCH_CB BtipsSearchCb -typedef int (*BtipsSearchCb) (BD_ADDR); /* MFW event handler */ - -/* ====================================================== */ -/* -* List Attribute -*/ -/* ====================================================== */ -static const MfwMnuAttr BtipsDeviceList_Attrib = -{ - &menuArea, - MNU_LEFT| MNU_LIST_ICONS| MNU_CUR_LINE, /* centered page menu */ - (U8)-1, /* use default font */ - NULL, /* with these items */ - 0, /* number of items */ - COLOUR_LIST_XX, -#ifdef FF_MMI_BTIPS_APP - TxtBtipsApp, -#endif - NULL, - MNUATTRSPARE -}; -//Structure to access buffer for AUI Editor -typedef struct -{ - - char * edt_buf; -} T_MMI_BTIPS_SERVICES_STRUCT; - -/*--------------------------------------------------------------------------- - * BondState type - * - * MMI Bluetooth states for bond process - */ -typedef U8 BondState; - -#define BOND_NOT_STARTED 0x00 /* No request from user*/ -#define BOND_USER_REQUESTED 0x01 /* User has requested but the process is not started*/ -#define BOND_PIN_TAKEN 0x02 /*Pin was taken from user and send to peer device, no response yet */ -#define BOND_CANCELLED 0x03 /* User cancelled the request*/ -#define PIN_REQUEST_RECEIVED 0x04 /* Response received from peer device for the sent PIN request*/ -/* End of BondState */ - -/*--------------------------------------------------------------------------- - * InquiryState type - * - * MMI Bluetooth states for Inquiry process - */ -typedef U8 InquiryState; - -#define INQUIRY_NOT_STARTED 0x00 /* No on-going inquiryprocess*/ -#define INQUIRY_STARTED 0x01 /*Inquiry is on-going, neither cancelled nor complete*/ -#define INQUIRY_CANCELLATION_STARTED 0x02 /* User requested to cancel the inquiry*/ -#define INQUIRY_CANCELLATION_COMPLETE 0x03 /*Cancellation complete*/ -#define INQUIRY_COMPLETE 0x04 /*Inquiry comlpete*/ -/* End of InquiryState */ - -#define SHOW_NO_LIST 0 // this is to keep the window alive, to pop up the pinkey window for bond -#define SHOW_PAIRED_LIST 1 -#define SHOW_SEARCH_LIST 2 -#define SHOW_NONE_EXIT 3//Exit now - -#define SERVICESMASK_NOT_EMPTY 1 -#define SERVICESMASK_EMPTY 0 -typedef struct _T_MMI_Btips_Bmg_DevicesWin_data -{ - T_MMI_CONTROL mmi_control; - T_MFW_HND win; - T_MFW_HND mfwwin; - T_MFW_HND parent; - T_MFW_HND kbd; - T_MFW_HND bondCancellationWindow; - SHORT id; - - /*Editor for Pincode request*/ - T_MFW_HND pinCode_editor; - U8 pinCode[4]; - - /*Create a list for displaying devices*/ - ListMenuData *menu_list_data; - T_MFW_HND list_win;//Hanlder for the list - U32 listCount; - BOOL listID; //for Inquiry list = SHOW_SEARCH_LIST, for paired list = SHOW_PAIRED_LIST - - /*Create a list for displaying connected devices*/ - ListMenuData *menu_list_connected_data; - T_MFW_HND list_connected_win;//Hanlder for the list - U32 listCountConnectedDevices; - U32 noConnectedDevices; - Bmg_ConnectedDeviceList connected_deviceList[BT_MAX_DEVICE_LIST]; - //BOOL listID; //for Inquiry list = SHOW_SEARCH_LIST, for paired list = SHOW_PAIRED_LIST - - /*Global Data related to BTIPS Application Statemachine*/ - BOOL searchType; - InquiryState inquiryState; - BondState bondState; - U32 noPairedDevices; - U32 noInquiredDevices; - U32 currentListIndex; - Bmg_DeviceList deviceList[BT_MAX_DEVICE_LIST]; -BtipsSearchCb searchCB; - -}T_MMI_Btips_Bmg_DevicesWin_data; - -typedef enum { - BTIPS_BMG_PAIRED_DEVICES_INIT=0, - BTIPS_BMG_INQUIRY_RESULT_DEVICES_INIT, - BTIPS_BMG_BONDING_REQUEST_INIT, - BTIPS_BMG_BONDING_REQUEST_SENT, - BTIPS_BMG_DEVICES_LIST_WIN_DEINIT, - BTIPS_BMG_DEVICES_EXIT_WIN, -}BTIPS_BMG_DEVICES_WIN_EVENT; - -typedef enum { - BTIPS_BMG_CONNECTED_DEVICES_EXIT_WIN=0, -}BTIPS_BMG_CONNECTED_DEVICES_WIN_EVENT; -/********************************************************************* - BMG Editor Data for PhoneName Editor , PinCode Editor -*********************************************************************/ -typedef enum { - BTIPS_BMG_LOCAL_EDITOR_INIT=0, - BTIPS_BMG_REMOTE_EDITOR_INIT, - BTIPS_BMG_EDITOR_CANCEL -}BTIPS_BMG_PHONENAME_EDITOR_EVENT; - -typedef struct _T_MMI_Btips_Bmg_PhoneName_Win_data -{ - T_MMI_CONTROL mmi_control; - T_MFW_HND win; - T_MFW_HND mfwwin; - T_MFW_HND parent; - T_MFW_HND kbd; - SHORT id; - T_MFW_HND phoneName_editor; - UBYTE phoneNameBuffer[BT_MAX_REM_DEV_NAME]; /* pointer of text and number */ - BOOL local_device; //TRUE indicates Local device and FALSE indicates Remote Device -} T_MMI_Btips_Bmg_PhoneName_Win_data; - -typedef struct _T_MMI_Btips_Bmg_PinCode_Win_data -{ - T_MMI_CONTROL mmi_control; - T_MFW_HND win; - T_MFW_HND mfwwin; - T_MFW_HND parent; - T_MFW_HND kbd; - SHORT id; - T_MFW_HND pinCode_editor; - UBYTE pinCodeBuffer[16]; /* pointer of text and number *///sundeep changed from 4 -} T_MMI_Btips_Bmg_PinCode_Win_data; -/********************************************************************* - BMG Editor END -*********************************************************************/ - -T_MFW_HND mmi_btips_bmg_pinCode_editor_create(MfwHnd parent_window); -T_MFW_HND mmi_btips_bmg_devices_win_create(T_MFW_HND parent, BOOL searchType, T_MFW_BTIPS_SEARCH_CB searchCB); -T_MFW_HND mmi_btips_bmg_services_editor_create(T_MFW_HND parent_win, SdpServicesMask sdpServicesMask); -#endif diff -r 7160f0d005d2 -r 332bff2bd3b4 src/ui/bmi/mmiBtipsFtps.c --- a/src/ui/bmi/mmiBtipsFtps.c Mon Oct 26 23:46:55 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* ========================================================= - -* Texas Instruments OMAP(TM) Platform Software -* (c) Copyright Texas Instruments, Incorporated. All Rights Reserved. -* -* Use of this software is controlled by the terms and conditions found -* in the license agreement under which this software has been supplied. -* ========================================================== */ -/* - $Project name: Basic Bluetooth MMI - $Project code: - $Module: Bluetooth BMG APPlication - $File: MmiBtipsBmg.c - $Revision: 1.0 - $Author: Texas Instruments - $Date: 26/06/07 - -******************************************************************************** - - Description: - - This module provides the BTIPS BMG APPlication functionality. - -******************************************************************************** - $History: MmiBtipsBmg.c - - 26/06/07 Sasken original version - - $End - -*******************************************************************************/ - - - - -/******************************************************************************* - - Include files - -*******************************************************************************/ - -#define ENTITY_MFW - -#include - -#if defined (NEW_FRAME) - -#include "typedefs.h" -#include "vsi.h" -#include "pei.h" -#include "custom.h" -#include "gsm.h" -#include "prim.h" - -#else - -#include "STDDEFS.H" -#include "custom.h" -#include "gsm.h" -#include "vsi.h" - -#endif - -#ifdef FF_MMI_BTIPS_APP - -#endif diff -r 7160f0d005d2 -r 332bff2bd3b4 src/ui/bmi/mmiBtipsGlobal.h --- a/src/ui/bmi/mmiBtipsGlobal.h Mon Oct 26 23:46:55 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -#ifndef _MMIBTIPSGLOBAL_H_ -#define _MMIBTIPSGLOBAL_H_ - -/* ========================================================= -* Texas Instruments OMAP(TM) Platform Software -* (c) Copyright Texas Instruments, Incorporated. All Rights Reserved. -* -* Use of this software is controlled by the terms and conditions found -* in the license agreement under which this software has been supplied. -* ========================================================== */ -/* - $Project name: Basic Bluetooth MMI - $Project code: - $Module: Bluetooth BMG APPlication - $File: MmiBtipsBmg.h - $Revision: 1.0 - $Author: Texas Instruments - $Date: 26/06/07 - -******************************************************************************** - - Description: - - This module provides the BTIPS BMG APPlication functionality. - -******************************************************************************** - $History: MmiBtipsBmg.h - - 26/06/07 Sasken original version - - $End - -*******************************************************************************/ -/******************************************************************************* - - Public methods - -*******************************************************************************/ -USHORT mmi_btipsRadioOnStatus(struct MfwMnuTag *m, - struct MfwMnuAttrTag *ma, - struct MfwMnuItemTag *mi); -USHORT mmi_btipsRadioOffStatus(struct MfwMnuTag *m, - struct MfwMnuAttrTag *ma, - struct MfwMnuItemTag *mi); - int mmi_btipsRadioOn(MfwMnu* m, MfwMnuItem* i); -GLOBAL int mmi_btipsRadioOff(void); -int mmi_btips_bmgDevices(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_bmgPhoneName(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_bmgSetVisibility(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_bmgConnectedDevices(MfwMnu* m,MfwMnuItem* i); -int mmi_btips_bmgHidePhone(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_bmgShowPhone(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_bmgSetConnectPermissionAllow(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_bmgSetConnectPermissionAsk(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_bmgDeviceDelete(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_bmgDeviceDisconnect(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_bmgDeviceSetRemotename(MfwMnu* m, MfwMnuItem* i); -USHORT mmi_btips_bmgIsVisible( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi ); -USHORT mmi_btips_bmgIsInvisible( struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi ); -int mmi_btips_vgIncomingCallInHandsfree(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_vgIncomingCallInPhone(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_vgMyHandsfree(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_VgConnect(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_vgIsDeviceConnected (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi); -int mmi_btips_VgDisconnect(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_vgIsDeviceDisconnected (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi); -int mmi_btips_a2dpHandler(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_oppcHandler(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_oppcPullHandler(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_oppcExchangeHandler(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_a2dpPlayOnSingleDevice(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_a2dpPlayOnMultipleDevice(MfwMnu* m, MfwMnuItem* i); -GLOBAL int mmi_btips_services(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_a2dpDeviceSearchWnd(); -USHORT mmi_Btips_is_audio_on_phone (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, - struct MfwMnuItemTag *mi); -USHORT mmi_Btips_is_audio_on_handsfree (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, - struct MfwMnuItemTag *mi); -USHORT mmi_Btips_is_audio_handover_possible (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, - struct MfwMnuItemTag *mi); -int mmi_BtipsTransferAudioToPhone (MfwMnu* m, MfwMnuItem* i); -int mmi_BtipsTransferAudioToHF (MfwMnu* m, MfwMnuItem* i); -int mmi_BtipsAudioHandOver (MfwMnu* m, MfwMnuItem* i); -int mmi_BtipsMyHandsfree(MfwMnu* m, MfwMnuItem* i); -#endif //_MMIBTIPSGLOBAL_H_ \ No newline at end of file diff -r 7160f0d005d2 -r 332bff2bd3b4 src/ui/bmi/mmiBtipsMdg.c --- a/src/ui/bmi/mmiBtipsMdg.c Mon Oct 26 23:46:55 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* ========================================================= -* Texas Instruments OMAP(TM) Platform Software -* (c) Copyright Texas Instruments, Incorporated. All Rights Reserved. -* -* Use of this software is controlled by the terms and conditions found -* in the license agreement under which this software has been supplied. -* ========================================================== */ -/* - $Project name: Basic Bluetooth MMI - $Project code: - $Module: Bluetooth BMG APPlication - $File: MmiBtipsBmg.c - $Revision: 1.0 - $Author: Texas Instruments - $Date: 26/06/07 - -******************************************************************************** - - Description: - - This module provides the BTIPS BMG APPlication functionality. - -******************************************************************************** - $History: MmiBtipsBmg.c - - 26/06/07 Sasken original version - - $End - -*******************************************************************************/ - - - - -/******************************************************************************* - - Include files - -*******************************************************************************/ - -#define ENTITY_MFW - -#include - -#if defined (NEW_FRAME) - -#include "typedefs.h" -#include "vsi.h" -#include "pei.h" -#include "custom.h" -#include "gsm.h" -#include "prim.h" - -#else - -#include "STDDEFS.H" -#include "custom.h" -#include "gsm.h" -#include "vsi.h" - -#endif - -#ifdef FF_MMI_BTIPS_APP - -#endif diff -r 7160f0d005d2 -r 332bff2bd3b4 src/ui/bmi/mmiBtipsOppc.c --- a/src/ui/bmi/mmiBtipsOppc.c Mon Oct 26 23:46:55 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,547 +0,0 @@ -/* ========================================================= -* Texas Instruments OMAP(TM) Platform Software -* (c) Copyright Texas Instruments, Incorporated. All Rights Reserved. -* -* Use of this software is controlled by the terms and conditions found -* in the license agreement under which this software has been supplied. -* ========================================================== */ -/* - $Project name: Basic Bluetooth MMI - $Project code: - $Module: Bluetooth BMG APPlication - $File: MmiBtipsBmg.c - $Revision: 1.0 - $Author: Texas Instruments - $Date: 26/06/07 - -******************************************************************************** - - Description: - - This module provides the BTIPS BMG APPlication functionality. - -******************************************************************************** - $History: MmiBtipsBmg.c - - 26/06/07 Sasken original version - - $End - -*******************************************************************************/ - - - - -/******************************************************************************* - - Include files - -*******************************************************************************/ - -#define ENTITY_MFW - -#include - -/* BTIPS Includes */ -#include "me.h" - - -#if defined (NEW_FRAME) - -#include "typedefs.h" -#include "vsi.h" -#include "pei.h" -#include "custom.h" -#include "gsm.h" -#include "prim.h" - -#else - -#include "STDDEFS.H" -#include "custom.h" -#include "gsm.h" -#include "vsi.h" - -#endif - -#include "mfw_mfw.h" -#include "mfw_win.h" -#include "mfw_icn.h" /* included for mfw_mnu.h */ -#include "mfw_mnu.h" -#include "mfw_tim.h" -#include "mfw_kbd.h" -#include "mfw_sat.h" /* included for MmiDummy.h, included for MmiMenu.h */ -#include "MmiBlkLangDB.h" -#include "mmiColours.h" -#include "MmiDialogs.h" -#include "MmiDummy.h" /* included for MmiMenu.h */ -#include "MmiLists.h" -#include "MmiMenu.h" -#include "MmiSoftKeys.h" -#include "AUIEditor.h" -#include "MmiMain.h" -#include "Mmiicons.h" -#include "MmiWindow.h" -#include "MmiCall.h" -#include "mmiBookShared.h" - -#include "mmiBtips.h" -#include "mfw_btips.h" -#include "mmiBtipsOppc.h" -#include "mfw_BtipsOppc.h" -#include "mfw_BtipsBmg.h" - -#ifdef FF_MMI_BTIPS_APP - -#endif - -/*Function Declarations*/ - -#define OPPC_MAX_FILES 10 - - -int oppc_files_count; -char* oppc_file_names[OPPC_MAX_FILES]; -#define OPPC_INFO_SCRN_TIMEOUT 1500//Timeout for InfoDialog -char push_file_name[256]; -char pull_file_name[256]; - -int mmi_btips_oppcDeviceSearchCallback(BD_ADDR bdAddr); -int mmi_btips_oppcPullDeviceSearchCallback(BD_ADDR bdAddr); -int mmi_btips_oppcExchangeDeviceSearchCallback(BD_ADDR bdAddr); - - int mmi_btips_oppcPullHandler(MfwMnu* m, MfwMnuItem* i) -{ - TRACE_FUNCTION("mmi_btips_oppcPullHandler"); - mmi_btips_oppcDeviceSearchWnd(1); - } - - int mmi_btips_oppcExchangeHandler(MfwMnu* m, MfwMnuItem* i) -{ - TRACE_FUNCTION("mmi_btips_oppcExchangeHandler"); - mmi_btips_oppcDeviceSearchWnd(2); - } - - int mmi_btips_oppcHandler(MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND win; - T_MFW_HND parent_win = mfw_parent(mfw_header()); - int numFiles=0; - - TRACE_FUNCTION ("mmi_btips_oppcHandler"); - oppc_files_count = OPPC_MAX_FILES; - oppc_files_count=mfw_btips_oppcPopulateFiles(oppc_file_names,OPPC_MAX_FILES, - BT_DEMO_FOLDER_PATH); - TRACE_FUNCTION_P1("oppc_files_count - %d", oppc_files_count); - numFiles = mfw_btips_oppcGetNumFiles(); - mmi_btips_oppcShowInfoDlg(0, TxtMidiFileNotLoaded, TxtNull, NULL); - TRACE_EVENT_P1("mmi_btips_oppcHandler: numFiles is %d",numFiles); - - if(numFiles <= 0) - { - mmi_btips_oppcShowInfoDlg(0, TxtMidiFileNotLoaded, TxtNull, NULL); - - } - else - { - win = mmi_btips_oppcBuildMenu(parent_win); - if (win NEQ NULL) - { - SEND_EVENT (win, BTIPS_OPPC_LIST_INIT, 0, 0); - } - - } - - return MFW_EVENT_CONSUMED; -} - - /******************************************************************************* - - $Function: mmi_btips_oppcBuildMenu - - $Description: To hold list window - - $Returns: Window handle - - $Arguments: -*******************************************************************************/ - -static T_MFW_HND mmi_btips_oppcBuildMenu( MfwHnd parent_window) -{ - T_MMI_Btips_Oppc_Win_data * data = (T_MMI_Btips_Oppc_Win_data *)mfwAlloc(sizeof (T_MMI_Btips_Oppc_Win_data)); - T_MFW_WIN * win; - - TRACE_FUNCTION ("mmi_btips_oppcBuildMenu"); - /* - * Create window handler - */ - - data->win = win_create (parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB)mmi_btips_oppcListWinCb); - if (data->win EQ NULL) - { - return NULL; - } - - TRACE_EVENT("list holder window created: " ); - /* - * connect the dialog data to the MFW-window - */ - - data->mmi_control.dialog = (T_DIALOG_FUNC)mmi_btips_oppcListWinExecCb; - data->mmi_control.data = data; - win = ((T_MFW_HDR *)data->win)->data; - win->user = (void *)data; - data->parent = parent_window; - winShow(data->win); - /* - * return window handle - */ - - return data->win; -} - -/******************************************************************************* - - $Function: mmi_btips_oppcListWinCb - - $Description: Window event handler - - $Returns: MFW_EVENT_REJECTED: - MFW_EVENT_CONSUMED: - - $Arguments: - -*******************************************************************************/ -static int mmi_btips_oppcListWinCb (MfwEvt e, MfwWin *w) -{ - TRACE_FUNCTION ("mmi_btips_oppcListWinCb()"); - switch (e) - { - case MfwWinVisible: /* window is visible */ - break; - case MfwWinFocussed: /* input focus / selected */ - case MfwWinDelete: /* window will be deleted */ - - default: - return MFW_EVENT_REJECTED; - } - return MFW_EVENT_CONSUMED; -} - -/******************************************************************************* - - $Function: mmi_btips_oppcListWinExecCb - - $Description: Call back function - - $Returns: none - - $Arguments: - -*******************************************************************************/ -void mmi_btips_oppcListWinExecCb (T_MFW_HND win, USHORT event, SHORT value, void * parameter) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data; - T_MMI_Btips_Oppc_Win_data * data = (T_MMI_Btips_Oppc_Win_data *)win_data->user; - int max_file_number; - int i; - - ListWinInfo * mnu_data = (ListWinInfo *)parameter; - - TRACE_FUNCTION ("mmi_btips_oppcListWinExecCb()"); - switch (event) - { - T_MFW OppcListCreationStatus; - case BTIPS_OPPC_LIST_INIT: - { - - TRACE_EVENT("mmi_btips_oppcListWinExecCb() Event:E_INIT"); - - /* initialization of administrative data */ - - data->menu_list_data = (ListMenuData *)ALLOC_MEMORY(sizeof(ListMenuData)); - - if(data->menu_list_data == 0) - { - TRACE_EVENT("Failed memory alloc 1 "); - return; - } - - max_file_number = mfw_btips_oppcGetNumFiles(); - //In case no files have been loaded display info message - //In case no files have been loaded return info message - if(max_file_number == 0) - { - return; - } - - - data->menu_list_data->List = (T_MFW_MNU_ITEM *)ALLOC_MEMORY( max_file_number * sizeof(T_MFW_MNU_ITEM) ); - - if(data->menu_list_data->List == 0) - { - TRACE_EVENT("Failed memory alloc 2"); - return; - } - for (i = 0; i < max_file_number ; i++) - { - mnuInitDataItem(&data->menu_list_data->List[i]); - data->menu_list_data->List[i].flagFunc = item_flag_none; - //Display the OPPC file names in the list - data->menu_list_data->List[i].str = - (char *)mfw_btips_oppcGetFileName(data->oppc_file_count++); - } - - data->menu_list_data->ListLength =max_file_number; - data->menu_list_data->ListPosition = 1; - data->menu_list_data->CursorPosition = 1; - data->menu_list_data->SnapshotSize = max_file_number; - data->menu_list_data->Font = 0; - data->menu_list_data->LeftSoftKey = TxtSoftSelect; - data->menu_list_data->RightSoftKey = TxtSoftBack; - data->menu_list_data->KeyEvents = KEY_ALL; - data->menu_list_data->Reason = 0; - data->menu_list_data->Strings = TRUE; - data->menu_list_data->Attr = (MfwMnuAttr*)&BtipsOppcList_Attrib; - data->menu_list_data->Attr->hdrId = TxtPlayerSelectFile; - data->menu_list_data->autoDestroy = FALSE; - OppcListCreationStatus = - listDisplayListMenu (win, data->menu_list_data, - (ListCbFunc)mmi_btips_oppcListMenuCb,0); - if (LISTS_OK == OppcListCreationStatus) - { - #if 0 - /*If control reached this point then List of files are showed on display*/ - isMidiListON = TRUE; - /*Create one timer and play the file only if that timer expires*/ - /*Play the first file if user hasn't pressed the up and down for half a second */ - mfw_player_currently_playing_idx = 0; - midiBrowseTimer = timCreate( 0, TIME_HALFSECOND, (MfwCb)midi_test_play_browsing); - timStart( midiBrowseTimer ); - #endif - } - } - break; - default: - break; - } - -} - -/******************************************************************************* - - $Function: midi_mt_menu_list_listmnu_cb - - $Description: destroy lists and menu in case of back softkey or menu exit - - $Returns: - - $Arguments: - -*******************************************************************************/ -static void mmi_btips_oppcListMenuCb(T_MFW_HND Parent, ListMenuData * ListData) -{ - T_MFW_WIN *win_data = ((T_MFW_HDR *)Parent)->data; - T_MMI_Btips_Oppc_Win_data *data = (T_MMI_Btips_Oppc_Win_data *)win_data->user; - char* szSelectedFileExt; - T_MFW_HND parent_win = mfw_parent(mfw_header()); - TRACE_FUNCTION ("mmi_btips_oppcListMenuCb()"); - - if ((ListData->Reason EQ LISTS_REASON_BACK) || - (ListData->Reason EQ LISTS_REASON_CLEAR) || - (ListData->Reason EQ LISTS_REASON_HANGUP)) - { - /* - ** Destroy the window --- Not sure if this is required! ... leave it out for now - */ - listsDestroy(ListData->win); - - /* - ** Free the memory set aside for ALL the devices to be listed. - */ - if (data->menu_list_data != NULL) - { - FREE_MEMORY ((void *)data->menu_list_data->List, (U16)(data->oppc_num_file * sizeof (T_MFW_MNU_ITEM))); - FREE_MEMORY ((void *)data->menu_list_data, sizeof (ListMenuData)); - } - - mmi_btips_oppcListMenuDestroy(data->win); - #if 0 - // June 19, 2006 REF: DRT OMAPS00076378 x0012849 - /*At this point the MIDI list is destroyed*/ - isMidiListON = FALSE; - /* At this point the play need to be stopped. If user wants the file need to - be played while going across menu then 'play' or 'play all' need to be selected */ - midi_stop_player (NULL, NULL); - if (midiBrowseTimer != NULL) - { - // Delete the timer. It's not required any more. - timDelete (midiBrowseTimer); - } - #endif - } - else if(ListData->Reason EQ LISTS_REASON_SELECT) - { - strcpy(push_file_name, OPPC_DEFAULT_PUSH_PULL_DIR); - //strcat(push_file_name, ListData->List->str); - strcat(push_file_name, ListData->List[ListData->ListPosition].str); - mmi_btips_oppcDeviceSearchWnd(0); - #if 0 - szSelectedFileExt = mfw_btips_oppcGetExtension(mfw_btips_oppcGetFileName(ListData->CursorPosition)); - - //This was for the Options menu - //data->oppc_optionsMenu=(T_MFW_HND)bookMenuStart( parent_win, btipsOppcOptionsMenuAttributes(), 0); - if ( (strcmp(szSelectedFileExt, "mp3") == 0)) - { - mmi_btips_oppcDeviceSearchWnd(); - } - else if ( (strcmp(szSelectedFileExt, "pcm") == 0)) - { - mmi_btips_oppcDeviceSearchWnd(); - } - else if ( (strcmp(szSelectedFileExt, "wav") == 0)) - { - mmi_btips_oppcDeviceSearchWnd(); - } - else - { - //It should never come here - } - #endif - - #if 0 - TRACE_EVENT_P1("list position is %d",ListData->ListPosition); - mt_menu_data.mt_list_idx = ListData->ListPosition; - //call mfw to save selected index - mfw_player_save_selected_file_idx(mt_menu_data.mt_list_idx); - //display a "file selected" text here - mmi_midi_test_show_info(0, TxtMidiFileSelected, TxtNull, NULL); - #endif - } - - return; -} - -/******************************************************************************* - - $Function: mmi_btips_oppcListMenuDestroy - - $Description: destroy menu window - - $Returns: - - $Arguments: window to be destroyed - -*******************************************************************************/ -static void mmi_btips_oppcListMenuDestroy(MfwHnd window) -{ - T_MFW_WIN * win_data = ((T_MFW_HDR *)window)->data; - T_MMI_Btips_Oppc_Win_data * data = (T_MMI_Btips_Oppc_Win_data *)win_data->user; - - TRACE_FUNCTION ("mmi_btips_oppcListMenuDestroy"); - - if (window == NULL) - { - return; - } - - if (data) - { - win_delete(data->win); - - /* - ** Free Memory - */ - mfwFree((void *)data, sizeof (T_MMI_Btips_Oppc_Win_data)); - } -} -/******************************************************************************* - - $Function: mmi_btips_oppcShowInfoDlg - - $Description: Display the Dialog - - $Returns: - - $Arguments: - -*******************************************************************************/ -static MfwHnd mmi_btips_oppcShowInfoDlg(T_MFW_HND parent, int str1, int str2, T_VOID_FUNC callback) -{ - T_DISPLAY_DATA display_info; - - TRACE_FUNCTION ("mmi_btips_oppcShowInfoDlg()"); - - /* - ** Create a timed dialog to display the Message "Failed" - */ - dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, str1, str2, COLOUR_STATUS); - dlg_initDisplayData_events( &display_info, callback, OPPC_INFO_SCRN_TIMEOUT, KEY_LEFT | KEY_CLEAR | KEY_HUP); - - return info_dialog(parent, &display_info); -} - -int mmi_btips_oppcDeviceSearchWnd(int type) -{ - T_MFW_HND parent_win = mfwParent(mfw_header()); - //mmi_btips_bmg_devices_win_create(parent_win, BTIPS_GENERIC_DEVICE_SEARCH, NULL); - switch (type) - { - case 0: - mmi_btips_bmg_devices_win_create(parent_win, BTIPS_OPP_DEVICE_SEARCH, mmi_btips_oppcDeviceSearchCallback); - break; - - case 1: - mmi_btips_bmg_devices_win_create(parent_win, BTIPS_OPP_DEVICE_SEARCH, mmi_btips_oppcPullDeviceSearchCallback); - break; - - case 2: - mmi_btips_bmg_devices_win_create(parent_win, BTIPS_OPP_DEVICE_SEARCH, mmi_btips_oppcExchangeDeviceSearchCallback); - break; - } - - return MFW_EVENT_CONSUMED; -} -int mmi_btips_oppcDeviceSearchCallback(BD_ADDR bdAddr) -{ - static char szDevName[128]; - mfw_btips_bmgGetDeviceName(&bdAddr, szDevName); - TRACE_FUNCTION_P1("mmi_btips_oppcDeviceSearchCallback with Dev Name %s", szDevName); - mmi_btips_app_show_text(0, szDevName, "Selected Device",NULL); - //mmi_btips_app_show_text(0, szBdAddr, TxtNull, NULL); - //OPPCA_Connect(&bdAddr); - mfw_btips_oppcEncapsulatePush(push_file_name, &bdAddr); - return MFW_EVENT_CONSUMED; -} -int mmi_btips_oppcPullDeviceSearchCallback(BD_ADDR bdAddr) -{ - static char szDevName[128]; - mfw_btips_bmgGetDeviceName(&bdAddr, szDevName); - TRACE_FUNCTION_P1("mmi_btips_oppcDeviceSearchCallback with Dev Name %s", szDevName); - mmi_btips_app_show_text(0, szDevName, "Selected Device",NULL); - //mmi_btips_app_show_text(0, szBdAddr, TxtNull, NULL); - //OPPCA_Connect(&bdAddr); - strcpy(pull_file_name, OPPC_DEFAULT_PUSH_PULL_DIR); - strcat(pull_file_name, szDevName); - strcat(pull_file_name, OPPC_VCF_EXT); - mfw_btips_oppcEncapsulatePull(pull_file_name, &bdAddr); - return MFW_EVENT_CONSUMED; -} - -int mmi_btips_oppcExchangeDeviceSearchCallback(BD_ADDR bdAddr) -{ - static char szDevName[128]; - mfw_btips_bmgGetDeviceName(&bdAddr, szDevName); - TRACE_FUNCTION_P1("mmi_btips_oppcDeviceSearchCallback with Dev Name %s", szDevName); - mmi_btips_app_show_text(0, szDevName, "Selected Device",NULL); - //mmi_btips_app_show_text(0, szBdAddr, TxtNull, NULL); - //OPPCA_Connect(&bdAddr); - strcpy(push_file_name, OPPC_DEFAULT_PUSH_CARD); - strcpy(pull_file_name, OPPC_DEFAULT_PUSH_PULL_DIR); - strcat(pull_file_name, szDevName); - strcat(pull_file_name, OPPC_VCF_EXT); - mfw_btips_oppcEncapsulateExchange(push_file_name, pull_file_name, &bdAddr); - return MFW_EVENT_CONSUMED; -} - - diff -r 7160f0d005d2 -r 332bff2bd3b4 src/ui/bmi/mmiBtipsOppc.h --- a/src/ui/bmi/mmiBtipsOppc.h Mon Oct 26 23:46:55 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -#ifndef _MMIBTIPS_OPPC_H_ -#define _MMIBTIPS_OPPC_H_ - -/* ========================================================= -* Texas Instruments OMAP(TM) Platform Software -* (c) Copyright Texas Instruments, Incorporated. All Rights Reserved. -* -* Use of this software is controlled by the terms and conditions found -* in the license agreement under which this software has been supplied. -* ========================================================== */ -/* - $Project name: Basic Bluetooth OPP Client MMI - $Project code: - $Module: Bluetooth OPP Client APPlication - $File: mmiBtipsOppc.h - $Revision: 1.0 - $Author: Texas Instruments - $Date: 26/06/07 - -******************************************************************************** - - Description: - - This module provides the BTIPS BMG APPlication functionality. - -******************************************************************************** - $History: mmiBtipsOppc.h - - 26/06/07 Sasken original version - - $End - -*******************************************************************************/ - - -/* ====================================================== */ -/* -* List Attribute -*/ -/* ====================================================== */ -static const MfwMnuAttr BtipsOppcList_Attrib = -{ - &menuArea, - MNU_LEFT| MNU_LIST_ICONS| MNU_CUR_LINE, /* centered page menu */ - (U8)-1, /* use default font */ - NULL, /* with these items */ - 0, /* number of items */ - COLOUR_LIST_XX, - TxtBtipsOppc, - NULL, - MNUATTRSPARE -}; - - -typedef struct _T_MMI_Btips_Oppc_Win_data -{ - T_MMI_CONTROL mmi_control; - T_MFW_HND parent; - T_MFW_HND win; - T_MFW_HND kbd; - T_MFW_HND kbd_long; - T_MFW_HND oppc_optionsMenu; - - - T_VOID_FUNC func_cb; - T_VOID_FUNC cancel_cb; - UBYTE oppc_num_file; - UBYTE oppc_file_count; - ListCbFunc oppc_list_cb; - UBYTE oppc_list_idx; - UBYTE IsMfwInit; - ListMenuData * menu_list_data; - -}T_MMI_Btips_Oppc_Win_data; - -typedef enum { - BTIPS_OPPC_LIST_INIT=0, - BTIPS_OPPC_LIST_DEINIT -}BTIPS_OPPC_WIN_EVENT; - -#define OPPC_DEFAULT_PUSH_PULL_DIR "/MfwBtDemo/" -#define OPPC_DEFAULT_PUSH_CARD "/MfwBtDemo/default/mycard.vcf" -#define OPPC_VCF_EXT ".vcf" - -/*Function Declarations*/ - int mmi_btips_oppcHandler(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_oppcPullHandler(MfwMnu* m, MfwMnuItem* i); -int mmi_btips_oppcExchangeHandler(MfwMnu* m, MfwMnuItem* i); -static T_MFW_HND mmi_btips_oppcBuildMenu( MfwHnd parent_window); -static int mmi_btips_oppcListWinCb (MfwEvt e, MfwWin *w) ; -void mmi_btips_oppcListWinExecCb (T_MFW_HND win, USHORT event, - SHORT value, void * parameter); -static void mmi_btips_oppcListMenuCb(T_MFW_HND Parent, ListMenuData * ListData); -static void mmi_btips_oppcListMenuDestroy(MfwHnd window); -static MfwHnd mmi_btips_oppcShowInfoDlg(T_MFW_HND parent, int str1, int str2, - T_VOID_FUNC callback); - -int mmi_btips_oppcDeviceSearchWnd(int type); -#endif - diff -r 7160f0d005d2 -r 332bff2bd3b4 src/ui/bmi/mmiBtipsOpps.c --- a/src/ui/bmi/mmiBtipsOpps.c Mon Oct 26 23:46:55 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* ========================================================= -* Texas Instruments OMAP(TM) Platform Software -* (c) Copyright Texas Instruments, Incorporated. All Rights Reserved. -* -* Use of this software is controlled by the terms and conditions found -* in the license agreement under which this software has been supplied. -* ========================================================== */ -/* - $Project name: Basic Bluetooth MMI - $Project code: - $Module: Bluetooth BMG APPlication - $File: MmiBtipsBmg.c - $Revision: 1.0 - $Author: Texas Instruments - $Date: 26/06/07 - -******************************************************************************** - - Description: - - This module provides the BTIPS BMG APPlication functionality. - -******************************************************************************** - $History: MmiBtipsBmg.c - - 26/06/07 Sasken original version - - $End - -*******************************************************************************/ - - - - -/******************************************************************************* - - Include files - -*******************************************************************************/ - -#define ENTITY_MFW - -#include - -#if defined (NEW_FRAME) - -#include "typedefs.h" -#include "vsi.h" -#include "pei.h" -#include "custom.h" -#include "gsm.h" -#include "prim.h" - -#else - -#include "STDDEFS.H" -#include "custom.h" -#include "gsm.h" -#include "vsi.h" - -#endif - -#ifdef FF_MMI_BTIPS_APP - -#endif diff -r 7160f0d005d2 -r 332bff2bd3b4 src/ui/bmi/mmiBtipsVg.c --- a/src/ui/bmi/mmiBtipsVg.c Mon Oct 26 23:46:55 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,279 +0,0 @@ -/* ========================================================= -* Texas Instruments OMAP(TM) Platform Software -* (c) Copyright Texas Instruments, Incorporated. All Rights Reserved. -* -* Use of this software is controlled by the terms and conditions found -* in the license agreement under which this software has been supplied. -* ========================================================== */ -/* - $Project name: Basic Bluetooth MMI - $Project code: - $Module: Bluetooth BMG APPlication - $File: MmiBtipsBmg.c - $Revision: 1.0 - $Author: Texas Instruments - $Date: 26/06/07 - -******************************************************************************** - - Description: - - This module provides the BTIPS BMG APPlication functionality. - -******************************************************************************** - $History: MmiBtipsBmg.c - - 26/06/07 Sasken original version - - $End - -*******************************************************************************/ - - - - -/******************************************************************************* - - Include files - -*******************************************************************************/ - -#define ENTITY_MFW - -#include -#include "me.h" - -#if defined (NEW_FRAME) - -#include "typedefs.h" -#include "vsi.h" -#include "pei.h" -#include "custom.h" -#include "gsm.h" -#include "prim.h" - -#else - -#include "STDDEFS.H" -#include "custom.h" -#include "gsm.h" -#include "vsi.h" - -#endif - -#include "mfw_mfw.h" -#include "mfw_win.h" -#include "mfw_icn.h" /* included for mfw_mnu.h */ -#include "mfw_mnu.h" -#include "mfw_tim.h" -#include "mfw_kbd.h" -#include "mfw_sat.h" /* included for MmiDummy.h, included for MmiMenu.h */ -#include "MmiBlkLangDB.h" -#include "mmiColours.h" -#include "MmiDialogs.h" -#include "MmiDummy.h" /* included for MmiMenu.h */ -#include "MmiLists.h" -#include "MmiMenu.h" -#include "MmiSoftKeys.h" -#include "AUIEditor.h" -#include "MmiMain.h" -#include "Mmiicons.h" -#include "MmiWindow.h" -#include "MmiCall.h" -#include "mmiBookShared.h" - -#include "mfw_BtipsBmg.h" -#include "mfw_BtipsVg.h" -#include "mmiBtipsBmg.h" -#include "mmiBtips.h" - - -static BD_ADDR selectedDevice; -T_MFW_HND vgSrchWin; -T_MFW_HND vgConDisconnectWin; - -#ifdef FF_MMI_BTIPS_APP - -int mmi_btips_VgConnect(MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfwParent(mfw_header()); - mfw_btips_vgConnect (selectedDevice); - //win_delete(parent_win); - return MFW_EVENT_CONSUMED; -} - -USHORT mmi_btips_vgIsDeviceConnected()//(struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi) -{ - if (mfw_btips_vgIsDeviceConnected (selectedDevice) == TRUE) - { - return TRUE; - } - else - { - return FALSE; - } -} - -int mmi_btips_VgDisconnect(MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfwParent (mfw_header ( )); - mfw_btips_vgDisconnect (selectedDevice); - //win_delete(parent_win); - return MFW_EVENT_CONSUMED; -} - -USHORT mmi_btips_vgIsDeviceDisconnected()//(struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, struct MfwMnuItemTag *mi) -{ - if (mfw_btips_vgIsDeviceConnected (selectedDevice) == TRUE) - { - return FALSE; - } - else - { - return TRUE; - } - return MFW_EVENT_CONSUMED; -} - - -int mmi_BtipsVgSearchCb (BD_ADDR bdAddr) -{ - static char szDevName[128]; - T_MFW_HND parent = mfwParent(mfw_header()); - selectedDevice = bdAddr; - - mfw_btips_bmgGetDeviceName (&bdAddr, szDevName); - TRACE_FUNCTION_P1 ("mmi_BtipsVgSearchCb with Dev Name %s", szDevName); - mmi_btips_app_show_text (0, szDevName, "Selected", NULL); - //SEND_EVENT (vgSrchWin, BTIPS_BMG_DEVICES_EXIT_WIN, 0, (void *)NULL); -#ifdef FF_MMI_FMRADIO_APP - if(FALSE == mfw_fmRadio_isFmOverBT()) - { - vgConDisconnectWin = bookMenuStart (parent, (MfwMnuAttr *)btipsVgSelectedDeviceMenuAttributes(),0); - } - - else - { -#endif - /*This request is from FM Radio MMI*/ - if (FALSE == mfw_btips_vgIsDeviceConnected(selectedDevice)) - { - TRACE_FUNCTION ("mmi_BtipsVgSearchCb: FMOverBT, now make SLC"); - mfw_btips_vgConnect(selectedDevice); - } - else if(mfw_btips_vgIsAudioOnPhone()) - { - TRACE_FUNCTION ("mmi_BtipsVgSearchCb: FMOverBT, SLC UP, now create AUDIO connection"); - mfw_btips_vgTransferAudioToHF(); - } - else - { - TRACE_FUNCTION ("mmi_BtipsVgSearchCb: FMOverBT, SLC UP, Audio UP, Now Disconnect SLC"); - mfw_btips_vgDisconnect(selectedDevice); - } -// } - //SEND_EVENT (vgSrchWin, BTIPS_BMG_DEVICES_EXIT_WIN, 0, (void *)NULL);//sundeep - return MFW_EVENT_CONSUMED; -} - -/******************************************************************************* - - $Function: mmi_BtipsMyHandsfree - - $Description: - - $Returns: - - $Arguments: - -*******************************************************************************/ -int mmi_BtipsMyHandsfree(MfwMnu* m, MfwMnuItem* i) -{ -/* -Create a new window to -1. List out the current paired Handsfree Device -2. Give an option to search for new Handsfree Devices -*/ - T_MFW_HND parent_win = mfwParent(mfw_header()); - - TRACE_FUNCTION("mmi_BtipsMyHandsfree"); - - vgSrchWin = mmi_btips_bmg_devices_win_create (parent_win, BTIPS_HSHF_DEVICE_SEARCH, mmi_BtipsVgSearchCb); - - return MFW_EVENT_CONSUMED; -} - -int mmi_BtipsTransferAudioToPhone (MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfwParent (mfw_header ( )); - - mmi_btips_app_show_info (parent_win, TxtBtipsAudioOnPhone, TxtSelected, ONE_SECS,NULL); - - mfw_btips_vgTransferAudioToPhone ( ); - - return MFW_EVENT_CONSUMED; -} - -int mmi_BtipsTransferAudioToHF (MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfwParent (mfw_header ( )); - - mmi_btips_app_show_info (parent_win, TxtBtipsAudioOnHeadset, TxtSelected, ONE_SECS,NULL); - - mfw_btips_vgTransferAudioToHF ( ); - - return MFW_EVENT_CONSUMED; -} - -int mmi_BtipsAudioHandOver (MfwMnu* m, MfwMnuItem* i) -{ - T_MFW_HND parent_win = mfwParent (mfw_header ( )); - - mmi_btips_app_show_info (parent_win, TxtBtipsAudioSwitchToOtherHeadset, TxtSelected, ONE_SECS,NULL); -// mfw_btips_vgTransferAudioHandOver ( ); - - return MFW_EVENT_CONSUMED; - -} - -USHORT mmi_Btips_is_audio_on_phone (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, - struct MfwMnuItemTag *mi) -{ - if (mfw_btips_vgIsAudioOnPhone ( ) == TRUE) - { - return TRUE; - } - else - { - return FALSE; - } -} - -USHORT mmi_Btips_is_audio_on_handsfree (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, - struct MfwMnuItemTag *mi) -{ - if (mfw_btips_vgIsAudioOnHF ( ) == TRUE) - { - return TRUE; - } - else - { - return FALSE; - } - -} - -USHORT mmi_Btips_is_audio_handover_possible (struct MfwMnuTag *m, struct MfwMnuAttrTag *ma, - struct MfwMnuItemTag *mi) -{ - if (mfw_btips_vgIsHandOverPossible ( ) == TRUE) - { - return FALSE; - } - else - { - return TRUE; - } - -} -#endif