--- a/creator/data/creator.rss Fri Mar 19 09:29:26 2010 +0200
+++ b/creator/data/creator.rss Fri Apr 16 14:59:17 2010 +0300
@@ -139,14 +139,14 @@
cascade = r_creator_miscentries_submenu;
txt = "Misc";
},
-
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
MENU_ITEM
{
command = ECmdCreatePhoneBookEntries;
cascade = r_creator_phonebookentries_submenu;
txt = "Phonebook";
},
-
+#endif
MENU_ITEM
{
command = ECmdDeleteEntries;
@@ -525,6 +525,7 @@
txt = "App menu folders";
},
*/
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
#ifdef __PRESENCE
MENU_ITEM
{
@@ -537,9 +538,9 @@
{
command = ECmdCreateMiscEntryNotes;
txt = "Notes";
- }
+ },
-
+#endif
/*
,
MENU_ITEM
@@ -548,7 +549,7 @@
txt = "Sync settings";
}
*/
- ,
+
MENU_ITEM
{
command = ECmdCreateMiscEntryLandmarks;
@@ -638,12 +639,14 @@
cascade = r_creator_deletelogs_submenu;
txt = "Logs";
},
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
MENU_ITEM
{
command = ECmdDeleteMessages;
cascade = r_creator_deletemessages_submenu;
txt = "Messages";
},
+#endif
MENU_ITEM
{
command = ECmdDeleteIAPs; // ECmdDeleteMiscEntryAccessPoints
@@ -654,6 +657,7 @@
txt = "Connection methods";
#endif
},
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
MENU_ITEM
{
command = ECmdDeleteIMPSs;
@@ -666,25 +670,29 @@
cascade = r_creator_deletenotes_submenu;
txt = "Notes";
},
+#endif
MENU_ITEM
{
command = ECmdDeleteLandmarks;
cascade = r_creator_deletelandmarks_submenu;
txt = "Landmarks";
- },
+ }
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
+ ,
+
MENU_ITEM
{
command = ECmdDeleteContacts;
cascade = r_creator_deletecontacts_submenu;
txt = "Contacts";
- },
+ },
MENU_ITEM
{
command = ECmdDeleteContactGroups;
cascade = r_creator_deletecontactgroups_submenu;
txt = "Contact groups";
}
-
+#endif
/*
MENU_ITEM
{
--- a/creator/group/bld.inf Fri Mar 19 09:29:26 2010 +0200
+++ b/creator/group/bld.inf Fri Apr 16 14:59:17 2010 +0300
@@ -16,6 +16,7 @@
*/
#include <platform_paths.hrh>
+#include "../symbian_version.hrh"
PRJ_EXPORTS
../group/backup_registration.xml Z:/private/20011383/backup_registration.xml
--- a/creator/group/creator.mmp Fri Mar 19 09:29:26 2010 +0200
+++ b/creator/group/creator.mmp Fri Apr 16 14:59:17 2010 +0300
@@ -15,9 +15,9 @@
*
*/
-
#include <data_caging_paths.hrh>
#include <platform_paths.hrh>
+#include "../symbian_version.hrh"
TARGET creator.exe
@@ -65,32 +65,30 @@
SOURCE creator_calendarelement.cpp
SOURCE creator_message.cpp
SOURCE creator_messageelement.cpp
-SOURCE creator_note.cpp
-SOURCE creator_noteelement.cpp
SOURCE creator_log.cpp
SOURCE creator_logelement.cpp
SOURCE creator_file.cpp
SOURCE creator_fileelement.cpp
SOURCE creator_browser.cpp
SOURCE creator_browserelement.cpp
-SOURCE creator_imps.cpp
-SOURCE creator_impselement.cpp
SOURCE creator_mailbox.cpp
SOURCE creator_mailboxelement.cpp
SOURCE creator_landmark.cpp
SOURCE creator_landmarkelement.cpp
-SOURCE creator_phonebookbase.cpp
SOURCE creator_contactelement.cpp
-SOURCE creator_contactsetcache.cpp
SOURCE creator_connectionmethodelement.cpp
SOURCE creator_randomdataparser.cpp
+SOURCE creator_contactsetcache.cpp
-#if defined (__SERIES60_30__) || defined(__SERIES60_31__)
+#if SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4
+ SOURCE creator_connectionmethod.cpp
+ SOURCE creator_accesspoint.cpp
+#elif defined (__SERIES60_30__) || defined(__SERIES60_31__)
SOURCE creator_phonebook.cpp
SOURCE creator_accesspoint.cpp
#else
- SOURCE creator_virtualphonebook.cpp
SOURCE creator_connectionmethod.cpp
+ SOURCE creator_accesspoint.cpp
#endif
@@ -109,12 +107,16 @@
LIBRARY efsrv.lib
LIBRARY gsmu.lib
LIBRARY imcm.lib
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
LIBRARY npdlib.lib
+#endif
LIBRARY bafl.lib
LIBRARY eikcoctl.lib
LIBRARY eikctl.lib
LIBRARY commdb.lib
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
LIBRARY muiu.lib
+#endif
LIBRARY etext.lib
LIBRARY commonengine.lib
LIBRARY commonui.lib
@@ -143,16 +145,23 @@
LIBRARY fbscli.lib
LIBRARY bitmaptransforms.lib
-#if defined (__SERIES60_30__) || defined(__SERIES60_31__)
+#if SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4
+ LIBRARY apengine.lib
+ LIBRARY cmmanager.lib
+ LIBRARY cmmanagerdatabase.lib
+#elif defined (__SERIES60_30__) || defined(__SERIES60_31__)
LIBRARY apengine.lib
LIBRARY pbkeng.lib
#else
+ LIBRARY apengine.lib
LIBRARY cmmanager.lib
LIBRARY cmmanagerdatabase.lib
LIBRARY vpbkeng.lib
LIBRARY pbk2presentation.lib
#endif
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
#ifdef __PRESENCE
- LIBRARY wvsapsettingsstore.lib
-#endif
+ LIBRARY wvsapsettingsstore.lib
+#endif
+#endif
--- a/creator/inc/creator_calendar.h Fri Mar 19 09:29:26 2010 +0200
+++ b/creator/inc/creator_calendar.h Fri Apr 16 14:59:17 2010 +0300
@@ -37,7 +37,7 @@
#include <calcategory.h>
#include <caluser.h>
#include <calrrule.h>
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
#include <MVPbkSingleContactOperationObserver.h>
#include <MVPbkContactStoreListObserver.h>
#include <MVPbkContactFindObserver.h>
@@ -48,7 +48,7 @@
class CCalenderInterimParameters;
class CAsyncWaiter;
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
class CCreatorInterimCalendar : public CCreatorCalendarBase, public MCalProgressCallBack,
public MVPbkSingleContactOperationObserver, public MVPbkContactStoreListObserver, public MVPbkContactFindObserver
#else
@@ -85,7 +85,7 @@
void DeleteAllCreatedByCreatorL();
public:
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
// From MVPbkSingleContactOperationObserver:
virtual void VPbkSingleContactOperationComplete(
MVPbkContactOperationBase& aOperation,
@@ -123,7 +123,7 @@
HBufC* iTmpEmail;
RArray<TUint32> iEntryIds; // TCalLocalUid ( == TUint32 ) CCalEntry::LocalUidL
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
CVPbkContactManager* iContactManager;
MVPbkContactLinkArray* iExistingContacts;
MVPbkStoreContact* iTempContact;
--- a/creator/inc/creator_contactsetcache.h Fri Mar 19 09:29:26 2010 +0200
+++ b/creator/inc/creator_contactsetcache.h Fri Apr 16 14:59:17 2010 +0300
@@ -21,7 +21,7 @@
#define CREATORCONTACTSETCACHE_H_
#include <e32base.h>
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
#include <MVPbkContactLink.h>
#endif
@@ -33,7 +33,7 @@
public:
static CCreatorContactSet* NewL(TInt aLinkId, TInt aNumOfExistingContacts);
virtual ~CCreatorContactSet();
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
void AppendL(MVPbkContactLink*);
TInt NumberOfExistingContacts() const;
RPointerArray<MVPbkContactLink>& ContactLinks();
@@ -46,7 +46,7 @@
//void ConstructL();
TInt iLinkId;
TInt iNumOfExistingContacts;
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
RPointerArray<MVPbkContactLink> iContactLinks;
#endif
};
@@ -55,7 +55,7 @@
{
public:
virtual void AppendL(CCreatorContactSet* aContactSet) = 0;
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
virtual RPointerArray<MVPbkContactLink>& ContactLinks(TInt aLinkId) = 0;
virtual const RPointerArray<MVPbkContactLink>& ContactLinks(TInt aLinkId) const = 0;
#endif
--- a/creator/inc/creator_message.h Fri Mar 19 09:29:26 2010 +0200
+++ b/creator/inc/creator_message.h Fri Apr 16 14:59:17 2010 +0300
@@ -47,7 +47,7 @@
#include <btcmtm.h>
#include <mmsvattachmentmanager.h>
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
#include <MVPbkSingleContactOperationObserver.h>
#include <MVPbkContactStoreListObserver.h>
#include <MVPbkContactFindObserver.h>
@@ -94,7 +94,7 @@
HBufC* iEmailAddress;
};
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
class CCreatorMessages : public CBase, public MCreatorModuleBase, public MMsvSessionObserver,
public MVPbkSingleContactOperationObserver, public MVPbkContactStoreListObserver, public MVPbkContactFindObserver
#else
@@ -147,7 +147,7 @@
void DeleteAllL();
void DeleteAllCreatedByCreatorL();
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
// From MVPbkSingleContactOperationObserver:
virtual void VPbkSingleContactOperationComplete(
MVPbkContactOperationBase& aOperation,
@@ -183,7 +183,7 @@
HBufC* iTmpEmail;
RArray<TInt> iEntryIds; // TMsvId ( == TInt32 ) TMsvEntry::Id()
CMsvSession* iSession;
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
MVPbkContactLinkArray* iExistingContacts;
CVPbkContactManager* iContactManager;
MVPbkContactStore* iStore;
--- a/creator/inc/creator_model.h Fri Mar 19 09:29:26 2010 +0200
+++ b/creator/inc/creator_model.h Fri Apr 16 14:59:17 2010 +0300
@@ -32,11 +32,15 @@
#include "creator_browser.h"
#include "creator_calendar.h"
#include "creator_phonebookbase.h"
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
#include "creator_note.h"
+#endif
#include "creator_log.h"
#include "creator_connectionmethodbase.h"
#include "creator_mailbox.h"
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
#include "creator_imps.h"
+#endif
#include "creator_message.h"
#include "creator_landmark.h"
#include "creator_randomdataparser.h"
@@ -56,7 +60,9 @@
class TCommand;
class CCreatorBrowser;
class CCreatorCalendarBase;
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
class CCreatorNotepad;
+#endif
class CCreatorLogs;
class CCreatorAccessPoints;
class CCreatorMailboxes;
@@ -285,7 +291,9 @@
CCreatorBrowser* iBrowser;
CCreatorCalendarBase* iCalendar;
CCreatorPhonebookBase* iPhonebook;
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
CCreatorNotepad* iNotepad;
+#endif
CCreatorLogs* iLogs;
CCreatorConnectionSettingsBase* iAccessPoints;
CCreatorMailboxes* iMailboxes;
--- a/creator/src/creator_calendar.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/creator/src/creator_calendar.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -19,7 +19,7 @@
#include "creator_calendar.h"
#include "creator_traces.h"
#include "creator_scriptentry.h"
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
#include "creator_contactsetcache.h"
#include "creator_virtualphonebook.h"
#endif
@@ -28,7 +28,7 @@
#include <calrrule.h>
#include <calalarm.h>
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
#include <MVPbkFieldType.h>
#include <MVPbkContactOperationBase.h>
#include <MVPbkStoreContactFieldCollection.h>
@@ -343,7 +343,7 @@
delete iWaiter;
delete iTmpCN;
delete iTmpEmail;
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
delete iExistingContacts;
delete iTempContact;
delete iContactManager;
@@ -797,7 +797,7 @@
}
// Linked attendees:
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC();
uriArray->AppendL( TVPbkContactStoreUriPtr(VPbkContactStoreUris::DefaultCntDbUri()));
@@ -1444,7 +1444,7 @@
}
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
void CCreatorInterimCalendar::VPbkSingleContactOperationComplete(
MVPbkContactOperationBase& /*aOperation*/,
MVPbkStoreContact* aContact )
--- a/creator/src/creator_contactelement.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/creator/src/creator_contactelement.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -18,14 +18,14 @@
#include "creator_contactelement.h"
#include "creator_traces.h"
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
#include "creator_virtualphonebook.h"
#endif
#include "creator_factory.h"
#include "creator_contactsetcache.h"
#include <xml/documentparameters.h>
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
#include "VPbkEng.rsg"
#endif
@@ -49,7 +49,7 @@
TInt iFieldCode;
TContactFieldDataType iDataType;
};
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
FieldMapping fieldMappingTbl[] = {
{TPtrC(KFirstname), R_VPBK_FIELD_TYPE_FIRSTNAME, EDataTypeText},
{TPtrC(KLastname), R_VPBK_FIELD_TYPE_LASTNAME, EDataTypeText},
@@ -170,7 +170,7 @@
iIsCommandElement = ETrue;
}
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
void CCreatorContactElement::ExecuteCommandL()
{
LOGSTRING("Creator: CCreatorContactElement::ExecuteCommandL");
@@ -405,7 +405,7 @@
iIsCommandElement = ETrue;
}
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ )
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
void CCreatorContactGroupElement::ExecuteCommandL()
{
LOGSTRING("Creator: CCreatorContactGroupElement::ExecuteCommandL");
--- a/creator/src/creator_contactsetcache.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/creator/src/creator_contactsetcache.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -31,7 +31,7 @@
return iLinkId;
}
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
void CCreatorContactSet::AppendL(MVPbkContactLink* aContactLink)
{
iContactLinks.AppendL(aContactLink);
@@ -78,7 +78,7 @@
static CContactLinkCacheImp* NewL();
virtual ~CContactLinkCacheImp();
virtual void AppendL(CCreatorContactSet* aContactSet);
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
virtual RPointerArray<MVPbkContactLink>& ContactLinks(TInt aLinkId);
virtual const RPointerArray<MVPbkContactLink>& ContactLinks(TInt aLinkId) const;
#endif
@@ -90,7 +90,7 @@
private:
void ConstructL();
CContactLinkCacheImp();
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
RPointerArray<MVPbkContactLink> iEmptyLinks;
#endif
RPointerArray<CCreatorContactSet> iContactSets;
@@ -118,7 +118,7 @@
CContactLinkCacheImp::~CContactLinkCacheImp()
{
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
iEmptyLinks.ResetAndDestroy(); // just in case...
iEmptyLinks.Close();
#endif
@@ -131,7 +131,7 @@
iContactSets.AppendL(aContactSet);
}
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
RPointerArray<MVPbkContactLink>& CContactLinkCacheImp::ContactLinks(TInt aLinkId)
{
--- a/creator/src/creator_factory.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/creator/src/creator_factory.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -18,7 +18,9 @@
#include "creator_factory.h"
-#if( defined __SERIES60_30__ || defined __SERIES60_31__ )
+#if SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4
+ #include "creator_accessPoint.h"
+#elif( defined __SERIES60_30__ || defined __SERIES60_31__ )
#include "creator_phonebook.h"
#include "creator_accessPoint.h"
#else
@@ -28,17 +30,21 @@
CCreatorPhonebookBase* TCreatorFactory::CreatePhoneBookL(CCreatorEngine* aEngine)
{
-#if( defined __SERIES60_30__ || defined __SERIES60_31__ )
- return CCreatorPhonebook::NewL(aEngine);
+#if SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4
+ ; //TODO return an object
+#elif( defined __SERIES60_30__ || defined __SERIES60_31__ )
+ return CCreatorPhonebook::NewL(aEngine);
#else
- return CCreatorVirtualPhonebook::NewL(aEngine);
+ return CCreatorVirtualPhonebook::NewL(aEngine);
#endif
}
CCreatorModuleBaseParameters* TCreatorFactory::CreatePhoneBookParametersL()
{
-#if( defined __SERIES60_30__ || defined __SERIES60_31__ )
+#if SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4
+ ; //TODO return an object
+#elif( defined __SERIES60_30__ || defined __SERIES60_31__ )
return new(ELeave) CPhonebookParameters;
#else
return new(ELeave) CVirtualPhonebookParameters;
@@ -47,7 +53,7 @@
CCreatorConnectionSettingsBase* TCreatorFactory::CreateConnectionSettingsL(CCreatorEngine* aEngine)
{
-#if( defined __SERIES60_30__ || defined __SERIES60_31__ )
+#if( defined __SERIES60_30__ || defined __SERIES60_31__ || SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4 )
return CCreatorAccessPoints::NewL(aEngine);
#else
return CCreatorConnectionSettings::NewL(aEngine);
@@ -57,7 +63,7 @@
CCreatorModuleBaseParameters* TCreatorFactory::CreateConnectionSettingsParametersL()
{
-#if( defined __SERIES60_30__ || defined __SERIES60_31__ )
+#if( defined __SERIES60_30__ || defined __SERIES60_31__ || SYMBIAN_VERSION_SUPPORT >= SYMBIAN_4 )
return new(ELeave) CAccessPointsParameters;
#else
return new(ELeave) CConnectionSettingsParameters;
--- a/creator/src/creator_imps.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/creator/src/creator_imps.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
#ifdef __PRESENCE
#include "creator_imps.h"
@@ -257,4 +257,4 @@
}
#endif //__PRESENCE
-
+#endif
--- a/creator/src/creator_impselement.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/creator/src/creator_impselement.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
#ifdef __PRESENCE
#include "creator_impselement.h"
@@ -144,3 +144,4 @@
}
#endif // __PRESENCE
+#endif
--- a/creator/src/creator_message.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/creator/src/creator_message.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -21,9 +21,10 @@
#include "creator_traces.h"
#include "creator_contactsetcache.h"
#include <apgcli.h>
-#include <MuiuMsvUiServiceUtilities.h>
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+//#include <MuiuServiceUtilities.h>
+
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
#include <MVPbkFieldType.h>
#include <MVPbkContactOperationBase.h>
#include <MVPbkStoreContactFieldCollection.h>
@@ -132,7 +133,7 @@
delete iTmpPhoneNumber;
delete iTmpEmail;
delete iAttachments;
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
delete iExistingContacts;
if( iContactManager )
iContactManager->ContactStoresL().CloseAll(*this);
@@ -475,7 +476,7 @@
}
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
// Get number of existing senders and recipients:
for( TInt i = 0; i < parameters->iRecipientLinkIds.Count(); ++i )
@@ -1822,7 +1823,7 @@
TBool aUseEmailAddress,
TInt aNumOfExistingAddresses )
{
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
if( aNumOfExistingAddresses > 0 || aLinkIds.Count() > 0 )
{
@@ -1949,7 +1950,7 @@
}
//----------------------------------------------------------------------------
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
void CCreatorMessages::VPbkSingleContactOperationComplete(
MVPbkContactOperationBase& /*aOperation*/,
MVPbkStoreContact* aContact )
--- a/creator/src/creator_model.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/creator/src/creator_model.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -26,7 +26,7 @@
#include "creator_appui.h"
#include "creator_app.h" // KUidCreatorApp
#include "creator_file.h"
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
#include "creator_contactsetcache.h"
#endif
@@ -199,9 +199,9 @@
case ECmdCreatePhoneBookEntryContacts: { iPhonebook->CreateContactEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
case ECmdCreatePhoneBookEntryGroups: { iPhonebook->CreateGroupEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
case ECmdCreatePhoneBookEntrySubscribedContacts: { iPhonebook->CreateSubscribedContactEntryL(iCommandArray->At(iCurrentEntry).iParameters); } break;
-
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
case ECmdCreateMiscEntryNotes: { iNotepad->CreateNoteEntryL(reinterpret_cast<CNotepadParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
-
+#endif
case ECmdCreateLogEntryMissedCalls: { iLogs->CreateMissedCallEntryL(reinterpret_cast<CLogsParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
case ECmdCreateLogEntryReceivedCalls: { iLogs->CreateReceivedCallEntryL(reinterpret_cast<CLogsParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
case ECmdCreateLogEntryDialledNumbers: { iLogs->CreateDialledNumberEntryL(reinterpret_cast<CLogsParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
@@ -213,11 +213,11 @@
case ECmdCreateMiscEntryLandmarks: { iLandmarks->CreateLandmarkEntryL(reinterpret_cast<CLandmarkParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
case ECmdCreateMessagingEntryMailboxes: { iMailboxes->CreateMailboxEntryL(reinterpret_cast<CMailboxesParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
-
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
#ifdef __PRESENCE
case ECmdCreateMiscEntryIMPSServers: { iIMPS->CreateIMPSServerEntryL(reinterpret_cast<CIMPSParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
#endif
-
+#endif
case ECmdCreateMessagingEntryMessages: { iMessages->CreateMessageEntryL(reinterpret_cast<CMessagesParameters*>(iCommandArray->At(iCurrentEntry).iParameters), ETrue); } break;
case ECmdCreateMessagingEntryMessagesViaScript: { iMessages->CreateMessageEntryL(reinterpret_cast<CMessagesParameters*>(iCommandArray->At(iCurrentEntry).iParameters)); } break;
@@ -360,17 +360,27 @@
}
case ECmdDeleteNotes:
{
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
iNotepad->DeleteAllL();
+#endif
break;
}
case ECmdDeleteIMPSs:
{
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
+#ifdef __PRESENCE
iIMPS->DeleteAllL();
+#endif
+#endif
break;
}
case ECmdDeleteCreatorIMPSs:
{
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
+#ifdef __PRESENCE
iIMPS->DeleteAllCreatedByCreatorL();
+#endif
+#endif
break;
}
case ECmdDeleteBrowserBookmarks:
@@ -600,22 +610,24 @@
TInt err(KErrNone);
TRAP(err, iBrowser = CCreatorBrowser::NewL(this));
TRAP(err, iCalendar = CCreatorInterimCalendar::NewL(this));
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
TRAP(err, iPhonebook = (CCreatorPhonebookBase*)TCreatorFactory::CreatePhoneBookL(this));
TRAP(err, iNotepad = CCreatorNotepad::NewL(this));
+#endif
TRAP(err, iLogs = CCreatorLogs::NewL(this));
TRAP(err, iAccessPoints = (CCreatorConnectionSettingsBase*)TCreatorFactory::CreateConnectionSettingsL(this));
TRAP(err, iMailboxes = CCreatorMailboxes::NewL(this));
TRAP(err, iFiles = CCreatorFiles::NewL(this));
TRAP(err, iMessages = CCreatorMessages::NewL(this));
TRAP(err, iLandmarks = CCreatorLandmarks::NewL(this));
-
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
#ifdef __PRESENCE
TRAP(err, iIMPS = CCreatorIMPS::NewL(this));
#endif
-
+#endif
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
// Initialize contact-set cache:
ContactLinkCache::InitializeL();
#endif
@@ -649,10 +661,13 @@
iAccessPoints = NULL;
delete iLogs;
iLogs = NULL;
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
delete iNotepad;
iNotepad = NULL;
+
delete iPhonebook;
iPhonebook = NULL;
+#endif
delete iCalendar;
iCalendar = NULL;
delete iBrowser;
@@ -680,7 +695,7 @@
fileMan->RmDir( iTempPath->Des() );
CleanupStack::PopAndDestroy(); //fileMan
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && SYMBIAN_VERSION_SUPPORT < SYMBIAN_4)
// Cleanup the contact-set cache:
ContactLinkCache::DestroyL();
#endif
@@ -882,7 +897,9 @@
case ECmdCreateMiscEntryNotes:
case ECmdDeleteNotes:
{
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
iUsedOptionsMenuModule = iNotepad;
+#endif
}
break;
@@ -911,7 +928,7 @@
iUsedOptionsMenuModule = iMailboxes;
}
break;
-
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
#ifdef __PRESENCE
case ECmdCreateMiscEntryIMPSServers:
case ECmdDeleteIMPSs:
@@ -921,7 +938,7 @@
}
break;
#endif
-
+#endif
case ECmdCreateFileEntryEmptyFolder:
case ECmdCreateFileEntry3GPP_70kB:
case ECmdCreateFileEntryAAC_100kB:
@@ -999,18 +1016,21 @@
{
if ( YesNoQueryDialogL( _L("Delete all entries?") ) )
{
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
AppendToCommandArrayL( ECmdDeleteContacts, NULL, 1 );
AppendToCommandArrayL( ECmdDeleteContactGroups, NULL, 1 );
+ AppendToCommandArrayL( ECmdDeleteMessages, NULL, 1 );
+ AppendToCommandArrayL( ECmdDeleteIMPSs, NULL, 1 );
+ AppendToCommandArrayL( ECmdDeleteNotes, NULL, 1 );
+
+#endif
AppendToCommandArrayL( ECmdDeleteCalendarEntries, NULL, 1 );
AppendToCommandArrayL( ECmdDeleteBrowserBookmarks, NULL, 1 );
AppendToCommandArrayL( ECmdDeleteBrowserBookmarkFolders, NULL, 1 );
AppendToCommandArrayL( ECmdDeleteBrowserSavedPages, NULL, 1 );
AppendToCommandArrayL( ECmdDeleteBrowserSavedPageFolders, NULL, 1 );
AppendToCommandArrayL( ECmdDeleteLogs, NULL, 1 );
- AppendToCommandArrayL( ECmdDeleteMessages, NULL, 1 );
AppendToCommandArrayL( ECmdDeleteIAPs, NULL, 1 );
- AppendToCommandArrayL( ECmdDeleteIMPSs, NULL, 1 );
- AppendToCommandArrayL( ECmdDeleteNotes, NULL, 1 );
AppendToCommandArrayL( ECmdDeleteLandmarks, NULL, 1 );
AppendToCommandArrayL( ECmdDeleteCreatorFiles, NULL, 1 );
@@ -1027,8 +1047,12 @@
{
if ( YesNoQueryDialogL( _L("Delete all entries created with Creator?") ) )
{
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
AppendToCommandArrayL( ECmdDeleteCreatorContacts, NULL, 1 );
AppendToCommandArrayL( ECmdDeleteCreatorContactGroups, NULL, 1 );
+ AppendToCommandArrayL( ECmdDeleteCreatorMessages, NULL, 1 );
+ AppendToCommandArrayL( ECmdDeleteCreatorIMPSs, NULL, 1 );
+#endif
AppendToCommandArrayL( ECmdDeleteCreatorCalendarEntries, NULL, 1 );
AppendToCommandArrayL( ECmdDeleteCreatorBrowserBookmarks, NULL, 1 );
AppendToCommandArrayL( ECmdDeleteCreatorBrowserBookmarkFolders, NULL, 1 );
@@ -1036,9 +1060,7 @@
AppendToCommandArrayL( ECmdDeleteCreatorBrowserSavedPageFolders, NULL, 1 );
AppendToCommandArrayL( ECmdDeleteCreatorFiles, NULL, 1 );
AppendToCommandArrayL( ECmdDeleteCreatorLogs, NULL, 1 );
- AppendToCommandArrayL( ECmdDeleteCreatorMessages, NULL, 1 );
AppendToCommandArrayL( ECmdDeleteCreatorIAPs, NULL, 1 );
- AppendToCommandArrayL( ECmdDeleteCreatorIMPSs, NULL, 1 );
AppendToCommandArrayL( ECmdDeleteCreatorLandmarks, NULL, 1 );
// started exucuting delete commands
--- a/creator/src/creator_scriptelementfactory.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/creator/src/creator_scriptelementfactory.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -83,16 +83,20 @@
{
return CCreatorLogElement::NewL(aEngine, aElementName, aContext);
}
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
else if( aElementName == creatornote::KNote )
{
return CCreatorNoteElement::NewL(aEngine, aElementName, aContext);
}
- #ifdef __PRESENCE
+#endif
+#if SYMBIAN_VERSION_SUPPORT < SYMBIAN_4
+ #ifdef __PRESENCE
else if( aElementName == creatorimps::KImpsServer )
{
return CCreatorImpsServerElement::NewL(aEngine, aElementName, aContext);
}
#endif // __PRESENCE
+#endif
else if( aElementName == creatorlandmark::KLandmark )
{
return CCreatorLandmarkElement::NewL(aEngine, aElementName, aContext);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/symbian_version.hrh Fri Apr 16 14:59:17 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Symbian version configuration file
+*
+*/
+
+#ifndef __SYMBIAN_VERSION_HRH
+#define __SYMBIAN_VERSION_HRH
+
+// S60 and Symbian version number enumeration definitions
+
+#define S60_30 30
+#define S60_31 31
+#define S60_32 32
+#define S60_50 50
+#define S60_51 91
+#define S60_52 92
+#define SYMBIAN_1 50
+#define SYMBIAN_2 91
+#define SYMBIAN_3 92
+#define SYMBIAN_4 101
+
+
+/**
+ * Defines the S60 or Symbian version used by this component. This flag can be
+ * used to variate the source code based on the SDK in use. The value of the
+ * flag should be always changed to reflect the current build environment.
+ */
+#define SYMBIAN_VERSION_SUPPORT SYMBIAN_4
+
+
+#endif // __SYMBIAN_VERSION_HRH
--- a/group/bld.inf Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-
- bld.inf Top-level build information for rndtools
-
------------------------------------------------------------------------------
-*/
-
-
-// Comment out on wk43, because creator does not compile on TB10.1 yet #include "../creator/group/bld.inf"
-#include "../filebrowser/group/bld.inf"
-#include "../launcher/group/bld.inf"
-#include "../loadgen/group/bld.inf"
-#include "../perfmon/group/bld.inf"
-#include "../screengrabber/group/bld.inf"
-#include "../stifui/group/bld.inf"
-#include "../memspyui/group/bld.inf"
-#include "../htiui/group/bld.inf"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiAdminQt/HtiAdmin.pro Fri Apr 16 14:59:17 2010 +0300
@@ -0,0 +1,49 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE = app
+TARGET = HtiAdmin
+DEPENDPATH += .
+INCLUDEPATH += .
+INCLUDEPATH += . /epoc32/include/mw/hb/hbcore /epoc32/include/mw/hb/hbwidgets /epoc32/include/mw/hb/hbtools
+LIBS += -lhbcore -lhbwidgets -lhbtools
+
+HEADERS += mainview.h
+SOURCES += main.cpp mainview.cpp
+
+symbian: {
+
+ LIBS += -lestor -lws32 -lPlatformEnv -limageconversion -leikcore -lfbscli -lapgrfx -lcommonengine -lgdi -lhticfg -lbafl -lecom -lcommdb
+
+
+ HEADERS += htienginewrapper.h chtiadminengine.h
+ SOURCES += htienginewrapper.cpp chtiadminengine.cpp
+ RSS_RULES += "group_name = \"RnD Tools\"";
+ TARGET.CAPABILITY = ALL -TCB
+ TARGET.UID2 = 0x100039CE
+
+ TARGET.UID3 = 0x1020DEB5
+
+
+ # TARGET.SID = 0x1020DEB5
+ TARGET.VID = 0x101FB657
+
+ # TARGET.EPOCHEAPSIZE = 0x020000 0x800000 // Min 128Kb, Max 16Mb
+ # TARGET.EPOCSTACKSIZE = 0x5000
+}else {
+ error("Only Symbian supported!")
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiAdminQt/chtiadminengine.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -0,0 +1,905 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of HtiAdmin main.
+*
+*/
+
+#include <coecntrl.h>
+#include <w32std.h>
+#include <commdb.h>
+
+#include <HtiCfg.h>
+#include <HtiCommPluginInterface.h> // for KHTICommInterfaceUid
+
+
+#include "htienginewrapper.h"
+#include "chtiadminengine.h"
+
+
+#ifdef __ENABLE_LOGGING__
+
+#include <flogger.h>
+
+_LIT(KLogFolder, "hti");
+_LIT(KLogFile, "htiadmin.txt");
+#define HTI_LOG_TEXT(a1) {_LIT(temp, a1); RFileLogger::Write(KLogFolder, KLogFile, EFileLoggingModeAppend, temp);}
+#define HTI_LOG_FORMAT(a1,a2) {_LIT(temp, a1); RFileLogger::WriteFormat(KLogFolder, KLogFile, EFileLoggingModeAppend, temp, (a2));}
+#define HTI_LOG_DES(a1) {RFileLogger::Write(KLogFolder, KLogFile, EFileLoggingModeAppend, (a1));}
+
+#else // __ENABLE_LOGGING__
+
+#define HTI_LOG_TEXT(a1)
+#define HTI_LOG_FORMAT(a1,a2)
+#define HTI_LOG_DES(a1)
+
+#endif // __ENABLE_LOGGING__
+
+// CONSTANTS
+_LIT( KHtiWatchDogMatchPattern, "HtiWatchDog*" );
+_LIT( KHtiFrameworkExe, "HtiFramework.exe" );
+_LIT( KHtiMatchPattern, "HtiFramework*" );
+_LIT( KHtiFrameworkCaption, "HTI status: " );
+_LIT( KHtiAutoStartCaption, "AutoStart: " );
+_LIT( KHtiVersionCaption, "Version: " );
+_LIT( KHtiSelectedCommCaption, "Communication: " );
+_LIT( KHtiAdminStartParameter, "admin" );
+_LIT( KHtiAdminVersionFormat, "%u.%u.%u (%uwk%02u)" );
+_LIT( KHtiAdminAboutVersionFormat, "Version %u.%u.%u - " );
+const static TInt KTerminateReason = 1;
+
+const TInt32 KHTIImplUidIsaComm = {0x1020DEBD};
+const TInt32 KHTIImplUidSerial = {0x10210CCA};
+const TInt32 KHTIImplUidBluetooth = {0x200212CC};
+const TInt32 KHTIImplUidIPComm = {0x200212CE};
+const TInt32 KHTIImplUidUsbSerialComm = {0x200212D0};
+const TInt32 KHTIImplUidTraceComm = {0x200212D8};
+
+// configuration file constants
+_LIT( KCfgFilePath, "\\");
+_LIT( KHtiCfg, "hti.cfg" );
+_LIT( KHtiBtCommCfg, "HTIBtComm.cfg" );
+_LIT( KHtiSerialCommCfg , "HTISerialComm.cfg" );
+_LIT( KHtiIPCommCfg, "HTIIPComm.cfg" );
+// hti.cfg
+_LIT8( KCommPlugin, "CommPlugin" );
+_LIT8( KPriority, "Priority" );
+_LIT8( KShowConsole, "ShowConsole" );
+_LIT8( KEnableHtiWatchDog, "EnableHtiWatchDog" );
+_LIT8( KEnableHtiAutoStart, "EnableHtiAutoStart" );
+_LIT8( KShowErrorDialogs, "ShowErrorDialogs" );
+// HtiBtComm.cfg
+_LIT8( KBtDeviceAddress, "BtDeviceAddress" );
+_LIT8( KBtDeviceName, "BtDeviceName" );
+// HtiSerialComm.cfg
+_LIT8( KCommPortNumber, "CommPort" );
+// HTIIPComm.cfg
+_LIT8( KLocalPort, "LocalPort" );
+_LIT8( KRemoteHost, "RemoteHost" );
+_LIT8( KRemotePort, "RemotePort" );
+_LIT8( KIAPName, "IAPName");
+
+
+// ---------------------------------------------------------------------------
+
+CHtiAdminEngine::CHtiAdminEngine()
+{
+ iIAPsArray = NULL;
+}
+
+// ---------------------------------------------------------------------------
+CHtiAdminEngine* CHtiAdminEngine::NewLC(HtiEngineWrapper *aEngineWrapper)
+ {
+ CHtiAdminEngine* self = new (ELeave) CHtiAdminEngine();
+ CleanupStack::PushL(self);
+ self->ConstructL(aEngineWrapper);
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+CHtiAdminEngine* CHtiAdminEngine::NewL(HtiEngineWrapper *aEngineWrapper)
+ {
+ CHtiAdminEngine* self = CHtiAdminEngine::NewLC(aEngineWrapper);
+ CleanupStack::Pop(); // self;
+ return self;
+ }
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::ConstructL(HtiEngineWrapper *aEngineWrapper)
+ {
+ iEngineWrapper = aEngineWrapper;
+ iHtiCfg = CHtiCfg::NewL();
+
+ CheckStatusesL();
+ }
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::CheckStatusesL()
+ {
+ UpdateConsoleStatus();
+ UpdateWatchDogStatus();
+ UpdateAutoStartStatus();
+ UpdateSelectedComm();
+ UpdateStatusL();
+ }
+
+
+// ---------------------------------------------------------------------------
+CHtiAdminEngine::~CHtiAdminEngine()
+{
+ KillTimer();
+ delete iHtiCfg;
+ delete iPluginNameArray;
+ delete iPluginDataTypeArray;
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::StartHtiL()
+{
+
+ RProcess prs;
+ TInt err;
+ TBool isRunning = EFalse;
+ if ( OpenHtiProcess( prs ) )
+ {
+ if ( prs.ExitType() == EExitPending )
+ {
+ isRunning = ETrue;
+ iEngineWrapper->updateStatus(HtiEngineWrapper::Running);
+ }
+ prs.Close();
+ }
+
+ if ( !isRunning )
+ {
+ HTI_LOG_TEXT( "create process" );
+ err = prs.Create( KHtiFrameworkExe, KHtiAdminStartParameter );
+ if ( err == KErrNone )
+ {
+ prs.Resume();
+ prs.Close();
+ UpdateStatusL();
+ HTI_LOG_TEXT("create done");
+ }
+ else
+ {
+ iEngineWrapper->updateStatus(HtiEngineWrapper::Error);
+ HTI_LOG_TEXT("create error");
+ }
+ }
+
+}
+
+
+// ---------------------------------------------------------------------------
+
+void CHtiAdminEngine::StopHtiL()
+{
+ HTI_LOG_TEXT("Stop");
+
+ // kill the watchdog to prevent it from restarting HTI again
+ KillHtiWatchDogL();
+
+ RProcess prs;
+ if ( OpenHtiProcess( prs ) )
+ {
+ if ( prs.ExitType() == EExitPending )
+ {
+ HTI_LOG_TEXT("try to kill");
+ prs.Kill( KTerminateReason );
+ UpdateStatusL();
+ }
+ else
+ {
+ iEngineWrapper->updateStatus(HtiEngineWrapper::Stopped);
+ }
+ prs.Close();
+ }
+
+}
+
+// ---------------------------------------------------------------------------
+
+void CHtiAdminEngine::EnableBtByAddressL(const TDesC& aAddress)
+{
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+ iHtiCfg->SetParameterL( KCommPlugin, _L8( "BTSERIAL" ) );
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiCfg );
+
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiBtCommCfg ) );
+ iHtiCfg->RemoveParameterL( KBtDeviceName );
+ iHtiCfg->RemoveParameterL( KBtDeviceAddress );
+
+ TBuf8<KMaxParameterValueLength> value;
+ value.Copy(aAddress);
+ iHtiCfg->SetParameterL( KBtDeviceAddress, value);
+
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiBtCommCfg);
+ UpdateSelectedComm();
+
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::EnableBtByNameL(const TDesC& aAddress)
+{
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+ iHtiCfg->SetParameterL( KCommPlugin, _L8( "BTSERIAL" ) );
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiCfg );
+
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiBtCommCfg ) );
+ iHtiCfg->RemoveParameterL( KBtDeviceName );
+ iHtiCfg->RemoveParameterL( KBtDeviceAddress );
+
+ TBuf8<KMaxParameterValueLength> value;
+ value.Copy(aAddress);
+ iHtiCfg->SetParameterL( KBtDeviceName, value);
+
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiBtCommCfg );
+ UpdateSelectedComm();
+}
+
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::BtSearchL()
+{
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+ iHtiCfg->SetParameterL( KCommPlugin, _L8( "BTSERIAL" ) );
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiCfg );
+
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiBtCommCfg ) );
+ iHtiCfg->RemoveParameterL( KBtDeviceName );
+ iHtiCfg->RemoveParameterL( KBtDeviceAddress );
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiBtCommCfg );
+ UpdateSelectedComm();
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::IPListenL(const TDesC& aPort, const TDesC& aIAP)
+{
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+ iHtiCfg->SetParameterL( KCommPlugin, _L8("IPCOMM"));
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiCfg );
+
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiIPCommCfg ) );
+
+ TBuf8<KMaxParameterValueLength> port;
+ port.Copy(aPort);
+ iHtiCfg->SetParameterL( KLocalPort, port);
+
+ TBuf8<KMaxParameterValueLength> iap;
+ iap.Copy(aIAP);
+ iHtiCfg->SetParameterL(KIAPName, iap);
+
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiIPCommCfg );
+ UpdateSelectedComm();
+
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::IPConnectL(const TDesC& aHost, const TDesC& aPort, const TDesC& aIAP)
+{
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+ iHtiCfg->SetParameterL( KCommPlugin, _L8( "IPCOMM" ) );
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiCfg );
+
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiIPCommCfg ) );
+ iHtiCfg->RemoveParameterL( KLocalPort );
+
+ TBuf8<KMaxParameterValueLength> value;
+ value.Copy(aHost);
+ iHtiCfg->SetParameterL( KRemoteHost, value);
+
+ TBuf8<KMaxParameterValueLength> port;
+ port.Copy(aPort);
+ iHtiCfg->SetParameterL(KRemotePort, port);
+
+ TBuf8<KMaxParameterValueLength> iap;
+ iap.Copy(aIAP);
+ iHtiCfg->SetParameterL(KIAPName, iap);
+
+ iHtiCfg->SaveCfgL(KCfgFilePath, KHtiIPCommCfg);
+ UpdateSelectedComm();
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::EnableSerialL(const TDesC& aComPortNumber)
+{
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+ iHtiCfg->SetParameterL( KCommPlugin, _L8( "SERIAL" ) );
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiCfg );
+
+ TBuf8<KMaxParameterValueLength> value;
+ value.Copy(aComPortNumber);
+ iHtiCfg->SetParameterL( KCommPortNumber, value );
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiSerialCommCfg );
+ UpdateSelectedComm();
+}
+
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::EnableOtherCommL(const TDesC& aSelectedPluginName)
+{
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+
+ TInt namePosition;
+ iPluginNameArray->Find(aSelectedPluginName, namePosition);
+
+ //Save correct data type for selected plugin
+ iHtiCfg->SetParameterL( KCommPlugin, iPluginDataTypeArray->MdcaPoint(namePosition) );
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiCfg );
+ UpdateSelectedComm();
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::SetPriorityBackgroundL()
+{
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+ iHtiCfg->SetParameterL( KPriority, _L8("1"));
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiCfg );
+
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::SetPriorityForegroundL()
+{
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+ iHtiCfg->SetParameterL( KPriority, _L8("2"));
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiCfg );
+
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::SetPriorityHighL()
+{
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+ iHtiCfg->SetParameterL( KPriority, _L8("3"));
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiCfg );
+
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::SetPriorityAbsoluteHighL()
+{
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+ iHtiCfg->SetParameterL( KPriority, _L8("4"));
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiCfg );
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::AutoStartEnableL(TBool aEnableAutoStart)
+{
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+ if(aEnableAutoStart)
+ {
+ iHtiCfg->SetParameterL( KEnableHtiAutoStart, _L8("1"));
+ }
+ else
+ {
+ iHtiCfg->SetParameterL( KEnableHtiAutoStart, _L8("0"));
+ }
+
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiCfg );
+ UpdateAutoStartStatus();
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::WatchDogEnableL(TBool aEnableWDog)
+{
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+
+ if(aEnableWDog)
+ {
+ iHtiCfg->SetParameterL( KEnableHtiWatchDog, _L8("1"));
+ }
+ else
+ {
+ iHtiCfg->SetParameterL( KEnableHtiWatchDog, _L8("0"));
+ }
+
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiCfg );
+ UpdateWatchDogStatus();
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::ConsoleEnableL(TBool aEnableConsole)
+{
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+
+ if(aEnableConsole)
+ {
+ iHtiCfg->SetParameterL( KShowConsole, _L8("1"));
+ }
+ else
+ {
+ iHtiCfg->SetParameterL( KShowConsole, _L8("0"));
+ }
+
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiCfg );
+ UpdateConsoleStatus();
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::ErrorDialogsEnableL(TBool aEnableErrorDialogs)
+{
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+
+ if(aEnableErrorDialogs)
+ {
+ iHtiCfg->SetParameterL( KShowErrorDialogs, _L8("1"));
+ }
+ else
+ {
+ iHtiCfg->SetParameterL( KShowErrorDialogs, _L8("0"));
+ }
+
+ iHtiCfg->SaveCfgL( KCfgFilePath, KHtiCfg );
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::SetHtiCfgParamL(const TDesC& aParamName, const TDesC& aParamValue)
+{
+ SetCfgParamL(aParamName, aParamValue, KHtiCfg);
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::SetBtCfgParamL(const TDesC& aParamName, const TDesC& aParamValue)
+{
+ SetCfgParamL(aParamName, aParamValue, KHtiBtCommCfg);
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::SetSerialCfgParamL(const TDesC& aParamName, const TDesC& aParamValue)
+{
+ SetCfgParamL(aParamName, aParamValue, KHtiSerialCommCfg);
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::SetIPCfgParamL(const TDesC& aParamName, const TDesC& aParamValue)
+{
+ SetCfgParamL(aParamName, aParamValue, KHtiIPCommCfg);
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::SetCfgParamL(const TDesC& aParamName, const TDesC& aParamValue, const TDesC& aFileName)
+{
+ TBuf8<KMaxParameterNameLength> name;
+ name.Copy(aParamName);
+
+ TBuf8<KMaxParameterValueLength> value;
+ value.Copy(aParamValue);
+
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, aFileName ) );
+
+ iHtiCfg->SetParameterL( name, value );
+ iHtiCfg->SaveCfgL( KCfgFilePath, aFileName);
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::GetHtiCfgParamL(const TDesC& aParamName, TDes& aParamValue)
+ {
+ GetCfgParamL(aParamName, aParamValue, KHtiCfg);
+ }
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::GetBtCfgParamL(const TDesC& aParamName, TDes& aParamValue)
+ {
+ GetCfgParamL(aParamName, aParamValue, KHtiBtCommCfg);
+ }
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::GetSerialCfgParamL(const TDesC& aParamName, TDes& aParamValue)
+ {
+ GetCfgParamL(aParamName, aParamValue, KHtiSerialCommCfg);
+ }
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::GetIPCfgParamL(const TDesC& aParamName, TDes& aParamValue)
+ {
+ GetCfgParamL(aParamName, aParamValue, KHtiIPCommCfg);
+ }
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::GetCfgParamL(const TDesC& aParamName, TDes& aParamValue, const TDesC& aFileName)
+ {
+ TBuf8<KMaxParameterNameLength> name;
+ name.Copy(aParamName);
+
+ TBuf<KMaxParameterValueLength> value;
+
+ TRAP_IGNORE( iHtiCfg->LoadCfgL( KCfgFilePath, aFileName ) );
+ aParamValue.Copy(iHtiCfg->GetParameterL(name));
+ }
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::GetSelectedComm(TDes& aPluginName)
+ {
+ TBuf8<KMaxParameterValueLength> commValue;
+ TRAPD( err, iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+ if ( !err )
+ {
+ TRAP( err, commValue = iHtiCfg->GetParameterL( KCommPlugin ) );
+ }
+ // Use default if not found from config
+ if ( commValue.Length() == 0 )
+ {
+ commValue.Copy(KCommDefaultImplementation );
+ }
+ TInt typePosition;
+ iPluginDataTypeArray->Find(commValue, typePosition);
+ aPluginName.Copy(iPluginNameArray->MdcaPoint(typePosition));
+ }
+
+// ---------------------------------------------------------------------------
+TBool CHtiAdminEngine::OpenHtiProcess( RProcess& aPrs )
+{
+ HTI_LOG_TEXT( "OpenHtiProcess" );
+
+ TFullName processName;
+ TInt err;
+
+ TFindProcess finder( KHtiMatchPattern );
+ err = finder.Next( processName );
+ if ( err == KErrNone )
+ {
+ HTI_LOG_TEXT( "try to open..." );
+ err = aPrs.Open( finder );
+ HTI_LOG_TEXT( "opened" );
+
+ if ( err == KErrNone )
+ {
+ HTI_LOG_TEXT( "OpenHtiProcess OK" );
+ return ETrue;
+ }
+ else
+ {
+ iEngineWrapper->updateStatus(HtiEngineWrapper::Error);
+ }
+ }
+ else if ( err == KErrNotFound )
+ {
+ iEngineWrapper->updateStatus(HtiEngineWrapper::Stopped);
+ }
+ else
+ {
+ iEngineWrapper->updateStatus(HtiEngineWrapper::Error);
+ }
+
+ HTI_LOG_TEXT( "OpenHtiProcess NOK" );
+
+ return EFalse;
+}
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::UpdateStatusL()
+ {
+ HTI_LOG_TEXT( "UpdateStatusL" );
+ RProcess prs;
+ if ( OpenHtiProcess( prs ) )
+ {
+ HTI_LOG_TEXT( "Update display" );
+ TExitType exT = prs.ExitType();
+
+ switch ( exT )
+ {
+ case EExitPending:
+ {
+ iEngineWrapper->updateStatus(HtiEngineWrapper::Running);
+
+ // start timer to watch the status
+ if ( !iPeriodic )
+ {
+ iPeriodic = CPeriodic::NewL( CActive::EPriorityStandard );
+ iPeriodic->Start( 5 * 1000 * 1000,
+ 5 * 1000 * 1000,
+ TCallBack( TimerCallBackL, this ) );
+ }
+ }
+ break;
+
+ case EExitKill:
+ case EExitTerminate:
+ {
+ iEngineWrapper->updateStatus(HtiEngineWrapper::Stopped);
+ KillTimer();
+ }
+ break;
+
+ case EExitPanic:
+ {
+ iEngineWrapper->updateStatus(HtiEngineWrapper::Panic);
+ KillTimer();
+ }
+ break;
+ };
+ prs.Close();
+ }
+ else
+ {
+ KillTimer();
+ }
+ }
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::KillHtiWatchDogL()
+ {
+ TFullName processName;
+ TFindProcess finder( KHtiWatchDogMatchPattern );
+ TInt err = finder.Next( processName );
+ if ( err == KErrNone )
+ {
+ HTI_LOG_TEXT( "HTI watchdog process found. Trying to open and kill it..." );
+ RProcess prs;
+ User::LeaveIfError( prs.Open( finder ) );
+ prs.Kill( KTerminateReason );
+ prs.Close();
+ HTI_LOG_TEXT( "HTI watchdog killed" );
+ }
+ }
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::KillTimer()
+ {
+ if ( iPeriodic )
+ {
+ iPeriodic->Cancel();
+ delete iPeriodic;
+ iPeriodic = NULL;
+ }
+ }
+
+// ---------------------------------------------------------------------------
+TInt CHtiAdminEngine::TimerCallBackL( TAny* aPtr )
+ {
+ ( (CHtiAdminEngine*)aPtr )->UpdateStatusL();
+ return ETrue;
+ }
+
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::UpdateAutoStartStatus()
+ {
+ HTI_LOG_TEXT( "UpdateAutoStartStatus" );
+ TInt value = KErrNotFound;
+ TRAPD( err, iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+ if ( !err )
+ {
+ TRAP( err, value = iHtiCfg->GetParameterIntL(KEnableHtiAutoStart) );
+ }
+
+ if ( value == KErrNotFound )
+ {
+ // Use default values if not found from config.
+#ifdef __WINS__
+ value = 0;
+#else
+ value = 1;
+#endif
+ }
+
+ if ( value == 0 )
+ {
+ iEngineWrapper->updateAutostartStatus( HtiEngineWrapper::AutoStartDisabled );
+ }
+ else if ( value == 1 )
+ {
+ iEngineWrapper->updateAutostartStatus( HtiEngineWrapper::AutoStartEnabled );
+ }
+ else
+ {
+ iEngineWrapper->updateAutostartStatus( HtiEngineWrapper::AutoStartUnknown );
+ }
+ }
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::UpdateConsoleStatus()
+ {
+ HTI_LOG_TEXT( "UpdateConsoleStatus" );
+ TInt value = KErrNotFound;
+ TRAPD( err, iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+ if(!err)
+ {
+ TRAP( err, value = iHtiCfg->GetParameterIntL(KShowConsole) );
+ }
+
+ if ( value == KErrNotFound )
+ {
+ value = 0;
+ }
+
+ iEngineWrapper->updateConsoleStatus(value);
+ }
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::UpdateWatchDogStatus()
+ {
+ HTI_LOG_TEXT( "UpdateWatchDogStatus" );
+ TInt value = KErrNotFound;
+ TRAPD( err, iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+ if(!err)
+ {
+ TRAP( err, value = iHtiCfg->GetParameterIntL(KEnableHtiWatchDog) );
+ }
+
+ if ( value == KErrNotFound )
+ {
+ value = 0;
+ }
+
+ iEngineWrapper->updateWatchDogStatus(value);
+ }
+
+// ---------------------------------------------------------------------------
+void CHtiAdminEngine::UpdateSelectedComm()
+ {
+ HTI_LOG_TEXT( "UpdateSelectedComm" );
+ TBuf<64> commPlugin;
+ TRAPD( err, iHtiCfg->LoadCfgL( KCfgFilePath, KHtiCfg ) );
+ if ( !err )
+ {
+ TBuf8<KMaxParameterValueLength> commValue;
+ TRAP( err, commValue = iHtiCfg->GetParameterL( KCommPlugin ) );
+ if ( err == KErrNone )
+ {
+ commPlugin.Copy( commValue );
+ }
+ }
+ // Use default if not found from config
+ if ( commPlugin.Length() == 0 )
+ {
+ commPlugin.Copy(KCommDefaultImplementation );
+ }
+ iEngineWrapper->updateSelectedComm( commPlugin );
+
+ if ( commPlugin.Compare( _L( "SERIAL" ) ) == 0 )
+ {
+ TInt portNum = 0;
+ TRAP( err, iHtiCfg->LoadCfgL( KCfgFilePath, KHtiSerialCommCfg ) );
+ if ( err == KErrNone )
+ {
+ TRAP( err, portNum = iHtiCfg->GetParameterIntL( KCommPortNumber ) );
+ }
+ TBuf<16> portBuf;
+ portBuf.Copy( _L( "Port: " ) );
+ portBuf.AppendNum( portNum );
+ iEngineWrapper->updateCommDetails( portBuf );
+ }
+
+ else if ( commPlugin.Compare( _L( "BTSERIAL" ) ) == 0 )
+ {
+ TBuf<64> hostBuf;
+ TRAP( err, iHtiCfg->LoadCfgL( KCfgFilePath, KHtiBtCommCfg ) );
+ if ( err == KErrNone )
+ {
+ TBuf8<KMaxParameterValueLength> hostValue;
+ TRAP( err, hostValue = iHtiCfg->GetParameterL( KBtDeviceAddress ) );
+ if ( err != KErrNone )
+ {
+ TRAP( err, hostValue = iHtiCfg->GetParameterL( KBtDeviceName ) );
+ }
+ if ( err == KErrNone )
+ {
+ hostBuf.Copy( hostValue );
+ }
+ }
+ if ( hostBuf.Length() > 0 )
+ {
+ hostBuf.Insert( 0, _L( "Host: " ) );
+ }
+ iEngineWrapper->updateCommDetails(hostBuf);
+ }
+
+ else if ( commPlugin.Compare( _L( "IPCOMM" ) ) == 0 )
+ {
+ TBuf<128> hostBuf;
+ TRAP( err, iHtiCfg->LoadCfgL( KCfgFilePath, KHtiIPCommCfg ) );
+ if ( err == KErrNone )
+ {
+ TInt localPort = 0;
+ TRAP( err, localPort = iHtiCfg->GetParameterIntL( KLocalPort ) );
+ if ( err == KErrNone && localPort > 0 )
+ {
+ hostBuf.Copy( _L( "Listen: " ) );
+ hostBuf.AppendNum( localPort );
+ }
+ else
+ {
+ TBuf8<KMaxParameterValueLength> remoteHost;
+ TInt remotePort = 0;
+ TRAP( err, remoteHost = iHtiCfg->GetParameterL( KRemoteHost ) );
+ if ( err == KErrNone )
+ {
+ TRAP( err, remotePort = iHtiCfg->GetParameterIntL(
+ KRemotePort ) );
+ }
+ if ( err == KErrNone )
+ {
+ hostBuf.Copy( remoteHost );
+ hostBuf.Insert( 0, _L("Connect: " ) );
+ hostBuf.Append( ':' );
+ hostBuf.AppendNum( remotePort );
+ }
+ else
+ {
+ hostBuf.Copy( _L( "Invalid config!" ) );
+ }
+ }
+ }
+ iEngineWrapper->updateCommDetails(hostBuf);
+ }
+
+ else
+ {
+ iEngineWrapper->updateCommDetails(KNullDesC);
+ }
+ }
+
+// ---------------------------------------------------------------------------
+void CleanupRArray( TAny* object )
+ {
+ ( ( RImplInfoPtrArray* ) object )->ResetAndDestroy();
+ }
+
+// ---------------------------------------------------------------------------
+CDesCArray* CHtiAdminEngine::SearchCommPluginsL()
+ {
+ const TInt pluginNameArrayGranularity (15);
+ iPluginNameArray = new (ELeave) CDesCArrayFlat(pluginNameArrayGranularity);
+ iPluginDataTypeArray = new (ELeave) CDesC8ArrayFlat(pluginNameArrayGranularity);
+
+ RImplInfoPtrArray implInfoArray;
+ CleanupStack::PushL( TCleanupItem( CleanupRArray, &implInfoArray ) );
+
+ REComSession::ListImplementationsL( KHTICommInterfaceUid, implInfoArray );
+
+ for ( TInt i = 0; i < implInfoArray.Count(); ++i )
+ {
+ iPluginNameArray->AppendL(implInfoArray[i]->DisplayName());
+ iPluginDataTypeArray->AppendL(implInfoArray[i]->DataType());
+ }
+
+ CleanupStack::PopAndDestroy(); //implInfoArray
+
+ return iPluginNameArray;
+ }
+
+// ---------------------------------------------------------------------------
+CDesCArray* CHtiAdminEngine::SearchIAPsL()
+ {
+ if(iIAPsArray)
+ {
+ return iIAPsArray;
+ }
+
+ TBuf<KMaxParameterValueLength> name;
+ const TInt arrayGranularity (10);
+ iIAPsArray = new (ELeave) CDesCArrayFlat(arrayGranularity);
+
+ // Get IAP names from the database
+ CCommsDatabase* db = CCommsDatabase::NewL(EDatabaseTypeIAP);;
+ CleanupStack::PushL(db);
+ db->ShowHiddenRecords();
+ CCommsDbTableView* view = db->OpenTableLC(TPtrC(IAP));
+ TInt res = view->GotoFirstRecord();
+
+ while(res == KErrNone)
+ {
+ view->ReadTextL(TPtrC(COMMDB_NAME), name);
+ iIAPsArray->InsertL(0, name);
+ res = view->GotoNextRecord();
+ }
+
+ CleanupStack::PopAndDestroy(view); //view
+ CleanupStack::PopAndDestroy(db); //db
+
+ return iIAPsArray;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiAdminQt/chtiadminengine.h Fri Apr 16 14:59:17 2010 +0300
@@ -0,0 +1,182 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of HtiAdmin main.
+*
+*/
+
+#ifndef CHTIADMINENGINE_H
+#define CHTIADMINENGINE_H
+
+#include <e32std.h>
+#include <e32base.h>
+#include <BADESCA.H>
+
+
+class HtiEngineWrapper;
+class CPeriodic;
+class CHtiCfg;
+
+
+class CHtiAdminEngine : public CBase
+ {
+ public:
+
+ /**
+ * Constructor
+ */
+ CHtiAdminEngine();
+
+ /**
+ * Destructor
+ */
+ ~CHtiAdminEngine();
+
+ /**
+ * Two-phased constructor.
+ */
+ static CHtiAdminEngine* NewL(HtiEngineWrapper *aEngineWrapper);
+
+ /**
+ * Two-phased constructor.
+ */
+ static CHtiAdminEngine* NewLC(HtiEngineWrapper *aEngineWrapper);
+
+ void StartHtiL();
+
+ void StopHtiL();
+
+ void EnableBtByAddressL(const TDesC& aAddress);
+
+ void EnableBtByNameL(const TDesC& aAddress);
+
+ void BtSearchL();
+
+ void IPListenL(const TDesC& aPort, const TDesC& aIAP);
+
+ void IPConnectL(const TDesC& aHost, const TDesC& aPort, const TDesC& aIAP);
+
+ void EnableSerialL(const TDesC& aComPortNumber);
+
+ void EnableOtherCommL(const TDesC& aSelectedPluginName);
+
+ void SetPriorityBackgroundL();
+
+ void SetPriorityForegroundL();
+
+ void SetPriorityHighL();
+
+ void SetPriorityAbsoluteHighL();
+
+ void AutoStartEnableL(TBool aEnableAutoStart);
+
+ void ConsoleEnableL(TBool aEnableConsole);
+
+ void ErrorDialogsEnableL(TBool aEnableErrorDialogs);
+
+ void SetHtiCfgParamL(const TDesC& aParamName, const TDesC& aParamValue);
+ void GetHtiCfgParamL(const TDesC& aParamName, TDes& aParamValue);
+
+ void SetBtCfgParamL(const TDesC& aParamName, const TDesC& aParamValue);
+ void GetBtCfgParamL(const TDesC& aParamName, TDes& aParamValue);
+
+ void SetSerialCfgParamL(const TDesC& aParamName, const TDesC& aParamValue);
+ void GetSerialCfgParamL(const TDesC& aParamName, TDes& aParamValue);
+
+ void SetIPCfgParamL(const TDesC& aParamName, const TDesC& aParamValue);
+ void GetIPCfgParamL(const TDesC& aParamName, TDes& aParamValue);
+
+ void GetSelectedComm(TDes& aPluginName);
+
+ void CheckStatusesL();
+
+ CDesCArray* SearchCommPluginsL();
+
+ CDesCArray* SearchIAPsL();
+
+ void CHtiAdminEngine::WatchDogEnableL(TBool aEnableWDog);
+
+ /**
+ * Kills the HtiWatchDog process if it is running.
+ */
+ void KillHtiWatchDogL();
+
+ /**
+ * Stops the timer issuing the periodical HTI Framework process
+ * status checks.
+ */
+ void KillTimer();
+
+ /**
+ * The method called by the periodic timer.
+ * @param aPtr pointer to this CHtiAdminAppUi instance
+ * @return zero if the callback function should not be called again,
+ * otherwise non-zero. Current implementation returns always ETrue.
+ */
+ static TInt TimerCallBackL( TAny* aPtr );
+
+ /**
+ * Tries to find the HTIFramework.exe process and open a handle to it.
+ * @param aPrs on return contains an open handle to the HTIFramework.exe
+ * process if process found and opened successfully
+ * @return ETrue if process found and opened successfully,
+ * otherwise EFalse
+ */
+ TBool OpenHtiProcess( RProcess& aPrs );
+
+ /**
+ * Updates the HTI Framework process status in the display.
+ */
+ void UpdateStatusL();
+
+ /**
+ * Updates the HTI auto start status in the display.
+ */
+ void UpdateAutoStartStatus();
+
+
+ void UpdateConsoleStatus();
+
+ void UpdateWatchDogStatus();
+
+ /**
+ * Updates the selected communication in the display.
+ */
+ void UpdateSelectedComm();
+
+ private:
+ void ConstructL(HtiEngineWrapper *aEngineWrapper);
+
+ void SetCfgParamL(const TDesC& aParamName, const TDesC& aParamValue, const TDesC& aFileName);
+ void GetCfgParamL(const TDesC& aParamName, TDes& aParamValue, const TDesC& aFileName);
+
+ private:
+ // Enginewrapper that is used for communicating between QT and Symbian
+ HtiEngineWrapper* iEngineWrapper;
+
+ // Timer triggering periodic checking of HTIFramework process status
+ CPeriodic* iPeriodic;
+
+ // For reading and writing HTI configuration files
+ CHtiCfg* iHtiCfg;
+
+ CDesCArrayFlat* iPluginNameArray;
+
+ CDesC8ArrayFlat* iPluginDataTypeArray;
+
+ CDesCArrayFlat* iIAPsArray;
+
+
+ };
+
+#endif //CHTIADMINENGINE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiAdminQt/htienginewrapper.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -0,0 +1,563 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of HtiAdmin main.
+*
+*/
+
+
+#include "htienginewrapper.h"
+#include "chtiadminengine.h"
+
+#include <coecntrl.h>
+#include <QString>
+#include <QLocale.h>
+
+
+#include <HtiVersion.h>
+
+
+
+// ---------------------------------------------------------------------------
+
+HtiEngineWrapper::HtiEngineWrapper():
+ iEngine(0)
+{
+}
+// ---------------------------------------------------------------------------
+HtiEngineWrapper::~HtiEngineWrapper()
+{
+ delete iEngine;
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::init()
+{
+ TRAPD(error, iEngine = CHtiAdminEngine::NewL(this));
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::startHti()
+{
+ TRAPD(error, iEngine->StartHtiL());
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::stopHti()
+{
+ TRAPD(error, iEngine->StopHtiL());
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::enableBtByAddress(QString& address)
+{
+ // A conversion between a TBuf and QString is needed here.
+ TBuf<64> convertedAddress(address.utf16());
+
+
+ TRAPD(error, iEngine->EnableBtByAddressL(convertedAddress));
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::ipListen(QString& port, QString& iap)
+{
+ // A conversion between a TBuf and QString is needed here.
+ TBuf<64> convertedPort(port.utf16());
+ TBuf<64> convertedIAP(iap.utf16());
+
+ TRAPD(error, iEngine->IPListenL(convertedPort, convertedIAP));
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::ipConnect(QString& host, QString& port, QString& iap)
+{
+ // A conversion between a TBuf and QString is needed here.
+ TBuf<64> convertedHostAddress(host.utf16());
+ TBuf<64> convertedPort(port.utf16());
+ TBuf<64> convertedIAP(iap.utf16());
+
+ TRAPD(error, iEngine->IPConnectL(convertedHostAddress, convertedPort, convertedIAP));
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::enableBtByName(QString& address)
+ {
+ // A conversion between a TBuf and QString is needed here.
+ TBuf<64> convertedAddress(address.utf16());
+
+
+ TRAPD(error, iEngine->EnableBtByNameL(convertedAddress));
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+
+ }
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::btSearch()
+ {
+ TRAPD(error, iEngine->BtSearchL());
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+
+ }
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::enableSerial(QString& commPort)
+{
+ // A conversion between a TBuf and QString is needed here.
+ TBuf<64> convertedText(commPort.utf16());
+
+ TRAPD(error, iEngine->EnableSerialL(convertedText));
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::enableOtherComm(QString& pluginName)
+ {
+ // A conversion between a TBuf and QString is needed here.
+ TBuf<64> convertedText(pluginName.utf16());
+
+ TRAPD(error, iEngine->EnableOtherCommL(convertedText));
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+
+ }
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::setPriorityBackground()
+ {
+ TRAPD(error, iEngine->SetPriorityBackgroundL());
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+ }
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::setPriorityForeground()
+ {
+ TRAPD(error, iEngine->SetPriorityForegroundL());
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+ }
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::setPriorityHigh()
+ {
+ TRAPD(error, iEngine->SetPriorityHighL());
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+ }
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::setPriorityAbsoluteHigh()
+ {
+ TRAPD(error, iEngine->SetPriorityAbsoluteHighL());
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+ }
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::watchDogEnable(bool enable)
+ {
+ TRAPD(error, iEngine->WatchDogEnableL(enable));
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+ }
+
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::autoStartEnable(bool enable)
+ {
+ TRAPD(error, iEngine->AutoStartEnableL(enable));
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+ }
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::consoleEnable(bool enable)
+ {
+ TRAPD(error, iEngine->ConsoleEnableL(enable));
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+ }
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::errorDialogsEnable(bool enable)
+ {
+ TRAPD(error, iEngine->ErrorDialogsEnableL(enable));
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+ }
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::setHtiCfgParam(QString& paramName, QString& paramValue)
+{
+ // A conversion between a TBuf and QString is needed here.
+ TBuf<64> convertedName(paramName.utf16());
+ TBuf<64> convertedValue(paramValue.utf16());
+
+ TRAPD(error, iEngine->SetHtiCfgParamL(convertedName, convertedValue));
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::getHtiCfgParam(QString& paramName, QString& paramValue)
+{
+ // A conversion between a TBuf and QString is needed here.
+ TBuf<64> convertedName(paramName.utf16());
+ TBuf<64> value;
+
+ TRAPD(error, iEngine->GetHtiCfgParamL(convertedName, value));
+
+ paramValue = QString((QChar*)value.Ptr(),value.Length());
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::setBtCfgParam(QString& paramName, QString& paramValue)
+{
+ // A conversion between a TBuf and QString is needed here.
+ TBuf<64> convertedName(paramName.utf16());
+ TBuf<64> convertedValue(paramValue.utf16());
+
+ TRAPD(error, iEngine->SetBtCfgParamL(convertedName, convertedValue));
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::getBtCfgParam(QString& paramName, QString& paramValue)
+{
+ // A conversion between a TBuf and QString is needed here.
+ TBuf<64> convertedName(paramName.utf16());
+ TBuf<64> value;
+
+ TRAPD(error, iEngine->GetBtCfgParamL(convertedName, value));
+ paramValue = QString((QChar*)value.Ptr(),value.Length());
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::setSerialCfgParam(QString& paramName, QString& paramValue)
+{
+ // A conversion between a TBuf and QString is needed here.
+ TBuf<64> convertedName(paramName.utf16());
+ TBuf<64> convertedValue(paramValue.utf16());
+
+ TRAPD(error, iEngine->SetSerialCfgParamL(convertedName, convertedValue));
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::getSerialCfgParam(QString& paramName, QString& paramValue)
+{
+ // A conversion between a TBuf and QString is needed here.
+ TBuf<64> convertedName(paramName.utf16());
+ TBuf<64> value;
+
+ TRAPD(error, iEngine->GetSerialCfgParamL(convertedName, value));
+ paramValue = QString((QChar*)value.Ptr(),value.Length());
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::setIPCfgParam(QString& paramName, QString& paramValue)
+{
+ // A conversion between a TBuf and QString is needed here.
+ TBuf<64> convertedName(paramName.utf16());
+ TBuf<64> convertedValue(paramValue.utf16());
+
+ TRAPD(error, iEngine->SetIPCfgParamL(convertedName, convertedValue));
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::getIPCfgParam(QString& paramName, QString& paramValue)
+{
+ // A conversion between a TBuf and QString is needed here.
+ TBuf<64> convertedName(paramName.utf16());
+ TBuf<64> value;
+
+ TRAPD(error, iEngine->GetIPCfgParamL(convertedName, value));
+ paramValue = QString((QChar*)value.Ptr(),value.Length());
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+}
+
+// ---------------------------------------------------------------------------
+void HtiEngineWrapper::getVersionIfo(QString& version)
+{
+ version= QString("%1.%2.%3 (%4 wk%5)")
+ .arg(KHtiVersionMajor).arg(KHtiVersionMinor).arg(KHtiVersionBuild)
+ .arg(KHtiVersionYear).arg(KHtiVersionWeek);
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::updateStatuses()
+{
+ TRAPD(error, iEngine->CheckStatusesL());
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ return true;
+ }
+}
+
+// ---------------------------------------------------------------------------
+void HtiEngineWrapper::updateStatus(HtiStatus status)
+{
+ emit statusChanged(status);
+}
+
+// ---------------------------------------------------------------------------
+void HtiEngineWrapper::updateSelectedComm(const TDesC& aText)
+{
+ iSelectedCommText = QString((QChar*)aText.Ptr(),aText.Length());
+
+ emit commSet(iSelectedCommText);
+}
+
+// ---------------------------------------------------------------------------
+void HtiEngineWrapper::updateCommDetails(const TDesC& aText)
+{
+ iCommDetailsText = QString((QChar*)aText.Ptr(),aText.Length());
+
+ emit commDetails(iCommDetailsText);
+}
+
+// ---------------------------------------------------------------------------
+void HtiEngineWrapper::updateAutostartStatus(AutoStartStatus status)
+{
+ emit autostartSet(status);
+}
+
+void HtiEngineWrapper::updateConsoleStatus(bool bEnabled)
+{
+ emit consoleSet(bEnabled);
+}
+
+void HtiEngineWrapper::updateWatchDogStatus(bool bEnabled)
+{
+ emit watchDogSet(bEnabled);
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::listCommPlugins()
+{
+ CDesCArray* pluginsArray = NULL;
+
+ TRAPD(error, pluginsArray = iEngine->SearchCommPluginsL());
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ for(TInt i = 0; i < pluginsArray->Count(); ++i)
+ {
+ TPtrC16 plugin (pluginsArray->MdcaPoint(i));
+ int len = pluginsArray->MdcaPoint(i).Length();
+
+ QString name ((QChar*)plugin.Ptr(), len);
+ iPluginNames << name;
+ }
+
+ emit commPluginsRetrieved(iPluginNames);
+
+ return true;
+ }
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::listIAPs(QStringList& list)
+{
+ CDesCArray* arrayIAPs = NULL;
+
+ TRAPD(error, arrayIAPs = iEngine->SearchIAPsL());
+
+ if (error != KErrNone) {
+ return false;
+ }
+ else {
+ for(TInt i = 0; i < arrayIAPs->Count(); ++i)
+ {
+ TPtrC16 iap (arrayIAPs->MdcaPoint(i));
+ int len = arrayIAPs->MdcaPoint(i).Length();
+
+ QString name ((QChar*)iap.Ptr(), len);
+ list << name;
+ }
+
+ return true;
+ }
+ return true;
+}
+
+// ---------------------------------------------------------------------------
+bool HtiEngineWrapper::getSelectedComm(QString& commName)
+{
+ TBuf<64> pluginName;
+ iEngine->GetSelectedComm(pluginName);
+ commName = QString((QChar*)pluginName.Ptr(), pluginName.Length());
+ return true;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiAdminQt/htienginewrapper.h Fri Apr 16 14:59:17 2010 +0300
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of HtiAdmin main.
+*
+*/
+
+#ifndef HTIENGINEWRAPPER_H
+#define HTIENGINEWRAPPER_H
+
+#include <e32cmn.h>
+#include <qobject.h>
+#include <QStringList.h>
+
+class CHtiAdminEngine;
+class QString;
+
+
+
+
+/**
+ * class that is used for communicating between Symbian and Qt code.
+ */
+class HtiEngineWrapper : public QObject
+ {
+ Q_OBJECT
+public:
+ enum AutoStartStatus{
+ AutoStartDisabled,
+ AutoStartEnabled,
+ AutoStartUnknown
+ };
+
+ enum HtiStatus{
+ Running,
+ Stopped,
+ Panic,
+ Error
+ };
+
+ /**
+ * Constructor
+ */
+ HtiEngineWrapper();
+
+ /**
+ * Destructor
+ */
+ ~HtiEngineWrapper();
+
+
+ bool init();
+ bool stopHti();
+ bool startHti();
+ bool enableBtByAddress(QString& address);
+ bool enableBtByName(QString& address);
+ bool ipListen(QString& port, QString& iap);
+ bool ipConnect(QString& host, QString& port, QString& iap);
+ bool enableSerial(QString& commPort);
+ bool btSearch();
+ bool enableOtherComm(QString& pluginName);
+ bool setPriorityBackground();
+ bool setPriorityForeground();
+ bool setPriorityHigh();
+ bool setPriorityAbsoluteHigh();
+ bool watchDogEnable(bool enable);
+ bool autoStartEnable(bool enable);
+ bool consoleEnable(bool enable);
+ bool errorDialogsEnable(bool enable);
+ bool setHtiCfgParam(QString& paramName, QString& paramValue);
+ bool getHtiCfgParam(QString& paramName, QString& paramValue);
+ bool setBtCfgParam(QString& paramName, QString& paramValue);
+ bool getBtCfgParam(QString& paramName, QString& paramValue);
+ bool setSerialCfgParam(QString& paramName, QString& paramValue);
+ bool getSerialCfgParam(QString& paramName, QString& paramValue);
+ bool setIPCfgParam(QString& paramName, QString& paramValue);
+ bool getIPCfgParam(QString& paramName, QString& paramValue);
+ void getVersionIfo(QString& version);
+ bool updateStatuses();
+ bool listCommPlugins();
+ bool listIAPs(QStringList& list);
+ bool getSelectedComm(QString& commName);
+
+ //Called from engine side
+ void updateStatus(HtiStatus status);
+ void updateSelectedComm(const TDesC& aText);
+ void updateAutostartStatus(AutoStartStatus status);
+ void updateConsoleStatus(bool bEnabled);
+ void updateWatchDogStatus(bool bEnabled);
+ void updateCommDetails(const TDesC& aText);
+
+
+
+signals:
+ void statusChanged(HtiEngineWrapper::HtiStatus status);
+ void commSet(QString& statusText);
+ void commDetails(QString& statusText);
+ void commPluginsRetrieved(QStringList& pluginNames);
+ void autostartSet(HtiEngineWrapper::AutoStartStatus status);
+ void consoleSet(bool enabled);
+ void watchDogSet(bool enabled);
+
+private:
+ CHtiAdminEngine* iEngine;
+ QString iSelectedCommText;
+ QString iCommDetailsText;
+ QStringList iPluginNames;
+
+ };
+
+#endif //HTIENGINEWRAPPER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiAdminQt/main.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of HtiAdmin main.
+*
+*/
+
+#include <hbmainwindow.h>
+//#include <hbview.h>
+#include <coecntrl.h>
+#include <hbapplication.h>
+
+
+#include "mainview.h"
+#include "htienginewrapper.h"
+
+
+
+
+
+int main(int argc, char *argv[])
+{
+ // Initialization
+ HbApplication app(argc, argv);
+
+ // Create HtiEngineWrapper
+ HtiEngineWrapper engineWrapper;
+
+ if (!engineWrapper.init()) {
+ return EXIT_FAILURE;
+ }
+
+ // Main window widget.
+ // Includes decorators such as signal strength and battery life indicator.
+ HbMainWindow mainWindow;
+
+ //Create main view
+ MainView* view = new MainView(mainWindow, engineWrapper);
+
+ //initialize main view
+ view->init(app);
+
+ // Add View to main window and reveal it.
+ mainWindow.addView(view);
+
+ // Show widget
+ //mainWindow.show();
+ mainWindow.showFullScreen();
+
+ int result = app.exec();
+
+ return result;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiAdminQt/mainview.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -0,0 +1,554 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of HtiAdmin main.
+*
+*/
+
+
+#include <hbmainwindow.h>
+#include <hbapplication.h>
+#include <hbmenu.h>
+#include <hbaction.h>
+#include <hblabel.h>
+#include <HbInputDialog.h>
+#include <qgraphicslinearlayout.h>
+#include <HbListDialog.h>
+#include <hbmessagebox.h>
+
+
+
+#include "htienginewrapper.h"
+#include "mainview.h"
+#include "hbtoolbar.h"
+
+// ---------------------------------------------------------------------------
+
+MainView::MainView(HbMainWindow &mainWindow, HtiEngineWrapper& engineWrapper):
+ mMainWindow(mainWindow),
+ mEngineWrapper(engineWrapper)
+{
+}
+
+// ---------------------------------------------------------------------------
+
+MainView::~MainView()
+{
+
+}
+
+// ---------------------------------------------------------------------------
+
+void MainView::init(HbApplication &app)
+{
+ this->setTitle("Hti Admin");
+ createToolbar();
+ createMenu(app);
+ createTexts();
+
+ mEngineWrapper.updateStatuses();
+
+ QString version;
+ mEngineWrapper.getVersionIfo(version);
+ mEngineWrapper.listCommPlugins();
+
+ mHtiVersionTxt->setPlainText("Hti Version: " + version);
+}
+
+// ---------------------------------------------------------------------------
+void MainView::createMenu(HbApplication& app)
+{
+
+ HbMenu* menu = new HbMenu();
+
+ if (menu != NULL) {
+
+ mActionExit = menu->addAction("Exit");
+ connect(mActionExit, SIGNAL(triggered()), &app, SLOT( quit() ) );
+
+ connect(mActionStartHti, SIGNAL(triggered()), this, SLOT( startHti() ) );
+ connect(mActionStopHti, SIGNAL(triggered()), this, SLOT( stopHti() ) );
+
+ mActionSelectComm = menu->addAction("Select Communication");
+ connect(mActionSelectComm, SIGNAL(triggered()), this, SLOT( enableComm() ) );
+
+ mActionSetPriority = menu->addAction("Set Priority");
+ connect(mActionSetPriority, SIGNAL(triggered()), this, SLOT( setPriority() ) );
+
+ mActionEnableAuto = menu->addAction("Enable Auto Start");
+ connect(mActionEnableAuto, SIGNAL(triggered()), this, SLOT( enableAutoStart() ) );
+
+ mActionDisableAuto = menu->addAction("Disable Auto Start");
+ connect(mActionDisableAuto, SIGNAL(triggered()), this, SLOT( disableAutoStart() ) );
+
+ mActionEnableWdog = menu->addAction("Enable Watchdog");
+ connect(mActionEnableWdog, SIGNAL(triggered()), this, SLOT( enableWatchdog() ) );
+
+ mActionDisableWdog = menu->addAction("Disable Watchdog");
+ connect(mActionDisableWdog, SIGNAL(triggered()), this, SLOT( disableWatchdog() ) );
+
+ mActionEnableConsole = menu->addAction("Enable Console");
+ connect(mActionEnableConsole, SIGNAL(triggered()), this, SLOT( enableConsole() ) );
+
+ mActionDisableConsole = menu->addAction("Disable Console");
+ connect(mActionDisableConsole, SIGNAL(triggered()), this, SLOT( disableConsole() ) );
+
+ mActionSetParameter = menu->addAction("Set Parameter");
+ connect(mActionSetParameter, SIGNAL(triggered()), this, SLOT( showParamList() ) );
+
+ this->setMenu(menu);
+ }
+
+
+ connect(&mEngineWrapper, SIGNAL(statusChanged(HtiEngineWrapper::HtiStatus)), this, SLOT(htiStatusChanged(HtiEngineWrapper::HtiStatus)));
+ connect(&mEngineWrapper, SIGNAL(commSet(QString&)), this, SLOT(commStatusChanged(QString&)));
+ connect(&mEngineWrapper, SIGNAL(commDetails(QString&)), this, SLOT(commDetailsChanged(QString&)));
+ connect(&mEngineWrapper, SIGNAL(autostartSet(HtiEngineWrapper::AutoStartStatus)), this, SLOT(autostartStatusChanged(HtiEngineWrapper::AutoStartStatus)));
+ connect(&mEngineWrapper, SIGNAL(consoleSet(bool)), this, SLOT(consoleStatusChanged(bool)));
+ connect(&mEngineWrapper, SIGNAL(watchDogSet(bool)), this, SLOT(watchDogStatusChanged(bool)));
+ connect(&mEngineWrapper, SIGNAL(commPluginsRetrieved(QStringList&)), this, SLOT(updatePluginInfo(QStringList&)));
+
+
+}
+
+// ---------------------------------------------------------------------------
+void MainView::createTexts()
+{
+ QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical, this);
+
+ mCommDetailsTxt = new HbLabel(this);
+ mHtiStatusTxt = new HbLabel(this);
+ mHtiVersionTxt = new HbLabel(this);
+
+ mHtiAutoStartStatusTxt = new HbLabel(this);
+ mCommunicationTxt = new HbLabel(this);
+
+ mHtiStatusTxt->setPlainText("Hti Status:");
+ mHtiVersionTxt->setPlainText("Hti Version:");
+ mHtiAutoStartStatusTxt->setPlainText("Auto Start:");
+ mCommunicationTxt->setPlainText("Communication ");
+
+ layout->addItem(mHtiStatusTxt);
+ layout->addItem(mHtiVersionTxt);
+ layout->addItem(mHtiAutoStartStatusTxt);
+ layout->addItem(mCommunicationTxt);
+ layout->addItem(mCommDetailsTxt);
+
+ layout->setMaximumHeight(300);
+ this->setLayout(layout);
+}
+
+// ---------------------------------------------------------------------------
+void MainView::htiStatusChanged(HtiEngineWrapper::HtiStatus newStatus)
+{
+ switch(newStatus)
+ {
+ case HtiEngineWrapper::Running:
+ mHtiStatusTxt->setPlainText("Hti Status: Running" );
+ break;
+ case HtiEngineWrapper::Stopped:
+ mHtiStatusTxt->setPlainText("Hti Status: Stopped" );
+ break;
+ case HtiEngineWrapper::Panic:
+ mHtiStatusTxt->setPlainText("Hti Status: Panic" );
+ break;
+ default:
+ mHtiStatusTxt->setPlainText("Hti Status: Error" );
+ }
+
+ // Update menu items status
+ bool isRunning = (newStatus == HtiEngineWrapper::Running);
+ mActionStartHti->setEnabled(!isRunning);
+ mActionStopHti->setEnabled(isRunning);
+ mActionSelectComm->setEnabled(!isRunning);
+ mActionSetPriority->setEnabled(!isRunning);
+ mActionEnableAuto->setEnabled(!isRunning);
+ mActionDisableAuto->setEnabled(!isRunning);
+ mActionEnableWdog->setEnabled(!isRunning);
+ mActionDisableWdog->setEnabled(!isRunning);
+ mActionEnableConsole->setEnabled(!isRunning);
+ mActionDisableConsole->setEnabled(!isRunning);
+ mActionSetParameter->setEnabled(!isRunning);
+}
+
+// ---------------------------------------------------------------------------
+void MainView::commStatusChanged(QString& newStatus)
+{
+ if (mCommunicationTxt) {
+ mCommunicationTxt->setPlainText("Communication: " + newStatus);
+ }
+}
+
+// ---------------------------------------------------------------------------
+void MainView::commDetailsChanged(QString& newStatus)
+{
+ if (mCommDetailsTxt) {
+ mCommDetailsTxt->setPlainText(newStatus);
+ }
+}
+
+// ---------------------------------------------------------------------------
+void MainView::updatePluginInfo(QStringList& pluginList)
+{
+ mPluginList = pluginList;
+}
+
+// ---------------------------------------------------------------------------
+void MainView::autostartStatusChanged(HtiEngineWrapper::AutoStartStatus newStatus)
+{
+ switch(newStatus)
+ {
+ case HtiEngineWrapper::AutoStartDisabled:
+ mHtiAutoStartStatusTxt->setPlainText("Auto Start: Disabled" );
+ break;
+ case HtiEngineWrapper::AutoStartEnabled:
+ mHtiAutoStartStatusTxt->setPlainText("Auto Start: Enabled" );
+ break;
+ default:
+ mHtiAutoStartStatusTxt->setPlainText("Auto Start: Unknown" );
+ }
+
+ bool isAutoStartEnabled = (newStatus == HtiEngineWrapper::AutoStartEnabled);
+ mActionEnableAuto->setVisible(!isAutoStartEnabled);
+ mActionDisableAuto->setVisible(isAutoStartEnabled);
+}
+
+// ---------------------------------------------------------------------------
+void MainView::consoleStatusChanged(bool enabled)
+{
+ mActionEnableConsole->setVisible(!enabled);
+ mActionDisableConsole->setVisible(enabled);
+}
+
+// ---------------------------------------------------------------------------
+void MainView::watchDogStatusChanged(bool enabled)
+{
+ mActionEnableWdog->setVisible(!enabled);
+ mActionDisableWdog->setVisible(enabled);
+}
+
+
+// ---------------------------------------------------------------------------
+
+void MainView::createToolbar()
+{
+ mActionStartHti = toolBar()->addAction("Start Hti");
+ mActionStopHti = toolBar()->addAction("Stop Hti");
+}
+
+// ---------------------------------------------------------------------------
+
+void MainView::startHti()
+{
+ mEngineWrapper.startHti();
+}
+
+// ---------------------------------------------------------------------------
+
+void MainView::stopHti()
+{
+ mEngineWrapper.stopHti();
+}
+
+// ---------------------------------------------------------------------------
+void MainView::enableComm()
+{
+ //Get current selection
+ QString currentComm;
+ mEngineWrapper.getSelectedComm(currentComm);
+ int curSelection = mPluginList.indexOf(currentComm, 0);
+
+ QStringList selection;
+ bool ok = false;
+ selection = HbListDialog::getStringItems("Select Comm", mPluginList, curSelection, &ok, HbAbstractItemView::SingleSelection);
+
+ if(ok){
+ if(selection[0] == QString("Bt serial comm")){
+ enableBTComm();
+ }
+ else if(selection[0] == QString("IP comm")){
+ enableIPComm();
+ }
+ else if(selection[0] == QString("SERIAL comm")){
+ enableSerialComm();
+ }
+ else{
+ //All other comm plugins
+ mEngineWrapper.enableOtherComm(selection[0]);
+ }
+ }
+}
+
+// ---------------------------------------------------------------------------
+void MainView::enableSerialComm()
+{
+ bool ok = false;
+ QString str = HbInputDialog::getText(
+ "Set Comm Port number ",
+ "",
+ &ok);
+
+ if(ok){
+ mEngineWrapper.enableSerial(str);
+ }
+}
+
+
+// ---------------------------------------------------------------------------
+void MainView::enableIPComm()
+{
+ // Get IAPs list
+ QStringList iapsList;
+ mEngineWrapper.listIAPs(iapsList);
+ if(iapsList.count() == 0)
+ {
+ HbMessageBox msg("No IAPs for selection!", HbMessageBox::MessageTypeWarning);
+ msg.exec();
+ return;
+ }
+
+ // Get current selection
+ QString curIapName;
+ QString param = "IAPName";
+ mEngineWrapper.getIPCfgParam(param, curIapName);
+ int curSelction = iapsList.indexOf(curIapName, 0);
+
+ QString iap;
+ QStringList selection;
+ bool ok = false;
+ selection = HbListDialog::getStringItems("Select IAP:", iapsList, curSelction, &ok, HbAbstractItemView::SingleSelection);
+
+ if(ok)
+ {
+ iap = selection[0];
+ }
+ else
+ {
+ return;
+ }
+
+ QStringList srcList;
+ srcList <<"Listen" <<"Connect";
+
+ selection = HbListDialog::getStringItems("Select IP Comm", srcList, 0, &ok, HbAbstractItemView::SingleSelection);
+
+ if(ok){
+ if(selection[0] == srcList[0]){
+ QString port = HbInputDialog::getText(
+ "Local port",
+ "",
+ &ok);
+
+ if(ok){
+ mEngineWrapper.ipListen(port, iap);
+ }
+
+ }
+ else{
+ QString host = HbInputDialog::getText(
+ "Remote Host",
+ "",
+ &ok);
+
+ if(ok){
+ QString port = HbInputDialog::getText(
+ "Remote port",
+ "",
+ &ok);
+
+ if(ok){
+ mEngineWrapper.ipConnect(host, port, iap);
+ }
+ }
+ }
+
+ }
+}
+
+// ---------------------------------------------------------------------------
+void MainView::enableBTComm()
+{
+ QStringList srcList;
+ QStringList selection;
+
+ srcList <<"BT address" <<"BT name" <<"Search when starting" ;
+
+ bool ok = false;
+ selection = HbListDialog::getStringItems("", srcList, 0, &ok, HbAbstractItemView::SingleSelection);
+
+ if(ok){
+ if(selection[0] == srcList[0]){
+ QString address = HbInputDialog::getText(
+ "BT address",
+ "",
+ &ok);
+
+ if(ok){
+ mEngineWrapper.enableBtByAddress(address);
+ }
+ }
+ else if(selection[0] == srcList[1]){
+ QString name = HbInputDialog::getText(
+ "BT name",
+ "",
+ &ok);
+
+ if(ok){
+ mEngineWrapper.enableBtByName(name);
+ }
+ }
+ else if(selection[0] == srcList[2]){
+ mEngineWrapper.btSearch();
+ }
+ }
+}
+
+
+// ---------------------------------------------------------------------------
+void MainView::setPriority()
+{
+ // Get current priority
+ bool ok = false;
+ QString curPriority;
+ QString param = "Priority";
+ mEngineWrapper.getHtiCfgParam(param, curPriority);
+ int curSelection = curPriority.toInt(&ok);
+ if(ok){
+ curSelection--;
+ }
+ else{
+ curSelection = 2;
+ }
+
+ QStringList srcList;
+ QStringList selection;
+
+ srcList <<"Backgroung" <<"Foregound" <<"High" << "Absolute High";
+
+
+ selection = HbListDialog::getStringItems("Select Hti Priority", srcList, curSelection, &ok, HbAbstractItemView::SingleSelection);
+
+ if(ok){
+ if(selection[0] == srcList[0]){
+ mEngineWrapper.setPriorityBackground();
+ }
+ else if(selection[0] == srcList[1]){
+ mEngineWrapper.setPriorityForeground();
+ }
+ else if(selection[0] == srcList[2]){
+ mEngineWrapper.setPriorityHigh();
+ }
+ else{
+ mEngineWrapper.setPriorityAbsoluteHigh();
+ }
+ }
+}
+
+// ---------------------------------------------------------------------------
+void MainView::enableAutoStart()
+{
+ mEngineWrapper.autoStartEnable(true);
+}
+
+// ---------------------------------------------------------------------------
+void MainView::disableAutoStart()
+{
+ mEngineWrapper.autoStartEnable(false);
+}
+
+// ---------------------------------------------------------------------------
+void MainView::enableWatchdog()
+{
+ mEngineWrapper.watchDogEnable(true);
+}
+
+// ---------------------------------------------------------------------------
+void MainView::disableWatchdog()
+{
+ mEngineWrapper.watchDogEnable(false);
+}
+
+// ---------------------------------------------------------------------------
+void MainView::enableConsole()
+{
+ mEngineWrapper.consoleEnable(true);
+}
+
+// ---------------------------------------------------------------------------
+void MainView::disableConsole()
+{
+ mEngineWrapper.consoleEnable(false);
+}
+
+// ---------------------------------------------------------------------------
+void MainView::showParamList()
+{
+ QStringList srcList;
+ QStringList selection;
+ QString value;
+ QString name;
+ QString cfgSelection;
+ QString paramSelection;
+ QString cfgHti = "Hti.cfg";
+ QString cfgBtComm ="HtiBtComm.cfg";
+ QString cfgSerialComm = "HtiSerialComm.cfg";
+ QString cfgIPComm = "HtiIPComm.cfg";
+
+ srcList <<cfgHti <<cfgBtComm <<cfgSerialComm << cfgIPComm;
+
+ bool ok = false;
+ selection = HbListDialog::getStringItems("Select cfg file to modify", srcList, 0, &ok, HbAbstractItemView::SingleSelection);
+
+ if(ok){
+ cfgSelection = selection[0];
+ srcList.clear();
+ if(cfgSelection == cfgHti){
+ srcList <<"CommPlugin" <<"MaxMsgSize" <<"MaxQueueSize" <<"MaxHeapSize"<<"Priority"
+ <<"ShowConsole"<<"MaxWaitTime"<<"StartUpDelay"<<"EnableHtiWatchDog"
+ <<"EnableHtiAutoStart"<<"ShowErrorDialogs"<<"ReconnectDelay";
+ }
+ else if(cfgSelection == cfgBtComm){
+ srcList <<"BtDeviceName" <<"BtDeviceName";
+ }
+ else if(cfgSelection == cfgSerialComm){
+ srcList <<"CommPort" <<"DataRate"<<"Parity"<<"DataBits"<<"StopBits"<<"SendDelay"<<"Handshake";
+ }
+ else{
+ srcList <<"IAPName"<<"LocalPort"<<"RemoteHost"<<"RemotePort"<<"ConnectTimeout";
+ }
+
+ selection = HbListDialog::getStringItems("Select a parameter name in" + cfgSelection, srcList, 0, &ok, HbAbstractItemView::SingleSelection);
+ }
+
+ if(ok){
+ name = selection[0];
+ value = HbInputDialog::getText("Value for paramater " + name, "", &ok);
+ }
+
+ if(ok){
+ if(cfgSelection == cfgHti){
+ mEngineWrapper.setHtiCfgParam(name, value);
+ }
+ else if(cfgSelection == cfgBtComm){
+ mEngineWrapper.setBtCfgParam(name, value);
+ }
+ else if(cfgSelection == cfgSerialComm){
+ mEngineWrapper.setSerialCfgParam(name, value);
+ }
+ else{
+ mEngineWrapper.setIPCfgParam(name, value);
+ }
+ }
+}
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiAdminQt/mainview.h Fri Apr 16 14:59:17 2010 +0300
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of HtiAdmin main.
+*
+*/
+
+#ifndef MAINVIEW_H
+#define MAINVIEW_H
+
+
+#include <hbview.h>
+#include "htienginewrapper.h"
+
+
+class HbMainWindow;
+class HbApplication;
+class SettingsView;
+class HbAction;
+class HbTextEdit;
+class HbTextItem;
+class HbLabel;
+class QGraphicsLinearLayout;
+class QGraphicsGridLayout;
+
+
+/**
+ * Class that implements the main view of Screen Grabber
+ */
+class MainView : public HbView
+{
+ Q_OBJECT
+
+public:
+
+ /**
+ * Constructor
+ */
+ MainView(HbMainWindow &mainWindow, HtiEngineWrapper &engineWrapper);
+
+ /**
+ * Destructor
+ */
+ ~MainView();
+
+ /**
+ * Initializes Engine Wrapper
+ * @param app application class of Screen Grabber
+ */
+ void init(HbApplication &app);
+
+ void enableSerialComm();
+ void enableBTComm();
+ void enableIPComm();
+
+
+private slots:
+ void htiStatusChanged(HtiEngineWrapper::HtiStatus newStatus);
+ void commStatusChanged(QString& newStatus);
+ void updatePluginInfo(QStringList& pluginList);
+ void autostartStatusChanged(HtiEngineWrapper::AutoStartStatus newStatus);
+ void consoleStatusChanged(bool enabled);
+ void watchDogStatusChanged(bool enabled);
+ void commDetailsChanged(QString& newStatus);
+
+ void startHti();
+ void stopHti();
+ void enableComm();
+ void setPriority();
+ void enableAutoStart();
+ void disableAutoStart();
+ void enableWatchdog();
+ void disableWatchdog();
+ void enableConsole();
+ void disableConsole();
+ void showParamList ();
+
+
+private:
+
+ /**
+ * Creates menu
+ */
+ void createMenu(HbApplication &app);
+
+ /**
+ * Creates toolbar components
+ */
+ void createToolbar();
+
+ void createTexts();
+
+public:
+
+private:
+ /* Main windo of Screen Grabber */
+ HbMainWindow &mMainWindow;
+
+ /* Hti Engine Wrapper */
+ HtiEngineWrapper& mEngineWrapper;
+
+ /* Actions that are used in toolbars and menus */
+ HbAction* mActionExit;
+ HbAction* mActionStartHti;
+ HbAction* mActionStopHti;
+ HbAction* mActionSelectComm;
+ HbAction* mActionSetPriority;
+ HbAction* mActionEnableAuto;
+ HbAction* mActionDisableAuto;
+ HbAction* mActionEnableWdog;
+ HbAction* mActionDisableWdog;
+ HbAction* mActionEnableConsole;
+ HbAction* mActionDisableConsole;
+ HbAction* mActionSetParameter;
+
+ HbLabel* mHtiStatusTxt;
+ HbLabel* mHtiVersionTxt;
+ HbLabel* mHtiAutoStartStatusTxt;
+ HbLabel* mCommunicationTxt;
+ HbLabel* mCommDetailsTxt;
+
+ QStringList mPluginList;
+
+};
+
+#endif // MAINVIEW_H
+
+
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BWINS/HtiBtCommInterfaceu.def Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-EXPORTS
- ??0RHtiBtCommInterface@@QAE@XZ @ 1 NONAME ; RHtiBtCommInterface::RHtiBtCommInterface(void)
- ?CancelReceive@RHtiBtCommInterface@@QAEXXZ @ 2 NONAME ; void RHtiBtCommInterface::CancelReceive(void)
- ?CancelSend@RHtiBtCommInterface@@QAEXXZ @ 3 NONAME ; void RHtiBtCommInterface::CancelSend(void)
- ?Close@RHtiBtCommInterface@@QAEXXZ @ 4 NONAME ; void RHtiBtCommInterface::Close(void)
- ?Connect@RHtiBtCommInterface@@QAEHAAVTDesC8@@H@Z @ 5 NONAME ; int RHtiBtCommInterface::Connect(class TDesC8 &, int)
- ?GetPortNumber@RHtiBtCommInterface@@QBEHXZ @ 6 NONAME ; int RHtiBtCommInterface::GetPortNumber(void) const
- ?GetReceiveBufferSize@RHtiBtCommInterface@@QBEHXZ @ 7 NONAME ; int RHtiBtCommInterface::GetReceiveBufferSize(void) const
- ?GetSendBufferSize@RHtiBtCommInterface@@QBEHXZ @ 8 NONAME ; int RHtiBtCommInterface::GetSendBufferSize(void) const
- ?Receive@RHtiBtCommInterface@@QAEXAAVTDes8@@AAVTRequestStatus@@@Z @ 9 NONAME ; void RHtiBtCommInterface::Receive(class TDes8 &, class TRequestStatus &)
- ?Send@RHtiBtCommInterface@@QAEXABVTDesC8@@AAVTRequestStatus@@@Z @ 10 NONAME ; void RHtiBtCommInterface::Send(class TDesC8 const &, class TRequestStatus &)
- ?Version@RHtiBtCommInterface@@QBE?AVTVersion@@XZ @ 11 NONAME ; class TVersion RHtiBtCommInterface::Version(void) const
-
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BWINS/HtiBtCommServeru.def Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
- ?StartThread@@YAHXZ @ 1 NONAME ; int StartThread(void)
-
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BWINS/HtiBtSerialComHelperu.def Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-EXPORTS
- ??1CBtSerialClient@@UAE@XZ @ 1 NONAME ; CBtSerialClient::~CBtSerialClient(void)
- ?ConnectL@CBtSerialClient@@QAEXABVTDesC16@@H@Z @ 2 NONAME ; void CBtSerialClient::ConnectL(class TDesC16 const &, int)
- ?ConnectL@CBtSerialClient@@QAEXVTBTDevAddr@@H@Z @ 3 NONAME ; void CBtSerialClient::ConnectL(class TBTDevAddr, int)
- ?ConnectL@CBtSerialClient@@QAEXXZ @ 4 NONAME ; void CBtSerialClient::ConnectL(void)
- ?Connected@CBtSerialClient@@QAEHXZ @ 5 NONAME ; int CBtSerialClient::Connected(void)
- ?Connecting@CBtSerialClient@@QAEHXZ @ 6 NONAME ; int CBtSerialClient::Connecting(void)
- ?Disconnect@CBtSerialClient@@QAEXXZ @ 7 NONAME ; void CBtSerialClient::Disconnect(void)
- ?FreeSpaceInSendBuffer@CBtSerialClient@@QAEHXZ @ 8 NONAME ; int CBtSerialClient::FreeSpaceInSendBuffer(void)
- ?NewL@CBtSerialClient@@SAPAV1@AAVMBtSerialClientObserver@@@Z @ 9 NONAME ; class CBtSerialClient * CBtSerialClient::NewL(class MBtSerialClientObserver &)
- ?ReadAsyncL@CBtSerialClient@@QAEXXZ @ 10 NONAME ; void CBtSerialClient::ReadAsyncL(void)
- ?SendBufferMaxSize@CBtSerialClient@@QAEHXZ @ 11 NONAME ; int CBtSerialClient::SendBufferMaxSize(void)
- ?SendL@CBtSerialClient@@QAEXABVTDesC8@@@Z @ 12 NONAME ; void CBtSerialClient::SendL(class TDesC8 const &)
- ?ServerAddressL@CBtSerialClient@@QAE?AVTBTDevAddr@@XZ @ 13 NONAME ; class TBTDevAddr CBtSerialClient::ServerAddressL(void)
- ?ServicePort@CBtSerialClient@@QAEHXZ @ 14 NONAME ; int CBtSerialClient::ServicePort(void)
-
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/BtSerialClient.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,255 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Bluetooth serial client.
-*
-*/
-
-
-#ifndef __BTSERIALCLIENT_H__
-#define __BTSERIALCLIENT_H__
-
-// INCLUDES
-#include <e32base.h>
-#include <es_sock.h>
-#include <bt_sock.h>
-#include <btextnotifiers.h>
-#include <btsdp.h>
-
-#include "SocketObserver.h"
-
-// FORWARD DECLARATIONS
-class CMessageServiceSearcher;
-class CSocketsReader;
-class CSocketsWriter;
-
-
-class MBtSerialClientObserver
- {
-public:
- virtual void ConnectedToServer(TInt aError) = 0;
- virtual void DisconnectedFromServer() = 0;
- virtual void DataFromServer(const TDesC8& aData) = 0;
- virtual void AllBufferedDataSent() = 0;
- };
-
-/**
-* CBtSerialClient
-* Connects and sends messages to a remote machine using bluetooth
-*/
-class CBtSerialClient : public CActive, public MSocketObserver
- {
- public: // Constructors and destructor
-
- /**
- * NewL()
- * Construct a CBtSerialClient
- * @param aObserver the observer for this BT serial client
- * @return a pointer to the created instance of CBtSerialClient
- */
- IMPORT_C static CBtSerialClient* NewL( MBtSerialClientObserver& aObserver );
-
- /**
- * ~CBtSerialClient()
- * Destroy the object and release all memory objects.
- * Close any open sockets.
- */
- IMPORT_C virtual ~CBtSerialClient();
-
- public: // New functions
-
- /**
- * ConnectL()
- * Connect to remote device. Query user for a device.
- */
- IMPORT_C void ConnectL();
-
- /**
- * ConnectL()
- * Connect to remote device.
- */
- IMPORT_C void ConnectL(const TBTDevAddr aBTServerDevice, const TInt aPort );
-
- /**
- * ConnectL()
- * Connect to remote device by device name.
- */
- IMPORT_C void ConnectL( const TDesC& aBTServerDeviceName, const TInt aPort );
-
- /**
- * DisconnectL()
- * Disconnect from remote machine
- */
- IMPORT_C void Disconnect();
-
- /**
- * IsConnecting()
- * @return ETrue if the client is establishing a
- * connection to the server.
- */
- IMPORT_C TBool Connecting();
-
- /**
- * Connected()
- * @return ETrue if the client is fully connected to the server.
- */
- IMPORT_C TBool Connected();
-
- /**
- * ServerAddressL()
- * @return address of connected server. Leaves with KErrNotReady, if
- * not connected.
- */
- TBTDevAddr ServerAddressL();
-
- /**
- * Add data to outgoing buffer and start sending it to client.
- *
- * Leaves with KErrOverflow, if the outgoing buffer cannot
- * be added all of the aData.
- * Leaves with KErrNotReady, if client is not connected.
- * When all data in internal buffer has been sent, observer
- * is notified (AllBufferedDataSent)
- */
- IMPORT_C void SendL(const TDesC8& aData);
-
- /**
- * Issue read operation. Will complete asyncronously.
- *
- * Leaves with KErrNotReady, if client is not connected.
- * Notifies observer, when some data has been read. Caller
- * is responsible for calling this method again to receive
- * more data.
- */
- IMPORT_C void ReadAsyncL();
-
- /**
- * Query free size of outgoing buffer.
- */
- IMPORT_C TInt FreeSpaceInSendBuffer();
-
- /**
- * Query max size of outgoing buffer.
- */
- IMPORT_C TInt SendBufferMaxSize();
-
- /**
- * Query the port of the service we are connected with
- * @return Port number or KErrDisconnected if not connected to a service
- */
- IMPORT_C TInt ServicePort();
-
- protected: // from CActive
-
- /**
- * DoCancel()
- * Cancel any outstanding requests
- */
- void DoCancel();
-
- /**
- * RunL()
- * Respond to an event
- */
- void RunL();
-
- protected: // from MSocketObserver
-
- void ReportError( TErrorType aErrorType, TInt aErrorCode );
- void NewData( const TDesC8& aData );
- void AllBufferedDataSent();
-
- private:
-
- /**
- * ConnectToServerL
- * Connects to the service
- */
- void ConnectToServerL();
-
- /**
- * DisconnectFromServer()
- * Disconnects from the service
- */
- void DisconnectFromServer();
-
- /**
- * CBtSerialClient()
- * Constructs this object
- */
- CBtSerialClient( MBtSerialClientObserver& aObserver );
-
- /**
- * ConstructL()
- * Performs second phase construction of this object
- */
- void ConstructL();
-
- private: // data
-
- /**
- * TState
- * The state of the active object, determines behaviour within
- * the RunL method.
- * EWaitingToGetDevice waiting for the user to select a device
- * EGettingDevice searching for a device
- * EGettingService searching for a service
- * EGettingConnection connecting to a service on a remote machine
- * EConnected connected to a service on a remote machine
- */
- enum TState
- {
- EWaitingToGetDevice, // phase 1 of Connect
- EGettingDevice, // phase 2 of Connect
- EGettingService, // phase 3 of Connect
- EGettingConnection, // phase 4 of Connect
- EConnected, // sending and receiving data
- EDisconnecting
- };
-
- MBtSerialClientObserver& iObserver;
-
- /** iState the current state of the client */
- TState iState;
-
- /**
- * iServiceSearcher searches for service this
- * client can connect to.
- * Owned by CBtSerialClient
- */
- CMessageServiceSearcher* iServiceSearcher;
-
- /**
- * iCurrentServiceIndex the index number of the service we are
- * currently connecting/connected to
- */
- TInt iCurrentServiceIndex;
-
- /** iSocketServer a connection to the socket server */
- RSocketServ iSocketServer;
-
- /** iSocket a socket to connect with */
- RSocket iSocket;
-
- /** iServiceClass the service class UUID to search for */
- TUUID iServiceClass;
-
- TBTDevAddr iBTServerDevice;
-
- CSocketsReader* iSocketReader;
- CSocketsWriter* iSocketWriter;
- };
-
-#endif // __BTSERIALCLIENT_H__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/BtSerialEngine.pan Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Bluetooth serial engine panic codes.
-*
-*/
-
-
-#ifndef __BTSERIALENGINE_PAN__
-#define __BTSERIALENGINE_PAN__
-
-#include <e32def.h>
-#include <e32std.h>
-
-/** Panic Categories */
-_LIT( KPanicSerialEngine, "BTSerialEngine" ); // All engine classes
-_LIT( KPanicBTServiceAdvertiser, "BTServiceAdvertiser" ); // only service advertiser
-
-
-enum TBTSerialEnginePanics
- {
- EBTPointToPointReceiverInvalidState = 1,
- EBTPointToPointSenderExists = 2,
- EBTPointToPointReceiverExists = 3,
- EBTPointToPointSenderInvalidState = 4,
- EBTPointToPointNoSender = 5,
- EBTPointToPointAddMessage = 6,
- EBTPointToPointNextRecordRequestComplete = 7,
- EBTPointToPointAttributeRequestResult = 8,
- EBTPointToPointAttributeRequestComplete = 9,
- EBTPointToPointProtocolRead = 10,
- EBTPointToPointAttributeRequest = 11,
- EBTPointToPointSdpRecordDelete = 12,
- EBTPointToPointServerStop = 13,
- EBTPointToPointInvalidLogicState = 14,
- EBTPointToPointUnableToDisconnect = 15,
-
- EBTSerialEngineReadSocketBadState = 16,
- EBTSerialEngineWriteSocketBadState = 17
- };
-
-inline void Panic( TBTSerialEnginePanics aReason )
- {
- User::Panic( KPanicSerialEngine, aReason );
- }
-
-
-#endif // __BTSERIALENGINE_PAN__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/HtiBtEngineLogging.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Logging for Bluetooth engine.
-*
-*/
-
-
-#ifndef __HTIBTENGINELOGGING_H__
-#define __HTIBTENGINELOGGING_H__
-
-// INCLUDES
-#include <flogger.h>
-
-/******************************************************/
-/** LOG SETUP **/
-/******************************************************/
-_LIT(KLogFolder, "Hti");
-_LIT(KLogFile, "BtSerialEngine.log");
-
-#ifdef __ENABLE_LOGGING__
-// Comment out the levels which are marked supported in the build
-// (and which are used runtime).
-//
-#define LOG_LEVEL_ERROR_SUPPORTED
-#define LOG_LEVEL_WARN_SUPPORTED
-#define LOG_LEVEL_INFO_SUPPORTED
-//#define LOG_LEVEL_DEBUG_SUPPORTED
-#endif
-
-/******************************************************/
-/** MACRO DEFINITIONS **/
-/******************************************************/
-
-// Macros: Example: Result:
-// LOGFMT_E(formatstring, parameter) LOGFMT_E("Leave in RunL: %d", -6) <TIME> ERROR: Leave in RunL: -6
-// LOG_E(string) LOG_E("There was an error") <TIME> ERROR: There was an error
-// LOGFMT_W(formatstring, parameter) LOGFMT_W("Buffer too small: %d", 12) <TIME> WARNING: Buffer too small: 12
-// LOG_W(string) LOG_W("warmingtext") <TIME> WARNING: warningtext
-// LOGFMT_I(formatstring, parameter) LOGFMT_I("plugin loaded: %S", &myDescr8) <TIME> INFO: plugin loaded: myplugin
-// LOG_I(string) LOG_I("abc") <TIME> INFO: abc
-// LOGFMT_D(formatstring, parameter) LOGFMT_D("buffer length: %d", 56) <TIME> DEBUG: buffer length: 56
-// LOG_D(string) LOG_D("abc") <TIME> DEBUG: abc
-
-#define ERRORSTR "ERROR: "
-#define WARNSTR "WARNING: "
-#define INFOSTR "INFO: "
-#define DEBUGSTR "DEBUG: "
-
-#ifdef LOG_LEVEL_ERROR_SUPPORTED
- #define LOGFMT_E(a1, a2) {_LIT8(temp, ERRORSTR##a1); RFileLogger::WriteFormat(KLogFolder, KLogFile, EFileLoggingModeAppend, temp, a2);}
- #define LOG_E(a1) {_LIT8(temp, ERRORSTR##a1); RFileLogger::Write(KLogFolder, KLogFile, EFileLoggingModeAppend, temp);}
-#else
- #define LOGFMT_E(a1, a2) {}
- #define LOG_E(a1) {}
-#endif
-
-#ifdef LOG_LEVEL_WARN_SUPPORTED
- #define LOGFMT_W(a1, a2) {_LIT8(temp, WARNSTR##a1); RFileLogger::WriteFormat(KLogFolder, KLogFile, EFileLoggingModeAppend, temp, a2);}
- #define LOG_W(a1) {_LIT8(temp, WARNSTR##a1); RFileLogger::Write(KLogFolder, KLogFile, EFileLoggingModeAppend, temp);}
-#else
- #define LOGFMT_W(a1, a2) {}
- #define LOG_W(a1) {}
-#endif
-
-#ifdef LOG_LEVEL_INFO_SUPPORTED
- #define LOGFMT_I(a1, a2) {_LIT8(temp, INFOSTR##a1); RFileLogger::WriteFormat(KLogFolder, KLogFile, EFileLoggingModeAppend, temp, a2);}
- #define LOG_I(a1) {_LIT8(temp, INFOSTR##a1); RFileLogger::Write(KLogFolder, KLogFile, EFileLoggingModeAppend, temp);}
-#else
- #define LOGFMT_I(a1, a2) {}
- #define LOG_I(a1) {}
-#endif
-
-#ifdef LOG_LEVEL_DEBUG_SUPPORTED
- #define LOGFMT_D(a1, a2) {_LIT8(temp, DEBUGSTR##a1); RFileLogger::WriteFormat(KLogFolder, KLogFile, EFileLoggingModeAppend, temp, a2);}
- #define LOG_D(a1) {_LIT8(temp, DEBUGSTR##a1); RFileLogger::Write(KLogFolder, KLogFile, EFileLoggingModeAppend, temp);}
-#else
- #define LOGFMT_D(a1, a2) {}
- #define LOG_D(a1) {}
-#endif
-
-#endif // __HTIBTENGINELOGGING_H__
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/SocketObserver.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: The error notification interface.
-*
-*/
-
-
-#ifndef __SOCKETOBSERVER_H__
-#define __SOCKETOBSERVER_H__
-
-// CLASS DECLARATION
-
-/**
-* MEngineNotifier.
-* This class specifies the error notification interface.
-*/
-class MSocketObserver
- {
- public: // Enumerations
-
- /**
- * TErrorType.
- * Error types encountered when reading/writing to a sockets.
- * - EDisconnected. A disconnected error has been encountered.
- * - ETimeOutOnWrite. A write operation has failed to complete
- * within a predetermined period.
- * - EGeneralReadError. A general error has been encountered
- * during a read.
- * - EGeneralWriteError. A general error has been encountered
- * during a write
- */
- enum TErrorType
- {
- EDisconnected,
- ETimeOutOnWrite,
- EGeneralReadError,
- EGeneralWriteError
- };
-
- public: // New functions
-
- /**
- * ReportError.
- * Reports a communication error.
- * @param aErrorType Error type.
- * @param aErrorCode Associated error code.
- */
- virtual void ReportError( TErrorType aErrorType, TInt aErrorCode ) = 0;
-
- /**
- * NewData.
- * Data has been received on the socket and read into a buffer.
- * @param aData The data buffer.
- */
- virtual void NewData(const TDesC8& aData) = 0;
-
- virtual void AllBufferedDataSent() = 0;
- };
-
-#endif // __SOCKETOBSERVER_H__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/btservicesearcher.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,264 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Bluetooth service searcher.
-*
-*/
-
-
-#ifndef __BTSERVICESEARCHER_H__
-#define __BTSERVICESEARCHER_H__
-
-// INCLUDES
-#include <e32base.h>
-#include <bttypes.h>
-#include <btextnotifiers.h>
-
-#include "sdpattributeparser.h"
-#include "sdpattributenotifier.h"
-
-// CONSTANTS
-#include "messageprotocolconstants.h"
-
-// CLASS DECLARATIONS
-/**
-* CBTServiceSearcher
-* Searches for a service on a remote machine
-*/
-
-class CBTServiceSearcher : public CBase,
- public MSdpAgentNotifier,
- public MSdpAttributeNotifier
- {
- public: // Destructor
-
- /**
- * ~CBTServiceSearcher()
- * Destroy the object and release all memory objects
- */
- virtual ~CBTServiceSearcher();
-
- public: // New functions
-
- /**
- * SelectDeviceByDiscoveryL()
- * Select a device
- * @param aObserverRequestStatus the observer that is to
- * be notified when the device selection is complete.
- */
- void SelectDeviceByDiscoveryL( TRequestStatus&
- aObserverRequestStatus );
-
- /**
- * SelectDeviceByNameL()
- * Select a device by BT device name.
- * @param aDeviceName the name of the device to search and select.
- * @param aObserverRequestStatus the observer that is to
- * be notified when the device selection is complete.
- */
- void SelectDeviceByNameL( const TDesC& aDeviceName,
- TRequestStatus& aObserverRequestStatus );
-
- /**
- * FindServiceL()
- * Find a service on the specified device
- * @param aDeviceAddress the BT address of the device to search for
- * the service
- * @param aObserverRequestStatus the observer that is to be notified
- * when the service search is complete
- */
- void FindServiceL( const TBTDevAddr& aDeviceAddress,
- TRequestStatus& aObserverRequestStatus );
-
- /**
- * BTDevAddr()
- * @return the bluetooth device address
- */
- const TBTDevAddr& BTDevAddr();
-
- /**
- * ResponseParams()
- * @return Information about the device selected by the user
- */
- const TBTDeviceResponseParams& ResponseParams();
-
- protected: // New functions
-
- /**
- * CBTServiceSearcher()
- * Constructs this object
- */
- CBTServiceSearcher();
-
- /**
- * Finished()
- * The search has finished. Notify the observer
- * that the process is complete.
- */
- virtual void Finished( TInt aError = KErrNone );
-
- /**
- * HasFinishedSearching()
- * Is the instance still wanting to search.
- * @return EFalse if the instance wants searching to continue.
- */
- virtual TBool HasFinishedSearching() const;
-
- /**
- * HasFoundService()
- * @return ETrue if a service has been found
- */
- TBool HasFoundService() const;
-
- protected: // abstract methods
-
- /**
- * ProtocolList()
- * The list of Protocols required by the service.
- */
- virtual const TSdpAttributeParser::TSdpAttributeList&
- ProtocolList() const = 0;
-
- /**
- * ServiceClass()
- * The service class to search for
- * @return the service class UUID
- */
- virtual const TUUID& ServiceClass() const = 0;
-
- /**
- * FoundElementL()
- * Read the data element
- * @param aKey a key that identifies the element
- * @param aValue the data element
- */
- virtual void FoundElementL( TInt aKey, CSdpAttrValue& aValue ) = 0;
-
- public: // from MSdpAgentNotifier
-
- /**
- * NextRecordRequestComplete()
- * Process the result of the next record request
- * @param aError the error code
- * @param aHandle the handle of the service record
- * @param aTotalRecordsCount the total number of matching
- * service records
- */
- void NextRecordRequestComplete( TInt aError,
- TSdpServRecordHandle aHandle,
- TInt aTotalRecordsCount );
-
- /**
- * AttributeRequestResult()
- * Process the next attribute requested
- * @param aHandle the handle of the service record
- * @param aAttrID the id of the attribute
- * @param aAttrValue the value of the attribute
- */
- void AttributeRequestResult( TSdpServRecordHandle aHandle,
- TSdpAttributeID aAttrID,
- CSdpAttrValue* aAttrValue );
-
- /**
- * AttributeRequestComplete()
- * Process the arrtibute request completion
- * @param aHandle the handle of the service record
- * @param aError the error code
- */
- void AttributeRequestComplete( TSdpServRecordHandle aHandle,
- TInt aError );
-
- private: // Functions from base classes
-
- /**
- * NextRecordRequestCompleteL()
- * Process the result of the next record request
- * @param aError the error code
- * @param aHandle the handle of the service record
- * @param aTotalRecordsCount the total number of
- * matching service records
- */
- void NextRecordRequestCompleteL( TInt aError,
- TSdpServRecordHandle aHandle,
- TInt aTotalRecordsCount );
-
- /**
- * AttributeRequestResultL()
- * Process the next attribute requested
- * @param aHandle the handle of the service record
- * @param aAttrID the id of the attribute
- * @param aAttrValue the value of the attribute
- */
- void AttributeRequestResultL( TSdpServRecordHandle aHandle,
- TSdpAttributeID aAttrID,
- CSdpAttrValue* aAttrValue );
-
- /**
- * AttributeRequestCompleteL()
- * Process the arrtibute request completion
- * @param aHandle the handle of the service record
- * @param aError the error code
- */
- void AttributeRequestCompleteL( TSdpServRecordHandle,
- TInt aError );
-
- private: // data
-
- /**
- * iStatusObserver pointer to the request status observer
- * Not owned by CBTServiceSearcher
- */
- TRequestStatus* iStatusObserver;
-
- /**
- * iIsDeviceSelectorConnected is the device
- * selector connected?
- */
- TBool iIsDeviceSelectorConnected;
-
- /**
- * iDeviceSelector
- * a handle to the bluetooth device selector notifier
- */
- RNotifier iDeviceSelector;
-
- /**
- * iResponse
- * the response of the device selection.
- */
- TBTDeviceResponseParamsPckg iResponse;
-
- /**
- * iSelectionFilter
- * Request a device selection
- */
- TBTDeviceSelectionParamsPckg iSelectionFilter;
- /**
- * iAgent a connetction to the SDP client
- * Owned by CBTServiceSearcher
- */
- CSdpAgent* iAgent;
-
- /**
- * iSdpSearchPattern a search pattern
- * Owned by CBTServiceSearcher
- */
- CSdpSearchPattern* iSdpSearchPattern;
-
- /** iHasFoundService has the service been found ? */
- TBool iHasFoundService;
- };
-
-#endif // __BTSERVICESEARCHER_H__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/btservicesearcher.pan Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Bluetooth service searcher panic codes.
-*
-*/
-
-
-#ifndef __BTSERVICE_SEARCHER_PAN__
-#define __BTSERVICE_SEARCHER_PAN__
-
-#include <e32std.h>
-
-/** BTServiceSearcher application panic codes */
-enum TBTServiceSearcherPanics
- {
- EBTServiceSearcherNextRecordRequestComplete = 1,
- EBTServiceSearcherAttributeRequestResult,
- EBTServiceSearcherAttributeRequestComplete,
- EBTServiceSearcherInvalidControlIndex,
- EBTServiceSearcherProtocolRead,
- EBTServiceSearcherAttributeRequest,
- EBTServiceSearcherSdpRecordDelete
- };
-
-
-/** Panic Category */
-_LIT( KPanicServiceSearcher, "ServiceSearcher" );
-
-
-inline void Panic( TBTServiceSearcherPanics aReason )
- {
- User::Panic( KPanicServiceSearcher, aReason );
- }
-
-#endif // __BTSERVICE_SEARCHER_PAN__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/messageprotocolconstants.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Constants for Bluetooth.
-*
-*/
-
-
-#ifndef __CMESSAGE_PROTOCOL_CONSTANTS__
-#define __CMESSAGE_PROTOCOL_CONSTANTS__
-
-// INCLUDES
-#include <bt_sock.h>
-
-const TInt KRfcommChannel = 1;
-const TInt KServiceClass = 0x1101; // SerialPort
-
-const TUid KUidBTPointToPointApp = { 0x10005B8B };
-
-_LIT( KStrRFCOMM, "RFCOMM" );
-
-const TInt KListeningQueSize = 1;
-
-
-#endif //__CMESSAGE_PROTOCOL_CONSTANTS__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/messageservicesearcher.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Message service searcher.
-*
-*/
-
-
-#ifndef __MESSAGESERVICESEARCHER_H__
-#define __MESSAGESERVICESEARCHER_H__
-
-// INCLUDES
-#include <e32base.h>
-#include "btservicesearcher.h"
-
-// CLASS DECLARATIONS
-/**
-* CMessageServiceSearcher
-* Searches for a message service.
-*/
-class CMessageServiceSearcher : public CBTServiceSearcher
- {
- public: // Constructors and destructor
-
- /*
- * NewL()
- * Create a CMessageServiceSearcher object
- * @return a pointer to the created instance of
- * CMessageServiceSearcher
- */
- static CMessageServiceSearcher* NewL();
-
- /**
- * NewLC()
- * Create a CMessageServiceSearcher object
- * @return a pointer to the created instance of
- * CMessageServiceSearcher
- */
- static CMessageServiceSearcher* NewLC();
-
- /**
- * ~CMessageServiceSearcher()
- * Destroy the object and release all memory objects.
- */
- virtual ~CMessageServiceSearcher();
-
- public: // New functions
-
- /**
- * Port()
- * Retrieve the port on which the service is installed
- * @param aIndex index number of the service whose port number to get
- * @return the port number or KErrNotFound if aIndex negative or greater
- * than returned by ServiceCount()
- */
- TInt Port( TInt aIndex = 0 );
-
- /**
- * AppendPort()
- * Adds a new port number to the port number array. If the port number
- * already exists in the array a duplicate is not added.
- * @param aPort the port number to add
- * */
- void AppendPort( TInt aPort );
-
- /**
- * ServiceCount()
- * Get the amount of requested services found from the remote machine
- * @return the count of services (= ports)
- */
- TInt ServiceCount();
-
- protected: // New functions
-
- /**
- * ServiceClass()
- * @return the service class uid.
- */
- const TUUID& ServiceClass() const;
-
- /**
- * ProtocolList()
- * @return the attribute list.
- */
- const TSdpAttributeParser::TSdpAttributeList& ProtocolList() const;
-
- /**
- * FoundElementL()
- * Read the data element
- * @param aKey a key that identifies the element
- * @param aValue the data element
- */
- virtual void FoundElementL( TInt aKey, CSdpAttrValue& aValue );
-
- private: // Constructors
-
- /**
- * CMessageServiceSearcher()
- * Constructs this object
- * @param aLog the log to send output to
- */
- CMessageServiceSearcher();
-
- /**
- * ConstructL()
- * Performs second phase construction of this object
- */
- void ConstructL();
-
- private: // data
-
- /** iServiceClass the service class UUID to search for */
- TUUID iServiceClass;
-
- /**
- * iPortNumbers array of port numbers that has the remote
- * service installed
- */
- RArray<TInt> iPortNumbers;
- };
-
-#endif // __MESSAGESERVICESEARCHER_H__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/sdpattributenotifier.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Reads SDP Attribute elements.
-*
-*/
-
-
-#ifndef __SDP_ATTRIBUTE_NOTIFIER_H__
-#define __SDP_ATTRIBUTE_NOTIFIER_H__
-
-// FORWARD DECLARATIONS
-class CSdpAttrValue;
-
-// CLASS DECLARATIONS
-/**
-* MSdpAttributeNotifier
-* An instance of MSdpAttributeNotifier is used to read selected SDP Attribute
-* elements from an attribute value.
-*/
-class MSdpAttributeNotifier
- {
- public: // New functions
-
- /**
- * FoundElementL
- * Read the data element
- * @param aKey a key that identifies the element
- * @param aValue the data element
- */
- virtual void FoundElementL( TInt aKey, CSdpAttrValue& aValue ) = 0;
- };
-
-#endif // __SDP_ATTRIBUTE_NOTIFIER_H__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/sdpattributeparser.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Reads selected parts of SDP attribute values.
-*
-*/
-
-
-#ifndef __SDP_ATTRIBUTE_PARSER_H__
-#define __SDP_ATTRIBUTE_PARSER_H__
-
-// INCLUDES
-#include <btsdp.h>
-#include "staticarrayc.h"
-
-// FORWARD DECLARATIONS
-class MSdpAttributeNotifier;
-
-// CLASS DECLARATIONS
-/**
-* TSdpAttributeParser
-* An instance of TSdpAttributeParser is used to check an SDP
-* attribute value, and read selected parts
-*/
-class TSdpAttributeParser : public MSdpAttributeValueVisitor
- {
- public: // Enumerations
-
- /**
- * TNodeCommand
- * The command to be carried out at a node
- * ECheckType. Check the type of the value
- * ECheckValue. Check the type and the value
- * ECheckEnd. Check that a list ends at this point
- * ESkip. Do not check this value - can not match a list end
- * EReadValue. Pass the value onto the observer
- * EFinished. Marks the end of the node list
- */
- enum TNodeCommand
- {
- ECheckType,
- ECheckValue,
- ECheckEnd,
- ESkip,
- EReadValue,
- EFinished
- };
-
- /**
- * SSdpAttributeNode
- * An instance of SSdpAttributeNode is used to determine how
- * to parse an SDP attribute value data element
- */
- struct SSdpAttributeNode
- {
- /** iCommand the command for the node */
- TNodeCommand iCommand;
-
- /** iType the expected type */
- TSdpElementType iType;
-
- /** iValue the expected value for ECheckValue,the value of aKey
- * passed to the observer for EReadValue
- */
- TInt iValue;
- };
-
- typedef const TStaticArrayC< SSdpAttributeNode > TSdpAttributeList;
-
- /**
- * TSdpAttributeParser
- * Construct a TSdpAttributeParser
- * @param aNodeList the list of expected nodes
- * @param aObserver an observer to read specified node values
- */
- TSdpAttributeParser( TSdpAttributeList& aNodeList,
- MSdpAttributeNotifier& aObserver );
-
- /**
- * HasFinished
- * Check if parsing processed the whole list
- * @return true is the index refers to the EFinished node
- */
- TBool HasFinished() const;
-
- public: // from MSdpAttributeValueVisitor
-
- /**
- * VisitAttributeValueL
- * Process a data element
- * @param aValue the data element
- * @param aType the type of the data element
- */
- void VisitAttributeValueL( CSdpAttrValue& aValue,
- TSdpElementType aType );
-
- /**
- * StartListL
- * Process the start of a data element list
- * @param aList the data element list
- */
- void StartListL( CSdpAttrValueList& aList );
-
- /**
- * EndListL
- * Process the end of a data element list
- */
- void EndListL();
-
- private: // Functions from base classes
-
- /**
- * CheckTypeL
- * Check the type of the current node is the same as
- * the specified type.
- * @param aElementType the type of the current data element
- */
- void CheckTypeL( TSdpElementType aElementType ) const;
-
- /**
- * CheckValueL
- * Check the value of the current node is the same as the specified value
- * @param aValue the value of the current data element.
- */
- void CheckValueL( CSdpAttrValue& aValue ) const;
-
- /**
- * ReadValueL
- * Pass the data element value to the observer
- * @param aValue the value of the current data element.
- */
- void ReadValueL( CSdpAttrValue& aValue ) const;
-
- /**
- * CurrentNode
- * Get the current node
- * @return the current node
- */
- const SSdpAttributeNode& CurrentNode() const;
-
- /**
- * AdvanceL
- * Advance to the next node. Leaves with KErrEof
- * if at the finished node.
- */
- void AdvanceL();
-
- private: // data
-
- /** iObserver the observer to read values */
- MSdpAttributeNotifier& iObserver;
-
- /** iNodeList a list defining the expected
- * structure of the value
- */
- TSdpAttributeList& iNodeList;
-
- /** iCurrentNodeIndex the index of the current node in iNodeList */
- TInt iCurrentNodeIndex;
- };
-
-#endif // __SDP_ATTRIBUTE_PARSER_H__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/sdpattributeparser.pan Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Bluetooth SDP attribute parser panic codes.
-*
-*/
-
-
-#ifndef __SDP_ATTRIBUTE_PARSER_PAN__
-#define __SDP_ATTRIBUTE_PARSER_PAN__
-
-/** Panic Category */
-_LIT( KPanicSAP, "SAP" );
-
-/** BTPointToPoint application panic codes */
-enum TSdpAttributeParserPanics
- {
- ESdpAttributeParserInvalidCommand = 1,
- ESdpAttributeParserNoValue,
- ESdpAttributeParserValueIsList,
- ESdpAttributeParserValueTypeUnsupported
- };
-
-inline void Panic( TSdpAttributeParserPanics aReason )
- {
- User::Panic( KPanicSAP, aReason );
- }
-
-
-#endif // __SDP_ATTRIBUTE_PARSER_PAN__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/socketsreader.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Reads from socket.
-*
-*/
-
-
-#ifndef __SOCKETSREADER_H__
-#define __SOCKETSREADER_H__
-
-// INCLUDES
-#include <in_sock.h>
-
-// FORWARD DECLARATIONS
-class MSocketObserver;
-
-// CLASS DECLARATION
-
-const TInt KReadBufferMaxSize = 2 * 1024;
-
-class CSocketsReader : public CActive
- {
- public: // Constructors and destructors
-
- static CSocketsReader* NewL( MSocketObserver& aObserver,
- RSocket& aSocket );
- virtual ~CSocketsReader();
-
- public: // New functions
-
- void ReadAsync(); // Use Cancel() to cancel
-
- protected: // from CActive
-
- void DoCancel();
- void RunL();
-
- private: // Constructors and destructors
-
- CSocketsReader( MSocketObserver& aObserver, RSocket& aSocket );
- void ConstructL();
-
- private: // New functions
-
- void IssueRead();
-
- private: // Data
-
- RSocket& iSocket;
- MSocketObserver& iObserver;
- TBuf8<KReadBufferMaxSize> iBuffer;
- TSockXfrLength iLen;
- };
-
-#endif // __SOCKETSREADER_H__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/socketswriter.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Writes to socket.
-*
-*/
-
-
-#ifndef __SOCKETSWRITER_H__
-#define __SOCKETSWRITER_H__
-
-// INCLUDES
-#include <in_sock.h>
-#include "timeoutnotifier.h"
-
-// FORWARD DECLARATIONS
-class CTimeOutTimer;
-class MSocketObserver;
-
-const TInt KSocketWriteBufferSize = 1024;
-const TInt KTransferBufferSize = 8 * 1024;
-
-// CLASS DECLARATION
-class CSocketsWriter : public CActive, public MTimeOutNotifier
- {
- public:
-
- static CSocketsWriter* NewL( MSocketObserver& aEngineNotifier,
- RSocket& aSocket );
- virtual ~CSocketsWriter();
-
- /**
- * Add data to iTransferBuffer and start sending if not already sending
- * Leaves with KErrOverflow, if there is not enough free space.
- * This can be called as long as there is space in buffer.
- */
- void SendL(const TDesC8& aData);
-
- void CancelSending();
-
- /**
- * Return number of bytes that can be added to iTransferBuffer.
- */
- TInt FreeSpaceInSendBuffer();
-
- TInt SendBufferMaxSize();
-
- protected: // from CActive
-
- void DoCancel();
- void RunL();
-
- protected: // from MTimeOutNotifier
-
- void TimerExpired();
-
- private: // Constructors and destructors
-
- CSocketsWriter( MSocketObserver& aEngineNotifier, RSocket& aSocket );
- void ConstructL();
-
- private: // New functions
-
- void SendNextPacket();
-
- private: // Enumerations
-
- enum TWriteState
- {
- ESending,
- EIdle // nothing to be sent
- };
-
- private: // Data
-
- RSocket& iSocket;
- MSocketObserver& iObserver;
- TBuf8<KTransferBufferSize> iTransferBuffer;
- TBuf8<KSocketWriteBufferSize> iWriteBuffer;
- CTimeOutTimer* iTimer;
- TInt iTimeOut; // microseconds
- TWriteState iWriteStatus;
- };
-
-#endif // __SOCKETSWRITER_H__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/staticarrayc.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Templated class for using static arrays.
-*
-*/
-
-
-#ifndef __STATIC_ARRAY_C_H__
-#define __STATIC_ARRAY_C_H__
-
-
-// CLASS DECLARATIONS
-
-/**
-* TStaticArrayC
-* This templated class provides a type, and size, safe method of
-* using static arrays.
-*/
-template <class T>
-class TStaticArrayC
- {
- public: // enumerations
-
- /**
- * operator[]
- * Return an element from the array.
- * @param aIndex the index of the element to return
- * @return a reference to the object
- */
- inline const T& operator[]( TInt aIndex ) const;
-
- /**
- * TPanicCode
- * Panic code
- * EIndexOutOfBounds index is out of bounds
- */
- enum TPanicCode
- {
- EIndexOutOfBounds = 1
- };
-
- /**
- * Panic
- * Generate a panic.
- * @param aPanicCode the reason code for the panic
- */
- inline void Panic( TPanicCode aPanicCode ) const;
-
- public: // data
-
- /** iArray the arrat of elements */
- const T* iArray;
-
- /** iCount the number of elements */
- TInt iCount;
-
- };
-
-// INCLUDES
-#include "staticarrayc.inl"
-
-/**
-* CONSTRUCT_STATIC_ARRAY_C
-* Initalise a global constant of type TStaticArrayC<>.
-* @param aValue the underlying const array of T
-*/
-#define CONSTRUCT_STATIC_ARRAY_C( aValue ) \
- { \
- aValue, \
- sizeof( aValue ) / sizeof( *aValue ) \
- } \
-
-#endif // __STATIC_ARRAY_C_H__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/staticarrayc.inl Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Inline method implementations of TStaticArrayC.
-*
-*/
-
-
-// CONSTANTS
-_LIT( KStaticArrayPanic,"StaticArray" );
-
-template <class T>
-inline const T& TStaticArrayC<T>::operator[]( TInt aIndex ) const
- {
- if ( ( aIndex >= iCount ) || ( aIndex < 0 ) )
- {
- Panic( EIndexOutOfBounds );
- }
-
- return iArray[aIndex];
- }
-
-template <class T>
-inline void TStaticArrayC<T>::Panic( TPanicCode aPanicCode ) const
- {
- User::Panic( KStaticArrayPanic, aPanicCode );
- }
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/timeoutnotifier.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Interface for timeout notification.
-*
-*/
-
-
-#ifndef __TIMEOUTNOTIFIER_H__
-#define __TIMEOUTNOTIFIER_H__
-
-// CLASS DECLARATION
-
-class MTimeOutNotifier
- {
- public: // New functions
-
- /**
- * The function to be called when a timeout occurs.
- */
- virtual void TimerExpired() = 0;
- };
-
-#endif // __TIMEOUTNOTIFIER_H__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/inc/timeouttimer.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Timer.
-*
-*/
-
-
-#ifndef __TIMEOUTTIMER_H__
-#define __TIMEOUTTIMER_H__
-
-// INCLUDES
-#include <e32base.h>
-
-// FORWARD DECLARATIONS
-class MTimeOutNotifier;
-
-// CLASS DECLARATION
-class CTimeOutTimer : public CTimer
- {
- public: // Constructors and destructors
-
- static CTimeOutTimer* NewL( const TInt aPriority,
- MTimeOutNotifier& aObserver);
- virtual ~CTimeOutTimer();
-
- protected: // Functions from base classes
-
- void RunL();
-
- private: // Constructors and destructors
-
- CTimeOutTimer( const TInt aPriority,
- MTimeOutNotifier& aTimeOutNotify );
- void ConstructL();
-
- private: // Data
-
- MTimeOutNotifier& iObserver;
- };
-
-#endif // __TIMEOUTTIMER_H__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/src/BtSerialClient.cpp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,440 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Bluetooth serial client.
-*
-*/
-
-
-// INCLUDE FILES
-#include <e32std.h>
-#include <btengsettings.h> // CBTEngSettings
-
-#include "BtSerialClient.h"
-#include "messageservicesearcher.h"
-#include "BtSerialEngine.pan"
-#include "HtiBtEngineLogging.h"
-#include "socketswriter.h"
-#include "socketsreader.h"
-
-const TInt KMaxBtStartWaitLoop = 5;
-const TInt KBtStateQueryInterval = 1000000; // microseconds
-
-
-// ----------------------------------------------------------------------------
-EXPORT_C CBtSerialClient* CBtSerialClient::NewL(MBtSerialClientObserver& aObserver)
- {
- CBtSerialClient* self = new (ELeave) CBtSerialClient(aObserver);
- CleanupStack::PushL(self);
- self->ConstructL();
- CleanupStack::Pop(self);
- return self;
- }
-
-// ----------------------------------------------------------------------------
-CBtSerialClient::CBtSerialClient(MBtSerialClientObserver& aObserver)
-: CActive( CActive::EPriorityStandard ), iObserver(aObserver),
- iState( EWaitingToGetDevice ), iCurrentServiceIndex( 0 )
- {
- CActiveScheduler::Add( this );
- }
-
-// ----------------------------------------------------------------------------
-EXPORT_C CBtSerialClient::~CBtSerialClient()
- {
- delete iSocketReader;
- delete iSocketWriter;
-
- Cancel();
-
- iSocket.Close();
- iSocketServer.Close();
-
- delete iServiceSearcher;
- }
-
-// ----------------------------------------------------------------------------
-void CBtSerialClient::ConstructL()
- {
- LOG_D( "CBtSerialClient::ConstructL()" );
-
- // Check Bluetooth power state
- TBTPowerStateValue powerState = EBTPowerOff;
- CBTEngSettings* btSettings = CBTEngSettings::NewLC();
- TInt err = btSettings->GetPowerState( powerState );
- if ( err )
- {
- LOGFMT_W( "CBtSerialClient::ConstructL(): GetPowerState error %d", err );
- powerState = EBTPowerOff;
- }
-
- // If BT not on - try to set it on
- if ( powerState == EBTPowerOff )
- {
- LOG_I( "CBtSerialClient::ConstructL(): BT not on - setting power on" );
- err = btSettings->SetPowerState( EBTPowerOn );
- if ( err )
- {
- LOGFMT_E( "CBtSerialClient::ConstructL(): SetPowerState error %d", err );
- User::Leave( err );
- }
-
- // Wait until BT is reported to be on (or waiting time exceeds)
- TInt loopCounter = 0;
- while ( powerState == EBTPowerOff && loopCounter < KMaxBtStartWaitLoop )
- {
- btSettings->GetPowerState( powerState );
- LOGFMT_D( "CBtSerialClient::ConstructL(): BT power state %d", powerState );
- User::After( KBtStateQueryInterval );
- loopCounter++;
- }
-
- if ( powerState == EBTPowerOff )
- {
- LOG_E( "CBtSerialClient::ConstructL(): Could not turn BT on" );
- User::Leave( KErrCouldNotConnect );
- }
- LOG_I( "CBtSerialClient::ConstructL(): Continuing BT connect" );
- }
- CleanupStack::PopAndDestroy(); // btSettings
-
- iServiceSearcher = CMessageServiceSearcher::NewL();
- User::LeaveIfError( iSocketServer.Connect() );
- iSocketReader = CSocketsReader::NewL( *this, iSocket );
- iSocketWriter = CSocketsWriter::NewL( *this, iSocket );
- }
-
-// ----------------------------------------------------------------------------
-void CBtSerialClient::DoCancel()
- {
- LOG_W("CBtSerialClient::DoCancel(): Doing nothing");
- }
-
-// ----------------------------------------------------------------------------
-void CBtSerialClient::RunL()
- {
- if ( iStatus != KErrNone )
- {
- switch ( iState )
- {
- case EGettingDevice:
- if ( iStatus == KErrCancel )
- {
- LOG_W( "CBtSerialClient: No device selected" );
- }
- iState = EWaitingToGetDevice;
- iObserver.ConnectedToServer( iStatus.Int() );
- break;
- case EGettingService:
- LOGFMT_W( "CBtSerialClient: Failed to fetch remote service: %d", iStatus.Int() );
- iObserver.ConnectedToServer( iStatus.Int() );
- iState = EWaitingToGetDevice;
- break;
- case EGettingConnection:
- LOGFMT_W( "CBtSerialClient: Failed to connect to remote service: %d", iStatus.Int() );
- if ( iCurrentServiceIndex < iServiceSearcher->ServiceCount() )
- {
- // Try another service
- iCurrentServiceIndex++;
- ConnectToServerL(); // establish RFComm connection
- }
- else
- {
- iState = EWaitingToGetDevice;
- iObserver.ConnectedToServer( iStatus.Int() );
- }
- break;
- case EConnected:
- LOGFMT_I( "CBtSerialClient: Lost connection: %d", iStatus.Int() )
- DisconnectFromServer();
- iState = EDisconnecting;
- break;
- case EDisconnecting:
- LOGFMT_I("CBtSerialClient: Disconnected from server: %d", iStatus.Int() );
- iSocket.Close();
- iState = EWaitingToGetDevice;
- iObserver.DisconnectedFromServer();
- break;
- default:
- Panic( EBTPointToPointInvalidLogicState );
- break;
- }
- }
- else // iStatus = KErrNone
- {
- switch ( iState )
- {
- case EGettingDevice:
- // found a device now search for a suitable service
- LOGFMT_I("CBtSerialClient: Found device: %S. Finding correct service.", &(iServiceSearcher->ResponseParams().DeviceName()) );
- iState = EGettingService;
- iStatus = KRequestPending; // this means that the RunL can not
- // be called until this program
- // does something to iStatus
- iBTServerDevice = iServiceSearcher->BTDevAddr();
- iServiceSearcher->FindServiceL( iBTServerDevice, iStatus );
- SetActive();
- break;
- case EGettingService:
- LOGFMT_I("CBtSerialClient: Found %d remote services", iServiceSearcher->ServiceCount());
- iState = EGettingConnection;
- ConnectToServerL(); // establish RFComm connection
- break;
- case EGettingConnection:
- LOG_I( "CBtSerialClient: Connected to remote service" );
- iState = EConnected;
- iObserver.ConnectedToServer( KErrNone );
- break;
- case EDisconnecting:
- LOG_I( "CBtSerialClient: Disconnecting" );
- iSocket.Close();
- iState = EWaitingToGetDevice;
- iObserver.DisconnectedFromServer();
- break;
- default:
- LOGFMT_E( "CBtSerialClient: Invalid logic state in RunL: %d. Will panic", iState );
- Panic( EBTPointToPointInvalidLogicState );
- break;
- };
- }
- }
-
-// ----------------------------------------------------------------------------
-EXPORT_C void CBtSerialClient::ConnectL()
- {
- if ( iState == EWaitingToGetDevice && !IsActive() )
- {
- LOG_D( "CBtSerialClient: Connecting by user selection" );
- iState = EGettingDevice;
- iServiceSearcher->SelectDeviceByDiscoveryL( iStatus );
- SetActive();
- }
- else
- {
- LOG_W( "CBtSerialClient: Already connecting or connected" );
- User::Leave( KErrInUse );
- }
- }
-
-// ----------------------------------------------------------------------------
-EXPORT_C void CBtSerialClient::ConnectL( const TBTDevAddr aBTServerDevice,
- const TInt aPort )
- {
- if ( iState == EWaitingToGetDevice && !IsActive() )
- {
- if ( aPort >= 0 )
- {
- // If there was a valid port given, add it as the first port to try
- iServiceSearcher->AppendPort( aPort );
- }
- LOG_D( "CBtSerialClient: Connecting by address" );
- iBTServerDevice = aBTServerDevice;
- iServiceSearcher->FindServiceL( iBTServerDevice, iStatus );
- iState = EGettingService;
- iStatus = KRequestPending; // this means that the RunL can not
- // be called until this program
- // does something to iStatus
- SetActive();
- }
- else
- {
- LOG_W("CBtSerialClient: Already connecting or connected");
- User::Leave( KErrInUse );
- }
- }
-
-// ----------------------------------------------------------------------------
-EXPORT_C void CBtSerialClient::ConnectL( const TDesC& aBTServerDeviceName,
- const TInt aPort )
- {
- if ( iState == EWaitingToGetDevice && !IsActive() )
- {
- if ( aPort >= 0 )
- {
- // If there was a valid port given, add it as the first port to try
- iServiceSearcher->AppendPort( aPort );
- }
- LOG_D( "CBtSerialClient: Connecting by name" );
- iState = EGettingDevice;
- iServiceSearcher->SelectDeviceByNameL( aBTServerDeviceName, iStatus );
- SetActive();
- }
- else
- {
- LOG_W( "CBtSerialClient: Already connecting or connected" );
- User::Leave( KErrInUse );
- }
- }
-
-// ----------------------------------------------------------------------------
-EXPORT_C TBTDevAddr CBtSerialClient::ServerAddressL()
- {
- if ( !Connected() )
- {
- User::Leave( KErrNotReady );
- }
- return iBTServerDevice;
- }
-
-// ----------------------------------------------------------------------------
-EXPORT_C void CBtSerialClient::Disconnect()
- {
- if ( iState == EConnected )
- {
- DisconnectFromServer();
- iState = EDisconnecting;
- }
- else
- {
- LOG_W( "CBtSerialClient: Disconnect: Not connected" );
- User::Leave( KErrDisconnected );
- }
- }
-
-// ----------------------------------------------------------------------------
-void CBtSerialClient::DisconnectFromServer()
- {
- // Terminate all operations
- iSocket.CancelAll();
- Cancel();
- iSocketReader->Cancel();
- iSocketWriter->CancelSending();
-
- LOG_I( "CBtSerialClient: Disconnecting from server" );
- iSocket.Shutdown( RSocket::ENormal, iStatus );
- SetActive();
- }
-
-// ----------------------------------------------------------------------------
-void CBtSerialClient::ConnectToServerL()
- {
- LOG_I("CBtSerialClient: ConnectToServerL")
- User::LeaveIfError( iSocket.Open( iSocketServer, KStrRFCOMM ) );
-
- TBTSockAddr address;
- address.SetBTAddr( iServiceSearcher->BTDevAddr() );
- address.SetPort( iServiceSearcher->Port( iCurrentServiceIndex ) );
-
- LOGFMT_I("CBtSerialClient: ConnectToServerL: Port = %d", address.Port() );
- iSocket.Connect( address, iStatus );
-
-#ifdef __WINS__
- User::After( 1 ); // Needed to allow emulator client to connect to server
-#endif
-
- SetActive();
- }
-
-// ----------------------------------------------------------------------------
-EXPORT_C void CBtSerialClient::SendL(const TDesC8& aData)
- {
- if ( !Connected() )
- {
- User::Leave( KErrNotReady );
- }
-
- LOGFMT_D("CBtSerialClient::SendL: Sending data (max first 32 bytes): \"%S\"", &(aData.Left(32)));
- iSocketWriter->SendL( aData ); // Add to data queue and start sending
- LOG_D("CBtSerialClient::SendL: Sent to socket");
- }
-
-EXPORT_C void CBtSerialClient::ReadAsyncL()
- {
- if ( !Connected() )
- {
- User::Leave( KErrNotReady );
- }
- iSocketReader->ReadAsync();
- }
-
-// ----------------------------------------------------------------------------
-EXPORT_C TInt CBtSerialClient::FreeSpaceInSendBuffer()
- {
- return iSocketWriter->FreeSpaceInSendBuffer();
- }
-
-// ----------------------------------------------------------------------------
-EXPORT_C TInt CBtSerialClient::SendBufferMaxSize()
- {
- return iSocketWriter->SendBufferMaxSize();
- }
-
-// ----------------------------------------------------------------------------
-EXPORT_C TBool CBtSerialClient::Connected()
- {
- return (iState == EConnected);
- }
-
-// ----------------------------------------------------------------------------
-EXPORT_C TBool CBtSerialClient::Connecting()
- {
- return ( ( iState == EGettingDevice ) ||
- ( iState == EGettingService ) ||
- ( iState == EGettingConnection ) );
- }
-
-// ----------------------------------------------------------------------------
-EXPORT_C TInt CBtSerialClient::ServicePort()
- {
- if ( !Connected() )
- {
- return KErrDisconnected;
- }
- return iServiceSearcher->Port( iCurrentServiceIndex );
- }
-
-// ----------------------------------------------------------------------------
-void CBtSerialClient::ReportError( TErrorType aErrorType, TInt aErrorCode )
- {
- LOGFMT_W( "CBtSerialClient::ReportError: %d", aErrorCode );
- // From socket reader or writer
- switch ( aErrorType )
- {
- case EDisconnected:
- {
- LOG_I( "CBtSerialClient: disconnected" );
- }
- break;
- case ETimeOutOnWrite:
- {
- LOG_I( "CBtSerialClient: timout writing data. Disconnecting from server" );
- }
- break;
- case EGeneralReadError:
- {
- LOG_I( "CBtSerialClient: general read error. Disconnecting from server" );
- }
- break;
- case EGeneralWriteError:
- {
- LOG_I( "CBtSerialClient: general write error. Disconnecting from server" );
- }
- break;
- }
- Disconnect();
- aErrorCode = aErrorCode;
- }
-
-// ----------------------------------------------------------------------------
- void CBtSerialClient::NewData( const TDesC8& aData )
- {
- iObserver.DataFromServer( aData );
- }
-
-// ----------------------------------------------------------------------------
-void CBtSerialClient::AllBufferedDataSent()
- {
- iObserver.AllBufferedDataSent();
- }
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/src/btservicesearcher.cpp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,382 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Bluetooth service searcher.
-*
-*/
-
-
-// INCLUDE FILES
-#include "btservicesearcher.h"
-#include "btservicesearcher.pan"
-
-#include "HtiBtEngineLogging.h"
-
-// ============================ MEMBER FUNCTIONS ==============================
-
-// ----------------------------------------------------------------------------
-// CBTServiceSearcher::CBTServiceSearcher()
-// Constructor.
-// ----------------------------------------------------------------------------
-//
-CBTServiceSearcher::CBTServiceSearcher()
-: iIsDeviceSelectorConnected( EFalse )
- {
- }
-
-// ----------------------------------------------------------------------------
-// CBTServiceSearcher::~CBTServiceSearcher()
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CBTServiceSearcher::~CBTServiceSearcher()
- {
- if ( iIsDeviceSelectorConnected )
- {
- iDeviceSelector.CancelNotifier( KDeviceSelectionNotifierUid );
- iDeviceSelector.Close();
- }
- delete iSdpSearchPattern;
- iSdpSearchPattern = NULL;
-
- delete iAgent;
- iAgent = NULL;
- }
-
-// ----------------------------------------------------------------------------
-// CBTServiceSearcher::SelectDeviceByDiscoveryL()
-// Select a device.
-// ----------------------------------------------------------------------------
-//
-void CBTServiceSearcher::SelectDeviceByDiscoveryL(
- TRequestStatus& aObserverRequestStatus )
- {
- if ( ! iIsDeviceSelectorConnected )
- {
- User::LeaveIfError( iDeviceSelector.Connect() );
- iIsDeviceSelectorConnected = ETrue;
- }
-
- iSelectionFilter().SetUUID( ServiceClass() );
-
- iDeviceSelector.StartNotifierAndGetResponse(
- aObserverRequestStatus,
- KDeviceSelectionNotifierUid,
- iSelectionFilter,
- iResponse );
- }
-
-// ----------------------------------------------------------------------------
-// CBTServiceSearcher::SelectDeviceByNameL()
-// Select a device by BT device name.
-// ----------------------------------------------------------------------------
-//
-void CBTServiceSearcher::SelectDeviceByNameL( const TDesC& aDeviceName,
- TRequestStatus& aObserverRequestStatus )
- {
- LOG_D( "CBTServiceSearcher::SelectDeviceByNameL" );
-
- RSocketServ socketServ;
- User::LeaveIfError( socketServ.Connect() );
- CleanupClosePushL( socketServ );
-
- TProtocolDesc pInfo;
- _LIT( KL2Cap, "BTLinkManager" );
- User::LeaveIfError(
- socketServ.FindProtocol( TProtocolName( KL2Cap ), pInfo ) );
-
- LOG_D( "CBTServiceSearcher: Found protocol" );
-
- RHostResolver hr;
- User::LeaveIfError( hr.Open( socketServ,
- pInfo.iAddrFamily, pInfo.iProtocol ) );
- CleanupClosePushL( hr );
-
- LOG_D( "CBTServiceSearcher: HostResolver open" );
-
- TInquirySockAddr addr;
- TNameEntry entry;
- addr.SetIAC( KGIAC );
- addr.SetAction( KHostResName | KHostResInquiry );
-
- User::LeaveIfError( hr.GetByAddress( addr, entry ) );
- LOG_D( "CBTServiceSearcher: GetByAddress ok" );
- TBool isFound = EFalse;
- TInt err = KErrNone;
- while ( !isFound && !err )
- {
- if ( !aDeviceName.CompareF( entry().iName ) )
- {
- LOG_D( "CBTServiceSearcher: Name match" );
- isFound = ETrue;
- }
- else
- {
- LOG_D( "CBTServiceSearcher: Not match - getting next" );
- err = hr.Next( entry );
- }
- }
- CleanupStack::PopAndDestroy( 2 ); // hr, socketServ
-
- iStatusObserver = &aObserverRequestStatus;
-
- if ( isFound )
- {
- TInquirySockAddr& sa = TInquirySockAddr::Cast( entry().iAddr );
- iResponse().SetDeviceAddress( sa.BTAddr() );
- iResponse().SetDeviceName( entry().iName );
- TBTDeviceClass deviceClass( sa.MajorServiceClass(),
- sa.MajorClassOfDevice(),
- sa.MinorClassOfDevice() );
- iResponse().SetDeviceClass( deviceClass );
- User::RequestComplete( iStatusObserver, KErrNone );
- }
-
- else
- {
- LOG_E( "CBTServiceSearcher: Device not found! Can't connect!" );
- User::RequestComplete( iStatusObserver, err );
- }
- }
-
-// ----------------------------------------------------------------------------
-// CBTServiceSearcher::FindServiceL()
-// Find a service on the specified device.
-// ----------------------------------------------------------------------------
-//
-void CBTServiceSearcher::FindServiceL( const TBTDevAddr& aDeviceAddress,
- TRequestStatus& aObserverRequestStatus )
- {
- iResponse().SetDeviceAddress( aDeviceAddress );
- if ( !iResponse().IsValidBDAddr() )
- {
- User::Leave( KErrArgument );
- }
- iHasFoundService = EFalse;
-
- // delete any existing agent and search pattern
- delete iSdpSearchPattern;
- iSdpSearchPattern = NULL;
-
- delete iAgent;
- iAgent = NULL;
-
- iAgent = CSdpAgent::NewL(*this, BTDevAddr());
-
- iSdpSearchPattern = CSdpSearchPattern::NewL();
-
- iSdpSearchPattern->AddL( ServiceClass() );
- // return code is the position in the list that the UUID is inserted at
- // and is intentionally ignored
-
- iAgent->SetRecordFilterL( *iSdpSearchPattern );
-
- iStatusObserver = &aObserverRequestStatus;
-
- iAgent->NextRecordRequestL();
- }
-
-// ----------------------------------------------------------------------------
-// CBTServiceSearcher::NextRecordRequestComplete()
-// Process the result of the next record request.
-// ----------------------------------------------------------------------------
-//
-void CBTServiceSearcher::NextRecordRequestComplete(
- TInt aError,
- TSdpServRecordHandle aHandle,
- TInt aTotalRecordsCount)
- {
- TRAPD( error,
- NextRecordRequestCompleteL( aError, aHandle, aTotalRecordsCount );
- );
-
- if ( error != KErrNone )
- {
- Panic( EBTServiceSearcherNextRecordRequestComplete );
- }
- }
-
-// ----------------------------------------------------------------------------
-// CBTServiceSearcher::NextRecordRequestCompleteL()
-// Process the result of the next record request.
-// ----------------------------------------------------------------------------
-//
-void CBTServiceSearcher::NextRecordRequestCompleteL(
- TInt aError,
- TSdpServRecordHandle aHandle,
- TInt aTotalRecordsCount )
- {
- if ( aError == KErrEof )
- {
- Finished();
- return;
- }
-
- if ( aError != KErrNone )
- {
- LOGFMT_E("CBTServiceSearcher: NextRecordRequestCompleteL: %d", aError );
- Finished( aError );
- return;
- }
-
- if ( aTotalRecordsCount == 0 )
- {
- LOG_I("CBTServiceSearcher: NextRecordRequestCompleteL: No records found");
- Finished( KErrNotFound );
- return;
- }
-
- // Request its attributes
- iAgent->AttributeRequestL( aHandle, KSdpAttrIdProtocolDescriptorList );
- }
-
-// ----------------------------------------------------------------------------
-// CBTServiceSearcher::AttributeRequestResult()
-// Process the next attribute requested.
-// ----------------------------------------------------------------------------
-//
-void CBTServiceSearcher::AttributeRequestResult(
- TSdpServRecordHandle aHandle,
- TSdpAttributeID aAttrID,
- CSdpAttrValue* aAttrValue )
- {
- TRAPD( error,
- AttributeRequestResultL( aHandle, aAttrID, aAttrValue );
- );
- if ( error != KErrNone )
- {
- Panic( EBTServiceSearcherAttributeRequestResult );
- }
-
- // Delete obsolete local atribute pointer.
- delete aAttrValue;
- }
-
-// ----------------------------------------------------------------------------
-// CBTServiceSearcher::AttributeRequestResultL()
-// Process the next attribute requested.
-// ----------------------------------------------------------------------------
-//
-void CBTServiceSearcher::AttributeRequestResultL(
- TSdpServRecordHandle /*aHandle*/,
- TSdpAttributeID aAttrID,
- CSdpAttrValue* aAttrValue )
- {
- __ASSERT_ALWAYS( aAttrID == KSdpAttrIdProtocolDescriptorList,
- User::Leave( KErrNotFound ) );
-
- TSdpAttributeParser parser( ProtocolList(), *this );
-
- // Validate the attribute value, and extract the RFCOMM channel
- aAttrValue->AcceptVisitorL( parser );
-
- if ( parser.HasFinished() )
- {
- // Found a suitable record so change state
- iHasFoundService = ETrue;
- }
- }
-
-// -----------------------------------------------------------------------------
-// CBTServiceSearcher::AttributeRequestComplete()
-// Process the attribute request completion.
-// -----------------------------------------------------------------------------
-//
-void CBTServiceSearcher::AttributeRequestComplete( TSdpServRecordHandle aHandle,
- TInt aError )
- {
- TRAPD( error,
- AttributeRequestCompleteL( aHandle, aError );
- );
- if ( error != KErrNone )
- {
- Panic( EBTServiceSearcherAttributeRequestComplete );
- }
- }
-
-// ----------------------------------------------------------------------------
-// CBTServiceSearcher::AttributeRequestCompleteL()
-// Process the attribute request completion.
-// ----------------------------------------------------------------------------
-//
-void CBTServiceSearcher::AttributeRequestCompleteL( TSdpServRecordHandle
- /*aHandle*/,
- TInt aError )
- {
- if ( aError != KErrNone )
- {
- LOGFMT_W("CBTServiceSearcher::AttributeRequestCompleteL: %d", aError);
- }
- else
- {
- // done with attributes of this service record, request next
- iAgent->NextRecordRequestL();
- }
- }
-
-// ----------------------------------------------------------------------------
-// CBTServiceSearcher::Finished()
-// The search has finished and notify the observer
-// that the process is complete.
-// ----------------------------------------------------------------------------
-//
-void CBTServiceSearcher::Finished( TInt aError /* default = KErrNone */ )
- {
- if ( aError == KErrNone && !HasFoundService() )
- {
- aError = KErrNotFound;
- }
- User::RequestComplete( iStatusObserver, aError );
- }
-
-// ----------------------------------------------------------------------------
-// CBTServiceSearcher::HasFinishedSearching()
-// Is the instance still wanting to search.
-// ----------------------------------------------------------------------------
-//
-TBool CBTServiceSearcher::HasFinishedSearching() const
- {
- return EFalse;
- }
-
-// ----------------------------------------------------------------------------
-// CBTServiceSearcher::BTDevAddr()
-// Returns the bluetooth device address.
-// ----------------------------------------------------------------------------
-//
-const TBTDevAddr& CBTServiceSearcher::BTDevAddr()
- {
- return iResponse().BDAddr();
- }
-
-// ----------------------------------------------------------------------------
-// CBTServiceSearcher::ResponseParams()
-// Returns information about the device selected by the user.
-// ----------------------------------------------------------------------------
-//
-const TBTDeviceResponseParams& CBTServiceSearcher::ResponseParams()
- {
- return iResponse();
- }
-
-// ----------------------------------------------------------------------------
-// CBTServiceSearcher::HasFoundService()
-// True if a service has been found.
-// ----------------------------------------------------------------------------
-//
-TBool CBTServiceSearcher::HasFoundService() const
- {
- return iHasFoundService;
- }
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/src/messageservicesearcher.cpp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,183 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Message service searcher.
-*
-*/
-
-
-// INCLUDE FILES
-#include <bt_sock.h>
-
-#include "messageservicesearcher.h"
-#include "btservicesearcher.pan"
-
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// TSdpAttributeParser::SSdpAttributeNode[]
-// Construct a TSdpAttributeParser.
-// -----------------------------------------------------------------------------
-//
-static const TSdpAttributeParser::SSdpAttributeNode gSerialPortProtocolArray[] =
- {
- { TSdpAttributeParser::ECheckType, ETypeDES },
- { TSdpAttributeParser::ECheckType, ETypeDES },
- { TSdpAttributeParser::ECheckValue, ETypeUUID, KL2CAP },
- { TSdpAttributeParser::ECheckEnd },
- { TSdpAttributeParser::ECheckType, ETypeDES },
- { TSdpAttributeParser::ECheckValue, ETypeUUID, KRFCOMM }, // KRFCOMM defined in bt_sock.h
- { TSdpAttributeParser::EReadValue, ETypeUint, KRfcommChannel }, // KRfcommChannel is custom key value used in FoundElementL. If there were more than one value to be read, the key value would be usefull
- { TSdpAttributeParser::ECheckEnd },
- { TSdpAttributeParser::ECheckEnd },
- { TSdpAttributeParser::EFinished }
- };
-
-// ----------------------------------------------------------------------------
-// TStaticArrayC
-// Provides a type and size, safe method of using static arrays.
-// ----------------------------------------------------------------------------
-//
-static const TStaticArrayC<TSdpAttributeParser
-::SSdpAttributeNode> gSerialPortProtocolList = CONSTRUCT_STATIC_ARRAY_C(
- gSerialPortProtocolArray );
-
-// ----------------------------------------------------------------------------
-// CMessageServiceSearcher::NewL()
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-CMessageServiceSearcher* CMessageServiceSearcher::NewL()
- {
- CMessageServiceSearcher* self = CMessageServiceSearcher::NewLC();
- CleanupStack::Pop( self );
- return self;
- }
-
-// ----------------------------------------------------------------------------
-// CMessageServiceSearcher::NewLC()
-// Two-phased constructor.
-// ----------------------------------------------------------------------------
-//
-CMessageServiceSearcher* CMessageServiceSearcher::NewLC()
- {
- CMessageServiceSearcher* self = new (ELeave) CMessageServiceSearcher();
- CleanupStack::PushL( self );
- self->ConstructL();
- return self;
- }
-
-// ----------------------------------------------------------------------------
-// CMessageServiceSearcher::CMessageServiceSearcher()
-// Construcor.
-// ----------------------------------------------------------------------------
-//
-CMessageServiceSearcher::CMessageServiceSearcher()
-: CBTServiceSearcher(),
- iServiceClass( KServiceClass )
- {
- }
-
-// ----------------------------------------------------------------------------
-// CMessageServiceSearcher::~CMessageServiceSearcher()
-// Destructor.
-// ----------------------------------------------------------------------------
-//
-CMessageServiceSearcher::~CMessageServiceSearcher()
- {
- iPortNumbers.Close();
- }
-
-// ----------------------------------------------------------------------------
-// CMessageServiceSearcher::ConstructL()
-// Symbian 2nd phase constructor can leave.
-// ----------------------------------------------------------------------------
-//
-void CMessageServiceSearcher::ConstructL()
- {
- // no implementation required
- }
-
-// ----------------------------------------------------------------------------
-// CMessageServiceSearcher::ServiceClass()
-// The service class to search.
-// ----------------------------------------------------------------------------
-//
-const TUUID& CMessageServiceSearcher::ServiceClass() const
- {
- return iServiceClass;
- }
-
-// ----------------------------------------------------------------------------
-// CMessageServiceSearcher::ProtocolList()
-// The list of Protocols required by the service.
-// ----------------------------------------------------------------------------
-//
-const TSdpAttributeParser::TSdpAttributeList& CMessageServiceSearcher
-::ProtocolList() const
- {
- return gSerialPortProtocolList;
- }
-
-// ----------------------------------------------------------------------------
-// CMessageServiceSearcher::FoundElementL()
-// Read the data element.
-// ----------------------------------------------------------------------------
-//
-void CMessageServiceSearcher::FoundElementL( TInt aKey, CSdpAttrValue& aValue )
- {
- __ASSERT_ALWAYS( aKey == static_cast<TInt>( KRfcommChannel ),
- Panic( EBTServiceSearcherProtocolRead ) );
- AppendPort( aValue.Uint() );
- }
-
-// ----------------------------------------------------------------------------
-// CMessageServiceSearcher::Port()
-// Port connection on the remote machine.
-// ----------------------------------------------------------------------------
-//
-TInt CMessageServiceSearcher::Port( TInt aIndex )
- {
- if ( aIndex < 0 || aIndex >= iPortNumbers.Count() )
- {
- return KErrNotFound;
- }
- return iPortNumbers[aIndex];
- }
-
-// ----------------------------------------------------------------------------
-// CMessageServiceSearcher::AppendPort()
-// Adds a new port number to the port number array. If the port number
-// already exists in the array a duplicate is not added.
-// ----------------------------------------------------------------------------
-//
-void CMessageServiceSearcher::AppendPort( TInt aPort )
- {
- if ( iPortNumbers.Find( aPort ) == KErrNotFound )
- {
- iPortNumbers.Append( aPort );
- }
- }
-
-// ----------------------------------------------------------------------------
-// CMessageServiceSearcher::ServiceCount()
-// The amount of requested services found from the remote machine.
-// ----------------------------------------------------------------------------
-//
-TInt CMessageServiceSearcher::ServiceCount()
- {
- return iPortNumbers.Count();
- }
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/src/sdpattributeparser.cpp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,231 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Reads selected parts of SDP attribute values.
-*
-*/
-
-
-// INCLUDE FILES
-#include <bt_sock.h>
-
-#include "sdpattributeparser.h"
-#include "sdpattributeparser.pan"
-#include "sdpattributenotifier.h"
-
-// ============================ MEMBER FUNCTIONS ==============================
-
-// ----------------------------------------------------------------------------
-// TSdpAttributeParser::TSdpAttributeParser()
-// Construct a TSdpAttributeParser.
-// ----------------------------------------------------------------------------
-//
-
-TSdpAttributeParser::TSdpAttributeParser(
- TSdpAttributeList& aNodeList,
- MSdpAttributeNotifier& aObserver
-)
-: iObserver( aObserver ),
- iNodeList( aNodeList ),
- iCurrentNodeIndex( 0 )
- {
- // no implementation required
- }
-
-// ----------------------------------------------------------------------------
-// TSdpAttributeParser::HasFinished()
-// Check if parsing processed the whole list.
-// ----------------------------------------------------------------------------
-//
-TBool TSdpAttributeParser::HasFinished() const
- {
- return CurrentNode().iCommand == EFinished;
- }
-
-// ----------------------------------------------------------------------------
-// TSdpAttributeParser::VisitAttributeValueL()
-// Process a data element.
-// ----------------------------------------------------------------------------
-//
-void TSdpAttributeParser::VisitAttributeValueL( CSdpAttrValue& aValue,
- TSdpElementType aType )
- {
- switch ( CurrentNode().iCommand )
- {
- case ECheckType:
- CheckTypeL( aType );
- break;
-
- case ECheckValue:
- CheckTypeL( aType );
- CheckValueL( aValue );
- break;
-
- case ECheckEnd:
- User::Leave( KErrGeneral ); //list element contains too many items
- break;
-
- case ESkip:
- break; // no checking required
-
- case EReadValue:
- CheckTypeL( aType );
- ReadValueL( aValue );
- break;
-
- case EFinished:
- User::Leave( KErrGeneral ); // element is after
- return; // value should have ended
-
- default:
- Panic( ESdpAttributeParserInvalidCommand );
- }
-
- AdvanceL();
- }
-
-// ----------------------------------------------------------------------------
-// TSdpAttributeParser::StartListL()
-// Process the start of a data element list.
-// ----------------------------------------------------------------------------
-//
-void TSdpAttributeParser::StartListL( CSdpAttrValueList& /*aList*/ )
- {
- // no checks done here
- }
-
-// ----------------------------------------------------------------------------
-// TSdpAttributeParser::EndListL()
-// Process the end of a data element list.
-// ----------------------------------------------------------------------------
-//
-void TSdpAttributeParser::EndListL()
- {
- // check we are at the end of a list
- if ( CurrentNode().iCommand != ECheckEnd )
- {
- User::Leave( KErrGeneral );
- }
-
- AdvanceL();
- }
-
-// ----------------------------------------------------------------------------
-// TSdpAttributeParser::CheckTypeL()
-// Check the type of the current node is the same as the specified type.
-// ----------------------------------------------------------------------------
-//
-void TSdpAttributeParser::CheckTypeL( TSdpElementType aElementType ) const
- {
- if ( CurrentNode().iType != aElementType )
- {
- User::Leave( KErrGeneral );
- }
- }
-
-// ----------------------------------------------------------------------------
-// TSdpAttributeParser::CheckValueL()
-// Check the value of the current node is the same as the specified type.
-// ----------------------------------------------------------------------------
-//
-void TSdpAttributeParser::CheckValueL( CSdpAttrValue& aValue ) const
- {
- switch ( aValue.Type() )
- {
- case ETypeNil:
- Panic( ESdpAttributeParserNoValue );
- break;
-
- case ETypeUint:
- if ( aValue.Uint() != ( TUint )CurrentNode().iValue )
- {
- User::Leave( KErrArgument );
- }
- break;
-
- case ETypeInt:
- if ( aValue.Int() != CurrentNode().iValue )
- {
- User::Leave( KErrArgument );
- }
- break;
-
- case ETypeBoolean:
- if ( aValue.Bool() != CurrentNode().iValue )
- {
- User::Leave( KErrArgument );
- }
- break;
-
- case ETypeUUID:
- if ( aValue.UUID() != TUUID( CurrentNode().iValue ) )
- {
- User::Leave( KErrArgument );
- }
- break;
-
- // these are lists, so have to check contents
- case ETypeDES:
- case ETypeDEA:
- Panic( ESdpAttributeParserValueIsList );
- break;
-
- // these aren't supported - use EReadValue and leave on error
- //case ETypeString:
- //case ETypeURL:
- //case ETypeEncoded:
- default:
- Panic( ESdpAttributeParserValueTypeUnsupported );
- break;
- }
- }
-
-// ----------------------------------------------------------------------------
-// TSdpAttributeParser::ReadValueL()
-// Pass the data element value to the observer.
-// ----------------------------------------------------------------------------
-//
-void TSdpAttributeParser::ReadValueL( CSdpAttrValue& aValue ) const
- {
- iObserver.FoundElementL( CurrentNode().iValue, aValue );
- }
-
-// ----------------------------------------------------------------------------
-// TSdpAttributeParser::CurrentNode()
-// Get the current node.
-// ----------------------------------------------------------------------------
-//
-const TSdpAttributeParser::SSdpAttributeNode& TSdpAttributeParser
-::CurrentNode() const
- {
- return iNodeList[iCurrentNodeIndex];
- }
-
-// ----------------------------------------------------------------------------
-// TSdpAttributeParser::AdvanceL()
-// Advance to the next node.
-// ----------------------------------------------------------------------------
-//
-void TSdpAttributeParser::AdvanceL()
- {
- // check not at end
- if ( CurrentNode().iCommand == EFinished )
- {
- User::Leave( KErrEof );
- }
-
- // move to the next item
- ++iCurrentNodeIndex;
- }
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/src/socketsreader.cpp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Reads from socket.
-*
-*/
-
-
-// INCLUDE FILES
-#include "BtSerialEngine.pan"
-#include "socketsreader.h"
-#include "SocketObserver.h"
-
-// -----------------------------------------------------------------------------
-CSocketsReader* CSocketsReader::NewL( MSocketObserver& aEngineNotifier,
- RSocket& aSocket )
- {
- CSocketsReader* self = new ( ELeave ) CSocketsReader( aEngineNotifier,
- aSocket );
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop( self );
- return self;
- }
-
-// -----------------------------------------------------------------------------
-CSocketsReader::CSocketsReader( MSocketObserver& aObserver,
- RSocket& aSocket )
-: CActive( EPriorityStandard ),
- iSocket( aSocket ),
- iObserver( aObserver )
- {
- // No implementation required
- }
-
-// -----------------------------------------------------------------------------
-void CSocketsReader::ConstructL()
- {
- CActiveScheduler::Add( this );
- }
-
-// -----------------------------------------------------------------------------
-CSocketsReader::~CSocketsReader()
- {
- Cancel();
- }
-
-// -----------------------------------------------------------------------------
-void CSocketsReader::DoCancel()
- {
- // Cancel asychronous read request
- iSocket.CancelRead();
- }
-
-// -----------------------------------------------------------------------------
-void CSocketsReader::RunL()
- {
- switch ( iStatus.Int() )
- {
- case KErrNone:
- iObserver.NewData(iBuffer);
-// IssueRead(); // Immediately start another read
- break;
- case KErrDisconnected:
- iObserver.ReportError( MSocketObserver::EDisconnected,
- iStatus.Int() );
- break;
- default:
- iObserver.ReportError( MSocketObserver::EGeneralReadError,
- iStatus.Int() );
- break;
- }
- }
-
-// -----------------------------------------------------------------------------
-void CSocketsReader::IssueRead()
- {
- // Initiate a new read from socket into iBuffer
- __ASSERT_ALWAYS( !IsActive(), Panic(EBTSerialEngineReadSocketBadState) );
- iSocket.RecvOneOrMore( iBuffer, 0, iStatus, iLen );
- SetActive();
- }
-
-// -----------------------------------------------------------------------------
-void CSocketsReader::ReadAsync()
- {
- // Initiate a new read from socket into iBuffer
- if (!IsActive())
- {
- IssueRead();
- }
- }
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/src/socketswriter.cpp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,171 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Writes to socket.
-*
-*/
-
-
-// INCLUDE FILES
-#include "socketswriter.h"
-#include "timeouttimer.h"
-#include "BtSerialEngine.pan"
-#include "SocketObserver.h"
-#include "HtiBtEngineLogging.h"
-
-// STATIC MEMBER INITIALISATIONS
-const TInt KTimeOut = 10 * 1000 * 1000; // 10 seconds time-out
-
-// ========================= MEMBER FUNCTIONS ==================================
-
-// -----------------------------------------------------------------------------
-CSocketsWriter* CSocketsWriter::NewL( MSocketObserver& aEngineNotifier,
- RSocket& aSocket )
- {
- CSocketsWriter* self = new ( ELeave ) CSocketsWriter( aEngineNotifier,
- aSocket );
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop( self );
- return self;
- }
-
-// -----------------------------------------------------------------------------
-CSocketsWriter::CSocketsWriter( MSocketObserver& aEngineNotifier,
- RSocket& aSocket )
-: CActive( EPriorityStandard ),
- iSocket( aSocket ),
- iObserver( aEngineNotifier )
- {
- // No implementation required
- }
-
-// -----------------------------------------------------------------------------
-void CSocketsWriter::ConstructL()
- {
- CActiveScheduler::Add( this );
- iTimeOut = KTimeOut;
- iTimer = CTimeOutTimer::NewL( CActive::EPriorityUserInput, *this );
- iWriteStatus = EIdle;
- }
-
-// -----------------------------------------------------------------------------
-CSocketsWriter::~CSocketsWriter()
- {
- CancelSending();
- delete iTimer;
- }
-
-// -----------------------------------------------------------------------------
-void CSocketsWriter::DoCancel()
- {
- // Cancel asychronous write request
- iSocket.CancelWrite();
- iTimer->Cancel();
- iWriteStatus = EIdle;
- }
-
-// -----------------------------------------------------------------------------
-void CSocketsWriter::RunL()
- {
- iTimer->Cancel();
-
- // Active object request complete handler
- if ( iStatus == KErrNone )
- {
- switch ( iWriteStatus )
- {
- // Character has been written to socket
- case ESending:
- SendNextPacket();
- break;
- default:
- LOGFMT_E( "CSocketsWriter: Bad write status: %d", iWriteStatus )
- Panic( EBTSerialEngineWriteSocketBadState );
- break;
- };
- }
- else
- {
- iWriteStatus = EIdle;
- iWriteBuffer.Zero();
- iTransferBuffer.Zero();
- iObserver.ReportError( MSocketObserver::EGeneralWriteError,
- iStatus.Int() );
- }
- }
-
-// -----------------------------------------------------------------------------
-void CSocketsWriter::TimerExpired()
- {
- Cancel();
- iWriteStatus = EIdle;
- iObserver.ReportError( MSocketObserver::ETimeOutOnWrite,
- KErrTimedOut );
- }
-
-// -----------------------------------------------------------------------------
-void CSocketsWriter::SendL(const TDesC8& aData)
- {
- if ( aData.Length() > FreeSpaceInSendBuffer() )
- User::Leave( KErrOverflow );
-
- iTransferBuffer.Append( aData );
- SendNextPacket();
- }
-
-// -----------------------------------------------------------------------------
-TInt CSocketsWriter::FreeSpaceInSendBuffer()
- {
- return iTransferBuffer.MaxSize() - iTransferBuffer.Size();
- }
-
-// -----------------------------------------------------------------------------
-TInt CSocketsWriter::SendBufferMaxSize()
- {
- return iTransferBuffer.MaxLength();
- }
-
-// -----------------------------------------------------------------------------
-void CSocketsWriter::SendNextPacket()
- {
- if ( IsActive() )
- {
- return; // already sending
- }
- if ( iTransferBuffer.Length() > 0 )
- {
- // Move data from transfer buffer to actual write buffer
- iWriteBuffer.Copy(iTransferBuffer.Left(iWriteBuffer.MaxLength()));
- iTransferBuffer.Delete(0, iWriteBuffer.MaxLength());
- iSocket.Write( iWriteBuffer, iStatus ); // Initiate actual write
-
- iWriteStatus = ESending;
- iTimer->After( iTimeOut );
- SetActive();
- }
- else
- {
- iWriteStatus = EIdle;
- iObserver.AllBufferedDataSent();
- }
- }
-
-// -----------------------------------------------------------------------------
-void CSocketsWriter::CancelSending()
- {
- Cancel();
- iWriteBuffer.Zero();
- iTransferBuffer.Zero();
- }
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/BtEngine/src/timeouttimer.cpp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Timer.
-*
-*/
-
-
-// INCLUDE FILES
-#include "timeouttimer.h"
-#include "timeoutnotifier.h"
-#include "HtiBtEngineLogging.h"
-
-// -----------------------------------------------------------------------------
-CTimeOutTimer* CTimeOutTimer::NewL( const TInt aPriority,
- MTimeOutNotifier& aTimeOutNotify )
- {
- CTimeOutTimer* self = new ( ELeave ) CTimeOutTimer( aPriority,
- aTimeOutNotify );
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop( self );
- return self;
- }
-
-// -----------------------------------------------------------------------------
-CTimeOutTimer::CTimeOutTimer( const TInt aPriority,
- MTimeOutNotifier& aObserver )
-: CTimer( aPriority ), iObserver( aObserver )
- {
- // No implementation required
- }
-
-// -----------------------------------------------------------------------------
-void CTimeOutTimer::ConstructL()
- {
- CTimer::ConstructL();
- CActiveScheduler::Add( this );
- }
-
-// -----------------------------------------------------------------------------
-CTimeOutTimer::~CTimeOutTimer()
- {
- // No implementation required
- }
-
-// -----------------------------------------------------------------------------
-void CTimeOutTimer::RunL()
- {
- // Timer request has completed, so notify the timer's owner
- if ( iStatus == KErrNone )
- {
- iObserver.TimerExpired();
- }
- else
- {
- LOGFMT_E("CTimeOutTimer: bad completion code: %d", iStatus.Int())
- }
- }
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/HtiBtCommEcomPlugin/data/200212CB.rss Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Resource definitions for HtiBtComm ECOM plugin.
-*
-*/
-
-
-// INCLUDES
-#include <ecom/registryinfo.rh>
-
-
-// RESOURCE DEFINITIONS
-RESOURCE REGISTRY_INFO theInfo
- {
- // UID for the DLL
- dll_uid = 0x200212CB;
- // Declare array of interface info
- interfaces =
- {
- INTERFACE_INFO
- {
- // UID of interface that is implemented
- interface_uid = 0x1020DEB8;
- implementations =
- {
- IMPLEMENTATION_INFO
- {
- implementation_uid = 0x200212CC;
- version_no = 1;
- display_name = "Bt serial comm";
- default_data = "BTSERIAL";
- opaque_data = "";
- }
- };
- }
- };
- }
-
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/HtiBtCommEcomPlugin/inc/HtiBtCommEcomPlugin.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: ECOM plugin to communicate over BT serial port
-*
-*/
-
-
-#ifndef CHTIBTCOMMECOMPLUGIN_H
-#define CHTIBTCOMMECOMPLUGIN_H
-
-class CBtSerialClient;
-
-// INCLUDES
-#include <c32comm.h>
-#include <HtiCommPluginInterface.h> // defined in HtiFramework project
-
-#include "HtiBtCommInterface.h" // RHtiBtCommInterface
-
-// FORWARD DECLARATIONS
-class CHtiCfg;
-
-// CLASS DECLARATION
-/**
-* ECOM plugin module for communicating with PC using serial port.
-*
-*/
-class CHtiBtCommEcomPlugin :
- public CHTICommPluginInterface
- {
-public:
-
- /**
- * Create instance of plugin.
- * @return Connected plugin instance.
- */
- static CHtiBtCommEcomPlugin* NewL();
-
- /**
- * Destructor
- */
- ~CHtiBtCommEcomPlugin();
-
-public: // CHTICommPluginInterface interface implementation
-
- /**
- * Receive data from Bluetooth.
- * The size of supplied buffer must equal to size given by GetBufferSize.
- * The number of received bytes may be anything between 1 and GetBufferSize.
- *
- * @param aRawdataBuf Buffer where the result is written
- * @param aStatus Request status
- */
- void Receive( TDes8& aRawdataBuf, TRequestStatus& aStatus );
-
- /**
- * Send data to Bluetooth. The size of data must not exceed GetBufferSize.
- * @param aRawdataBuf Buffer where the data is read from.
- * @param aStatus Request status
- */
- void Send( const TDesC8& aRawdataBuf, TRequestStatus& aStatus );
-
- /**
- * Cancel read operation
- */
- void CancelReceive();
-
- /**
- * Cancel send operation
- */
- void CancelSend();
-
- /**
- * Return required buffer size for Send operation.
- */
- TInt GetSendBufferSize();
-
- /**
- * Return required buffer size for Receive operation.
- */
- TInt GetReceiveBufferSize();
-
-private:
-
- /**
- * Constructor of this plugin.
- */
- CHtiBtCommEcomPlugin();
-
- /**
- * Second phase construction. Connects the Bluetooth.
- */
- void ConstructL();
-
- /**
- * Load configuration file.
- */
- void LoadConfigL();
-
- /**
- * Read and parse the configuration values.
- */
- void ReadConfig();
-
- /**
- * Parse the possible port (channel) number value from name or address param
- */
- TInt ParsePortNumber();
-
- /**
- * StorePortNumberL()
- * Store the given port number to configuration file
- * @param aPortNumber the port number to store
- */
- void StorePortNumberL( TInt aPortNumber );
-
-private: // Data
-
- RHtiBtCommInterface iBtCommInterface;
-
- CHtiCfg* iCfg;
- HBufC8* iBtDeviceNameOrAddress;
- TInt iPort;
-
- };
-
-#endif // CHTIBTCOMMECOMPLUGIN_H
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/HtiBtCommEcomPlugin/src/HtiBtCommEcomPlugin.cpp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,277 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: ECOM plugin for communication over serial port
-*
-*/
-
-
-// INCLUDE FILES
-#include <badesca.h>
-#include <f32file.h>
-
-#include "HtiBtCommEcomPlugin.h"
-#include "BtSerialClient.h"
-#include <HtiCfg.h>
-#include <HtiLogging.h>
-
-// CONSTANTS
-_LIT( KHtiCfgPath, "\\" ); // root of drive
-_LIT( KHtiBtCommCfg, "HTIBtComm.cfg" );
-_LIT8( KBtDeviceAddress, "BtDeviceAddress" );
-_LIT8( KBtDeviceName, "BtDeviceName" );
-
-
-const TInt KBtAddressHexStringLength = 12; // 6 bytes
-const TUint KPortSeparatorChar = 30; // ASCII control char "record separator"
-
-// ----------------------------------------------------------------------------
-CHtiBtCommEcomPlugin* CHtiBtCommEcomPlugin::NewL()
- {
- HTI_LOG_FUNC_IN( "CHtiBtCommEcomPlugin::NewL" );
- CHtiBtCommEcomPlugin* plugin = new (ELeave) CHtiBtCommEcomPlugin();
- CleanupStack::PushL( plugin );
- plugin->ConstructL();
- CleanupStack::Pop( plugin );
- HTI_LOG_FUNC_OUT( "CHtiBtCommEcomPlugin::NewL" );
- return plugin;
- }
-
-// ----------------------------------------------------------------------------
-CHtiBtCommEcomPlugin::~CHtiBtCommEcomPlugin()
- {
- HTI_LOG_FUNC_IN( "CHtiBtCommEcomPlugin::~CHtiBtCommEcomPlugin" );
- iBtCommInterface.CancelReceive();
- iBtCommInterface.CancelSend();
- iBtCommInterface.Close();
- delete iBtDeviceNameOrAddress;
- delete iCfg;
- HTI_LOG_FUNC_OUT( "CHtiBtCommEcomPlugin::~CHtiBtCommEcomPlugin" );
- }
-
-// ----------------------------------------------------------------------------
-CHtiBtCommEcomPlugin::CHtiBtCommEcomPlugin():iPort( -1 )
- {
- }
-
-// ----------------------------------------------------------------------------
-void CHtiBtCommEcomPlugin::ConstructL()
- {
- TRAPD( err, LoadConfigL() );
- if ( err == KErrNone )
- {
- ReadConfig();
- }
- else
- {
- TBufC8<1> emptyBuf( KNullDesC8 );
- iBtDeviceNameOrAddress = emptyBuf.AllocL();
- iPort = KErrNotFound;
- }
- // May take long!
- User::LeaveIfError( iBtCommInterface.Connect(
- *iBtDeviceNameOrAddress, iPort ) );
-
- // Get the connected service port number (channel) and store it if needed
- TInt connectedPort = iBtCommInterface.GetPortNumber();
- HTI_LOG_FORMAT( "Connected port number = %d", connectedPort );
- if ( connectedPort != iPort && connectedPort >= 0 )
- {
- TRAP( err, StorePortNumberL( connectedPort ) ); // ignore error
- }
- }
-
-// ----------------------------------------------------------------------------
-void CHtiBtCommEcomPlugin::Receive( TDes8& aRawdataBuf,
- TRequestStatus& aStatus )
- {
- iBtCommInterface.Receive( aRawdataBuf, aStatus );
- }
-
-// ----------------------------------------------------------------------------
-void CHtiBtCommEcomPlugin::Send( const TDesC8& aRawdataBuf,
- TRequestStatus& aStatus )
- {
- iBtCommInterface.Send( aRawdataBuf, aStatus );
- }
-
-// ----------------------------------------------------------------------------
-void CHtiBtCommEcomPlugin::CancelReceive()
- {
- iBtCommInterface.CancelReceive();
- }
-
-// ----------------------------------------------------------------------------
-void CHtiBtCommEcomPlugin::CancelSend()
- {
- iBtCommInterface.CancelSend();
- }
-
-// ----------------------------------------------------------------------------
-TInt CHtiBtCommEcomPlugin::GetSendBufferSize()
- {
- return iBtCommInterface.GetSendBufferSize();
- }
-
-// ----------------------------------------------------------------------------
-TInt CHtiBtCommEcomPlugin::GetReceiveBufferSize()
- {
- return iBtCommInterface.GetReceiveBufferSize();
- }
-
-// ----------------------------------------------------------------------------
-void CHtiBtCommEcomPlugin::LoadConfigL()
- {
- HTI_LOG_FUNC_IN( "CHtiBtCommEcomPlugin::LoadConfigL" );
- iCfg = CHtiCfg::NewL();
- iCfg->LoadCfgL( KHtiCfgPath, KHtiBtCommCfg );
- HTI_LOG_TEXT( "cfg file loaded" );
- HTI_LOG_FUNC_OUT( "CHtiBtCommEcomPlugin::LoadConfigL" );
- }
-
-// ----------------------------------------------------------------------------
-void CHtiBtCommEcomPlugin::ReadConfig()
- {
- HTI_LOG_FUNC_IN( "CHtiBtCommEcomPlugin::ReadConfig" );
- // First try to get address - if found and length is correct it is used
- TRAPD( paramErr, iBtDeviceNameOrAddress = iCfg->GetParameterL(
- KBtDeviceAddress ).AllocL() );
-
- if ( paramErr == KErrNone )
- {
- TInt port = ParsePortNumber();
- if ( port >= 0 ) iPort = port;
- else iPort = KErrNotFound;
- }
-
- if ( paramErr ||
- iBtDeviceNameOrAddress->Length() != KBtAddressHexStringLength )
- {
- HTI_LOG_TEXT( "BT address not defined or not valid - getting name" );
- delete iBtDeviceNameOrAddress;
- iBtDeviceNameOrAddress = NULL;
- // Address was not found - try to get name.
- TRAP( paramErr, iBtDeviceNameOrAddress = iCfg->GetParameterL(
- KBtDeviceName ).AllocL() );
- if ( paramErr )
- {
- HTI_LOG_TEXT( "BT name not defined either" );
- TBufC8<1> emptyBuf( KNullDesC8 );
- iBtDeviceNameOrAddress = emptyBuf.AllocL();
- iPort = KErrNotFound;
- }
- else
- {
- TInt port = ParsePortNumber();
- if ( port >= 0 ) iPort = port;
- else iPort = KErrNotFound;
- }
- }
- HTI_LOG_TEXT( "BT device name or address:" );
- HTI_LOG_DES( *iBtDeviceNameOrAddress );
- HTI_LOG_FORMAT( "Port number: %d", iPort );
- HTI_LOG_FUNC_OUT( "CHtiBtCommEcomPlugin::ReadConfig" );
- }
-
-// ----------------------------------------------------------------------------
-TInt CHtiBtCommEcomPlugin::ParsePortNumber()
- {
- HTI_LOG_FUNC_IN( "CHtiBtCommEcomPlugin::ParsePortNumber" );
- TInt port = KErrNotFound;
- TInt separatorIndex = iBtDeviceNameOrAddress->LocateReverse(
- TChar( KPortSeparatorChar ) );
- if ( separatorIndex != KErrNotFound )
- {
- TPtrC8 value = iBtDeviceNameOrAddress->Right(
- iBtDeviceNameOrAddress->Length() - ( separatorIndex + 1 ) );
- TLex8 lex( value );
- lex.Val( port );
- // Strip away the port number
- iBtDeviceNameOrAddress->Des().SetLength( separatorIndex );
- }
- HTI_LOG_FORMAT( "ParsePortNumber returning %d", port );
- HTI_LOG_FUNC_OUT( "CHtiBtCommEcomPlugin::ParsePortNumber" );
- return port;
- }
-
-// ----------------------------------------------------------------------------
-void CHtiBtCommEcomPlugin::StorePortNumberL( TInt aPortNumber )
- {
- HTI_LOG_FUNC_IN( "CHtiBtCommEcomPlugin::StorePortNumberL" );
- if ( !iCfg )
- {
- iCfg = CHtiCfg::NewL();
- }
- iCfg->LoadCfgL( KHtiCfgPath, KHtiBtCommCfg );
-
- TBool changesMade = EFalse;
-
- // Add or replace port number to address parameter if it exists
- HBufC8* value = NULL;
- TRAPD( err, value = iCfg->GetParameterL( KBtDeviceAddress ).AllocL() );
- if ( !err )
- {
- HTI_LOG_FORMAT( "Found address param (length = %d)", value->Length() );
- CleanupStack::PushL( value );
- TInt separatorIndex = value->Locate( TChar( KPortSeparatorChar ) );
- if ( separatorIndex != KErrNotFound )
- {
- HTI_LOG_FORMAT( "Separator char found from index %d", separatorIndex );
- value->Des().SetLength( separatorIndex );
- }
- value = value->ReAllocL( value->Length() + 5 );
- // The old value has been deleted by ReAllocL and new allocated,
- // so update cleanup stack.
- CleanupStack::Pop();
- CleanupStack::PushL( value );
- TPtr8 ptr = value->Des();
- ptr.Append( TChar( KPortSeparatorChar ) );
- ptr.AppendNum( aPortNumber );
- TRAP( err, iCfg->SetParameterL( KBtDeviceAddress, *value ) );
- if ( !err ) changesMade = ETrue;
- CleanupStack::PopAndDestroy(); // value
- }
-
- // Add or replace port number to name parameter if it exists
- TRAP( err, value = iCfg->GetParameterL( KBtDeviceName ).AllocL() );
- if ( !err )
- {
- HTI_LOG_FORMAT( "Found name param (length = %d)", value->Length() );
- CleanupStack::PushL( value );
- TInt separatorIndex = value->Locate( TChar( KPortSeparatorChar ) );
- if ( separatorIndex != KErrNotFound )
- {
- HTI_LOG_FORMAT( "Separator char found from index %d", separatorIndex );
- value->Des().SetLength( separatorIndex );
- }
- value = value->ReAllocL( value->Length() + 5 );
- // The old value has been deleted by ReAllocL and new allocated,
- // so update cleanup stack.
- CleanupStack::Pop();
- CleanupStack::PushL( value );
- TPtr8 ptr = value->Des();
- ptr.Append( TChar( KPortSeparatorChar ) );
- ptr.AppendNum( aPortNumber );
- TRAP( err, iCfg->SetParameterL( KBtDeviceName, *value ) );
- if ( !err ) changesMade = ETrue;
- CleanupStack::PopAndDestroy(); // value
- }
-
- if ( changesMade )
- {
- iCfg->SaveCfgL( KHtiCfgPath, KHtiBtCommCfg );
- }
- HTI_LOG_FUNC_OUT( "CHtiBtCommEcomPlugin::StorePortNumberL" );
- }
-
-// End of file
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/HtiBtCommEcomPlugin/src/proxy.cpp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: ECOM implementations in this dll
-*
-*/
-
-
-// INCLUDE FILES
-#include "HtiBtCommEcomPlugin.h"
-
-#include <e32std.h>
-#include <ecom/implementationproxy.h>
-
-
-/*---------------------------------------------------------------------------*/
-// Provides a key value pair table, this is used to identify
-// the correct construction function for the requested interface.
-const TImplementationProxy ImplementationTable[] =
- {
- IMPLEMENTATION_PROXY_ENTRY( 0x200212CC, CHtiBtCommEcomPlugin::NewL )
- };
-
-/*---------------------------------------------------------------------------*/
-// Function used to return an instance of the proxy table.
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
- {
- aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
- return ImplementationTable;
- }
-
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/HtiBtCommServer/inc/HtiBtClientServerCommon.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Global definitions for BtCommServer and client side interface.
-*
-*/
-
-
-#ifndef __HTIBTCLIENTSERVERCOMMON_H__
-#define __HTIBTCLIENTSERVERCOMMON_H__
-
-// INCLUDES
-#include <e32base.h>
-
-// CONSTANTS
-
-// The server name (and server thread name)
-_LIT( KBtCommServerName,"HtiBtCommServer" );
-
-// The version of the server
-const TUint KBtCommServerMajorVersionNumber = 1;
-const TUint KBtCommServerMinorVersionNumber = 0;
-const TUint KBtCommServerBuildVersionNumber = 0;
-
-const TInt KClientReceiveBufferMaxSize = 0x1000; // 4096 bytes
-const TInt KClientSendBufferMaxSize = 0x1000; // 4096 bytes
-
-
-// DATA TYPES
-
-// The message ID's of BtCommServer
-// from Symbian side
-enum TBtCommServerRqst
- {
- EBtCommServerConnect = 0,
- EBtCommServerRecv,
- EBtCommServerSend,
- ECancelBtCommServerRecv,
- ECancelBtCommServerSend,
- EGetServicePortNumber
- };
-
-
-// FUNCTION PROTOTYPES
-/**
-* Start HtiBtCommServer thread. This is called by client interface.
-*/
-IMPORT_C TInt StartThread();
-
-#endif // __HTIBTCLIENTSERVERCOMMON_H__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/HtiBtCommServer/inc/HtiBtCommInterface.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Client side interface to HtiBtCommServer
-*
-*/
-
-
-#ifndef __HTIBTCOMMINTERFACE_H__
-#define __HTIBTCOMMINTERFACE_H__
-
-// INCLUDES
-#include <e32test.h>
-#include <e32base.h>
-
-// CONSTANTS
-
-// MACROS
-
-// DATA TYPES
-
-// FUNCTION PROTOTYPES
-
-// FORWARD DECLARATIONS
-
-// CLASS DECLARATION
-
-/**
- * Remote interface to HtiBtCommServer.
- * HtiBtCommServer runs in separate thread, but always within the
- * client process.
- *
- * The thread is started and session to server created, when the
- * Connect is called for the first time.
- *
- * Server allows only one connection (session) at a time.
- *
- * Library: htibtcomminterface.lib
- */
-class RHtiBtCommInterface : public RSessionBase
- {
- public: // Constructor and destructor
-
- /**
- * C++ default constructor.
- */
- IMPORT_C RHtiBtCommInterface();
-
- public:
- /**
- * Connects and creates session to BtCommServer. Additionally,
- * connects to remote BT device. This may take a while
- * and may require user interaction (device selection).
- *
- * If the server is not running within this process, it is
- * started in a new thread. Note that server allows only one
- * connection (session).
- * @return Error code
- */
- IMPORT_C TInt Connect( TDesC8& aDeviceNameOrAddress, TInt aPort );
-
- /**
- * Close the session to server and wait for servers death.
- * Will disconnect the server from remote BT host, if connected.
- */
- IMPORT_C void Close();
-
- /**
- * Returns server version
- * @return Version
- */
- IMPORT_C TVersion Version() const;
-
- /**
- * Return required buffer max size for Send operation.
- */
- IMPORT_C TInt GetSendBufferSize() const;
-
- /**
- * Return required buffer max size for Receive operation.
- */
- IMPORT_C TInt GetReceiveBufferSize() const;
-
- /**
- * Receives data from BtCommServer.
- * Note: The aData buffer size must equal to GetReceiveBufferSize().
- * (server will write 1 to GetReceiveBufferSize bytes to the buffer).
- * @param aData Descriptor where data is received
- * @param aStatus Asynchronous request status
- */
- IMPORT_C void Receive( TDes8& aData,
- TRequestStatus& aStatus );
-
- /**
- * Sends data to BtCommServer.
- * Note: The aData buffer size must equal to GetSendBufferSize().
- * (server will read as much as there is data in aData. There must
- * never be more data than GetSendBufferSize. This is important to notice,
- * if HBufC is used, because its actual max size can be greater than
- * initially suggested in its construction)
- *
- * @param aData Data to be sent
- * @param aStatus Asynchronous request status
- */
- IMPORT_C void Send( const TDesC8& aData,
- TRequestStatus& aStatus );
-
-
- /**
- * Cancels pending Receive request on server.
- */
- IMPORT_C void CancelReceive();
-
- /**
- * Cancels pending Send request on server.
- */
- IMPORT_C void CancelSend();
-
- /**
- * Gets the port number of the remote service where the server is
- * connected.
- * @return Port number or KErrDisconnected if server is not connected
- */
- IMPORT_C TInt GetPortNumber() const;
-
- private:
-
- /**
- * During Connect(), connect the server
- * to remote BT host service.
- */
- TInt RHtiBtCommInterface::ConnectBt( TDesC8& aDeviceNameOrAddress,
- TInt aPort );
-
-};
-
-#endif // __HTIBTCOMMINTERFACE_H__
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/HtiBtCommServer/inc/HtiBtCommServer.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: CHtiBtCommServer declaration
-*
-*/
-
-
-#ifndef __HTIBTCOMMSERVER_H__
-#define __HTIBTCOMMSERVER_H__
-
-// INCLUDES
-
-#include <e32def.h>
-#include <e32base.h>
-
-// CONSTANTS
-
-// Reasons for BtCommServer panic
-enum TBtCommServerPanic
- {
- EBadRequest,
- EBadDescriptor,
- EMainSchedulerError,
- ESvrCreateServer,
- ESvrStartServer,
- ECreateTrapCleanup,
- ENotImplementedYet,
- EFailedToInitMessageBox,
- EFailedToOpenBTconnection,
- EFailedToOpenPhonetChannel,
- EFailedToRecPhonetMsg,
- EFailedToSendPhonetMsg,
- ETooManyAsyncRequests
- };
-
-// FUNCTION PROTOTYPES
-
-// Function to panic the server
-GLREF_C void PanicServer( TBtCommServerPanic aPanic );
-
-// Thread function for server
-GLREF_C TInt BtCommServerThread( TAny * );
-
-// FORWARD DECLARATIONS
-class CHtiBtCommServerSession;
-class CHtiBtReaderWriter;
-
-// CLASS DECLARATION
-
-/**
-* Server class for BT communication.
-*/
-class CHtiBtCommServer : public CServer2
- {
-
- private: // Constructors and destructor
- /**
- * C++ default constructor.
- */
- CHtiBtCommServer( TInt aPriority );
-
- /**
- * Second Phase constructor
- */
- void ConstructL();
-
- public:
- /**
- * Symbian Two-phased constructor.
- */
- static CHtiBtCommServer* NewL();
-
- /**
- * Destructor.
- */
- ~CHtiBtCommServer();
-
- public: // callbacks from session
-
- /**
- * Session was deleted notification.
- * Session notifies server, when client is disconnecting
- * and session is being deleted. Server will start shutdown.
- */
- void SessionFreed();
-
- /**
- * Session was created notification.
- * @param aSession Session, which is notifying server of its creation.
- */
- void SessionCreated( CHtiBtCommServerSession* aSession );
-
- public:
- /**
- * Creates a new client session
- * @param aVersion Version of the server
- * @param aMessage Client message
- * @return Pointer to the client session
- */
- virtual CSession2* NewSessionL( const TVersion& aVersion,
- const RMessage2& aMessage ) const;
-
- /**
- * Creates server thread
- * @param aStarted semaphore
- * @return Error code
- */
- static TInt ThreadFunction( TAny* aStarted );
-
-public: // Data
- // Priority of the server
- enum TBtServPriority
- {
- EBtCommServerPriority = 100
- };
-
-private:
-
- CHtiBtCommServerSession* iSession; // Not owned. Only one session allowed!
-
- };
-
-#endif // __HTIBTCOMMSERVER_H__
-
-// End of file
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/HtiBtCommServer/inc/HtiBtCommServerSession.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Server side session in HtiBtCommServer.
-*
-*/
-
-
-#ifndef CHTIBTCOMMSERVERSESSION_H
-#define CHTIBTCOMMSERVERSESSION_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-
-#include "BtSerialClient.h" // MBtSerialClientObserver
-
-// FORWARD DECLARATIONS
-
-class CHtiBtCommServer;
-
-// CLASS DECLARATION
-
-/**
-* This class represents a client session in the server.
-*
-* Server owns one instance of session (meaning only one client session
-* is allowed for this server).
-* Session allows only one outstanding read request and write request at a time.
-* Read request and write request may be outstanding simultaneously.
-*/
-class CHtiBtCommServerSession :
- public CSession2,
- public MBtSerialClientObserver
- {
-public:
-
- /**
- * Two phase constructor.
- *
- * @param aServer Pointer to the server instance
- */
- static CHtiBtCommServerSession* NewL( CHtiBtCommServer* aServer );
-
-private: // Construction
-
- /**
- * C++ default constructor.
- *
- * @param aClient
- * @param aServer
- */
- CHtiBtCommServerSession( CHtiBtCommServer* aServer );
-
- /**
- * Second phase construction.
- */
- void ConstructL();
-
- /**
- * Destructor.
- */
- ~CHtiBtCommServerSession();
-
-private: // From MBtSerialClientObserver
-
- void ConnectedToServer(TInt aError);
- void DisconnectedFromServer();
- void DataFromServer(const TDesC8& aData);
- void AllBufferedDataSent();
-
-private:
-
- /**
- * Handle client request. This is invoced by client server framework.
- * @param aMessage Message object describing client request
- */
- virtual void ServiceL(const RMessage2 &aMessage);
-
- /**
- * Determine client request type and delegate handling accordingly.
- * @param aMessage Message object describing client request
- */
- void DispatchMessageL(const RMessage2 &aMessage);
-
- void HandleConnectRequestL(const RMessage2& aMessage);
-
- /**
- * Handle client's send request.
- * Copies data from client address space to internal send buffer and starts
- * sending it.
- * @param aMessage Message object describing client request
- */
- void HandleSendRequestL(const RMessage2& aMessage);
-
- /**
- * Handle client's read request.
- * Wait for incoming data. Once received, copy its data to client's
- * address space and complete client's request.
- * @param aMessage Message object describing client request
- */
- void HandleReadRequestL(const RMessage2& aMessage);
-
- /**
- * Handle client's cancel requests.
- * Cancel either read or write operation depending on client request.
- * @param aMessage Message object describing client request
- */
- void HandleCancelRequestL(const RMessage2& aMessage);
-
- /**
- * Handle port number request
- * Write the port number of the currently connected service. If not
- * connected writes KErrDisconnected.
- */
- void HandlePortNumberRequestL(const RMessage2& aMessage);
-
-private: // Helpers
-
- void PanicClient(TInt aPanic) const;
- void ResetAll(TInt aCompletionCode);
- void TryCompleteReadRequest();
-
-private: // Data
-
- CHtiBtCommServer *iBtCommServer; // referenced
-
- RMessage2 iReadRequest;
- RMessage2 iWriteRequest;
- RMessage2 iConnectRequest;
- TBool iWriteRequestComplete; // ETrue: no previous pending write request
- TBool iReadRequestComplete; // ETrue: no previous pending read request
- TBool iConnectRequestComplete;
-
- CBtSerialClient* iBtClient;
-
- HBufC8* iIncomingDataBuf; // Coming from remote host
- HBufC8* iSendBuffer; // Sent to remote host
-
- };
-
-#endif // CHTIBTCOMMSERVERSESSION_H
-
-// End of File
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/HtiBtCommServer/inc/Logger.h Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Logger library
-*
-*/
-
-
-#ifndef __LOGGER_H_____
-#define __LOGGER_H_____
-
-// INCLUDES
-#include <e32std.h>
-
-// CONSTANTS
-const TInt KLogLevelDebug = 0;
-const TInt KLogLevelInfo = 10;
-const TInt KLogLevelWarning = 20;
-const TInt KLogLevelError = 30;
-
-const TInt KMinimumLogLevel = KLogLevelInfo;
-
-
-// When __ENABLE_LOGGING__ macro is defined, logging functions are
-// compiled to final build.
-//
-// Example usage: LOGFW(DebugLog(_L("Got an error %d"), 5))
-//
-#ifdef __ENABLE_LOGGING__
-
- #define LOGFW(a) a;
-
- _LIT(KLogFileName, "c:\\HTI_BtComm.log");
-
- // panics
- _LIT(KLogPanicCategory, "CustNotifyLog");
- static const TInt KPanicFsConnectFailed = 1;
- static const TInt KPanicFileCreateFailed = 2;
- static const TInt KPanicFileWriteFailed = 3;
-
- const TInt KLogEntryMaxLength = 156;
-
- // Usage example: DOLOG(_L("Logstring"));
- void DebugLog(TRefByValue<const TDesC> aFmt,...);
- void InfoLog(TRefByValue<const TDesC> aFmt,...);
- void WarnLog(TRefByValue<const TDesC> aFmt,...);
- void ErrLog(TRefByValue<const TDesC> aFmt,...);
-
- void Log(TInt aLevel, TRefByValue<const TDesC> aFmt, VA_LIST list);
-
- void LogBytes(const TDesC8& aData, TInt aMaxBytesToLog );
-
-#else //__ENABLE_LOGGING__
-
- #define LOGFW(a)
-
-#endif //__ENABLE_LOGGING__
-
-#endif //__LOGGER_H_____
-
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/HtiBtCommServer/src/HtiBtCommInterface.cpp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of RHtiBtCommInterface class.
-* Symbian side component uses this interface to receive and
-* send HTI data to HtiBtCommServer.
-* HtiBtCommServer acts as proxy to send and receive data
-* to and from PC.
-*
-*/
-
-
-// INCLUDE FILES
-#include "HtiBtClientServerCommon.h"
-#include "HtiBtCommInterface.h"
-
-#include <e32uid.h>
-#include <HtiLogging.h>
-
-// CONSTANTS
-const TUint KBtCommServerDefaultMessageSlots = 4; // Read, write, readCancel, writeCancel
-
-// Constants
-
-/*---------------------------------------------------------------------------*/
-EXPORT_C RHtiBtCommInterface::RHtiBtCommInterface()
- {
- HTI_LOG_TEXT( "RHtiBtCommInterface::RHtiBtCommInterface()" );
- }
-
-/*---------------------------------------------------------------------------*/
-EXPORT_C TInt RHtiBtCommInterface::Connect( TDesC8& aDeviceNameOrAddress,
- TInt aPort )
- {
- HTI_LOG_TEXT( "RHtiBtCommInterface::Connect()" );
-
- TInt error = StartThread(); // see HtiBtClientServerCommon.h
- if (error == KErrNone)
- {
- error = CreateSession( KBtCommServerName,
- Version(),
- KBtCommServerDefaultMessageSlots );
- }
- if ( error )
- return error;
-
- return ConnectBt( aDeviceNameOrAddress, aPort );
- }
-
-/*---------------------------------------------------------------------------*/
-EXPORT_C void RHtiBtCommInterface::Close()
- {
- HTI_LOG_FUNC_IN( "RHtiBtCommInterface::Close" );
-
- // Use thread finder to find the server thread
- TFullName threadName;
- TFullName matchPattern;
- matchPattern.Append( _L( "*" ) );
- matchPattern.Append( KBtCommServerName );
- matchPattern.Append( _L( "*" ) );
-
- TFindThread threadFinder;
- threadFinder.Find( matchPattern );
- TInt err = threadFinder.Next( threadName );
- if ( err )
- {
- HTI_LOG_FORMAT( "RHtiBtCommInterface::Close: Failed to find server thread: %d", err );
- User::Panic( _L( "BtIf Close, server thread not found" ), err );
- }
-
- HTI_LOG_TEXT( "RHtiBtCommInterface::Close: Found server thread:" );
- HTI_LOG_DES( threadName );
-
- RThread thread;
- err = thread.Open( threadName );
- if ( err )
- {
- HTI_LOG_FORMAT( "RHtiBtCommInterface::Close: Failed to open server thread: %d", err );
- User::Panic( _L( "BtIf Close, error opening server thread" ), err );
- }
- else
- {
- // initiate server shutdown
- RSessionBase::Close();
-
- // For clean server stop, wait for its death
- HTI_LOG_TEXT( "RHtiBtCommInterface::Close: Waiting for server thread to die..." );
- TRequestStatus status;
- thread.Logon( status );
- User::WaitForRequest( status );
- HTI_LOG_TEXT( "RHtiBtCommInterface::Close: Server thread dead." );
- }
-
- thread.Close();
- HTI_LOG_FUNC_OUT( "RHtiBtCommInterface::Close" );
- }
-
-/*---------------------------------------------------------------------------*/
-EXPORT_C TVersion RHtiBtCommInterface::Version(void) const
- {
- HTI_LOG_TEXT( "RHtiBtCommInterface::Connect()" );
- return ( TVersion( KBtCommServerMajorVersionNumber,
- KBtCommServerMinorVersionNumber,
- KBtCommServerBuildVersionNumber ) );
-
- }
-
-/*---------------------------------------------------------------------------*/
-EXPORT_C TInt RHtiBtCommInterface::GetSendBufferSize() const
- {
- return KClientSendBufferMaxSize;
- }
-
-/*---------------------------------------------------------------------------*/
-EXPORT_C TInt RHtiBtCommInterface::GetReceiveBufferSize() const
- {
- return KClientReceiveBufferMaxSize;
- }
-
-/*---------------------------------------------------------------------------*/
-EXPORT_C void RHtiBtCommInterface::Receive(TDes8& aData,
- TRequestStatus& aStatus)
- {
- HTI_LOG_TEXT( "RHtiBtCommInterface::Receive()" );
- SendReceive( EBtCommServerRecv, TIpcArgs( &aData ), aStatus );
- }
-
-/*---------------------------------------------------------------------------*/
-EXPORT_C void RHtiBtCommInterface::Send(const TDesC8& aData,
- TRequestStatus& aStatus)
- {
- HTI_LOG_TEXT( "RHtiBtCommInterface::Send()" );
- SendReceive( EBtCommServerSend, TIpcArgs( &aData ), aStatus );
- }
-
-/*---------------------------------------------------------------------------*/
-EXPORT_C void RHtiBtCommInterface::CancelReceive()
- {
- HTI_LOG_TEXT( "RHtiBtCommInterface::CancelReceive()" );
- SendReceive( ECancelBtCommServerRecv, TIpcArgs( NULL ) );
- }
-
-/*---------------------------------------------------------------------------*/
-EXPORT_C void RHtiBtCommInterface::CancelSend()
- {
- HTI_LOG_TEXT( "RHtiBtCommInterface::CancelSend()" );
- SendReceive( ECancelBtCommServerSend, TIpcArgs( NULL ) );
- }
-
-/*---------------------------------------------------------------------------*/
-EXPORT_C TInt RHtiBtCommInterface::GetPortNumber() const
- {
- HTI_LOG_TEXT( "RHtiBtCommInterface::GetPortNumber()" );
- TPckgBuf<TInt> pckg;
- TInt ret = SendReceive( EGetServicePortNumber, TIpcArgs( &pckg ) );
- if ( ret == KErrNone )
- {
- ret = pckg();
- }
- return ret;
- }
-
-/*---------------------------------------------------------------------------*/
-TInt RHtiBtCommInterface::ConnectBt( TDesC8& aDeviceNameOrAddress, TInt aPort )
- {
- HTI_LOG_TEXT( "RHtiBtCommInterface::ConnectBt()" );
- return SendReceive( EBtCommServerConnect,
- TIpcArgs( &aDeviceNameOrAddress, aPort ) );
- }
-
-/*---------------------------------------------------------------------------*/
-GLDEF_C TInt E32Main()
- {
- HTI_LOG_TEXT( "RHtiBtCommInterface::E32Main()" );
- return KErrNone;
- }
-
-// End of the file
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/HtiBtCommServer/src/HtiBtCommServer.cpp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,244 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This file contains the implementation of the
-* CHtiBtCommServer class.
-* CHtiBtCommServer handles Symbian server side operations
-* such as server starting and client session creation.
-*
-*/
-
-
-// INCLUDE FILES
-#include "HtiBtClientServerCommon.h"
-#include "HtiBtCommServer.h"
-#include "HtiBtCommServerSession.h"
-#include "Logger.h"
-
-#include <e32base.h>
-#include <e32std.h>
-#include <e32svr.h>
-#include <e32uid.h>
-
-// CONSTANTS
-// For memory allocations
-const TUint KBtCommServerHeapSizeMin = 0x6000;
-const TUint KBtCommServerHeapSizeMax = 0x20000;
-const TUint KBtCommServerStackSize = 0x8000;
-
-
-//*****************************************************************************
-//
-// Class CHtiBtCommServer
-//
-//*****************************************************************************
-
-/*---------------------------------------------------------------------------*/
-CHtiBtCommServer::CHtiBtCommServer( TInt aPriority )
- : CServer2( aPriority, ESharableSessions )
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer: CHtiBtCommServer()")))
- __DECLARE_NAME(_S( "CHtiBtCommServer" ));
- }
-
-/*---------------------------------------------------------------------------*/
-void CHtiBtCommServer::ConstructL()
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer: ConstructL()")))
- }
-
-/*---------------------------------------------------------------------------*/
-CHtiBtCommServer* CHtiBtCommServer::NewL()
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer: NewL()"));)
-
- CHtiBtCommServer *pS =
- new (ELeave) CHtiBtCommServer( EBtCommServerPriority );
- CleanupStack::PushL( pS );
- __ASSERT_ALWAYS( pS != NULL, PanicServer( ESvrCreateServer ) );
-
- pS->ConstructL();
- CleanupStack::Pop( pS );
- User::SetProcessCritical( User::ENotCritical );
- User::SetCritical( User::ENotCritical );
- LOGFW(InfoLog(_L("Server was started")))
- return pS;
- }
-
-/*---------------------------------------------------------------------------*/
-CHtiBtCommServer::~CHtiBtCommServer()
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer: ~CHtiBtCommServer()")))
- }
-
-/*---------------------------------------------------------------------------*/
-void CHtiBtCommServer::SessionFreed()
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer: SessionFreed(): Stopping active scheduler"));)
- iSession = NULL; // iSession is owned by server framework, not deleted here
- CActiveScheduler::Stop();
- LOGFW(DebugLog(_L("CHtiBtCommServer: SessionFreed(): Done"));)
- }
-
-/*---------------------------------------------------------------------------*/
-void CHtiBtCommServer::SessionCreated( CHtiBtCommServerSession* aSession )
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer: SessionCreated()"));)
- iSession = aSession;
- }
-
-/*---------------------------------------------------------------------------*/
-CSession2* CHtiBtCommServer::NewSessionL( const TVersion &aVersion,
- const RMessage2& aMessage ) const
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer: NewSessionL() - IPC V2"));)
- aMessage.IsNull();
- if ( iSession )
- User::Leave( KErrAlreadyExists ); // Allow only one session
-
- // Check that server is the right version
- TVersion ver( KBtCommServerMajorVersionNumber,
- KBtCommServerMinorVersionNumber,
- KBtCommServerBuildVersionNumber );
- if ( !User::QueryVersionSupported( ver, aVersion ) )
- {
- User::Leave( KErrNotSupported );
- }
- return CHtiBtCommServerSession::NewL( (CHtiBtCommServer*)this );
- }
-
-/*---------------------------------------------------------------------------*/
-GLDEF_C TInt CHtiBtCommServer::ThreadFunction( TAny* anArg )
- {
- LOGFW(_L("CHtiBtCommServer: ThreadFunction(): Starting"));
-
- __UHEAP_MARK;
-
- CTrapCleanup* cleanup = CTrapCleanup::New();
-
- // Convert argument into semaphore reference
- RSemaphore& semaphore = *(RSemaphore*)anArg;
-
- // Start scheduler...
- LOGFW(DebugLog(_L("CHtiBtCommServer: ThreadFunction(): Installing active scheduler"));)
- CActiveScheduler *pA = new CActiveScheduler;
- __ASSERT_ALWAYS( pA != NULL, PanicServer( EMainSchedulerError ) );
- CActiveScheduler::Install( pA );
-
- CHtiBtCommServer* pS = NULL;
- TRAPD(err,
- // ...and server
- LOGFW(DebugLog(_L("CHtiBtCommServer: ThreadFunction(): Creating server instance"));)
- pS = CHtiBtCommServer::NewL();
- )
-
- if ( err != KErrNone )
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer: ThreadFunction(): Failed creating server instance"));)
- }
-
- LOGFW(DebugLog(_L("CHtiBtCommServer: ThreadFunction(): Starting server"));)
- __ASSERT_ALWAYS( pS->Start(KBtCommServerName) == KErrNone,
- PanicServer( ESvrStartServer ) ); // Make first request pending,
-
- // Signal that server has started
- LOGFW(DebugLog(_L("CHtiBtCommServer: ThreadFunction(): Signalling client: server is up and running"));)
- semaphore.Signal();
-
- LOGFW(DebugLog(_L("CHtiBtCommServer: ThreadFunction(): Waiting for server's death"));)
- // Start receiving requests from clients
- CActiveScheduler::Start();
- LOGFW(DebugLog(_L("CHtiBtCommServer: ThreadFunction(): Server was stopped"));)
- LOGFW(InfoLog(_L("Server was stopped")))
- delete pS;
- LOGFW(DebugLog(_L("CHtiBtCommServer: ThreadFunction(): Server was deleted"));)
-
- // Finished
- delete pA;
- pA = NULL;
-
- // Destroy clean-up stack
- delete cleanup;
- cleanup = NULL;
-
- __UHEAP_MARKEND;
- return KErrNone;
- }
-
-/*---------------------------------------------------------------------------*/
-GLDEF_C void PanicServer( TBtCommServerPanic aPanic )
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer: PanicServer()"));)
- _LIT( KTxtServerPanic, "BtCommServer panic" );
- User::Panic( KTxtServerPanic, aPanic );
- }
-
-/*---------------------------------------------------------------------------*/
-EXPORT_C TInt StartThread()
- {
-// LOGFW(_L("CHtiBtCommServer: StartThread()"));
- TInt res = KErrNone;
-
- // Create server - if one of this name does not already exist
- TFindServer findBtCommServer( KBtCommServerName );
- TFullName name;
- if ( findBtCommServer.Next( name ) != KErrNone ) // Server doesn't exist
- {
- // Create a semaphore to know when thread initialization has finished
- RSemaphore semaphore;
- semaphore.CreateLocal(0);
-
-// LOGFW(_L("CHtiBtCommServer: Created Semaphore...\n"));
-
- // Create new server thread and thread's main function
- RThread thread;
- res = thread.Create( KBtCommServerName,
- CHtiBtCommServer::ThreadFunction,
- KBtCommServerStackSize,
- KBtCommServerHeapSizeMin,
- KBtCommServerHeapSizeMax,
- &semaphore );
-
-
- if ( res == KErrNone ) // Thread created ok - now start it going
- {
-// LOGFW(_L("CHtiBtCommServer: StartThread() - Create OK"));
-
- thread.SetPriority( EPriorityNormal );
-// TRequestStatus stat1;
-// thread.Logon(stat1);
-
- thread.Resume(); // Start it going
-
- semaphore.Wait(); // Wait until it's initialized
-
- thread.Close(); // No longer interest in the other thread
- }
- else // Thread not created ok
- {
- // No further interest in it
-// LOGFW(_L("CHtiBtCommServer: StartThread() - Create FAIL"));
- thread.Close();
- }
- semaphore.Close();
- }
- return res;
- }
-
-/*---------------------------------------------------------------------------*/
-GLDEF_C TInt E32Main()
- {
- return KErrNone;
- }
-
-// End of the file
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/HtiBtCommServer/src/HtiBtCommServerSession.cpp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,419 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Implementation of CHtiBtCommServerSession class. This class
-* represents the client session in server.
-*
-*/
-
-
-
-// INCLUDE FILES
-#include "HtiBtClientServerCommon.h"
-#include "HtiBtCommServerSession.h"
-#include "HtiBtCommServer.h"
-#include "BtSerialClient.h"
-#include "Logger.h"
-
-#include <e32base.h>
-#include <e32std.h>
-#include <e32svr.h>
-
-#include <HtiCommPluginInterface.h> // KErrComModuleReset;
-
-// CONSTANTS
- _LIT(KBtComSessPanic, "BtComSessAssrt");
-
-const TInt KBtAddressHexStringLength = 12; // 6 bytes
-const TInt KIncomingDataBufSize = 32 * 1024;
-
-//*****************************************************************************
-//
-// Class CHtiBtCommServerSession
-//
-//*****************************************************************************
-
-/*---------------------------------------------------------------------------*/
-CHtiBtCommServerSession::CHtiBtCommServerSession( CHtiBtCommServer* aServer )
- : CSession2()
- {
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: CHtiBtCommServerSession()")))
-
- __DECLARE_NAME( _S( "CHtiBtCommServerSession" ) );
- iBtCommServer = aServer;
- iReadRequestComplete = ETrue; // ready to accept read request
- iWriteRequestComplete = ETrue;
- iConnectRequestComplete = ETrue;
- iBtCommServer->SessionCreated(this);
- }
-
-/*---------------------------------------------------------------------------*/
-CHtiBtCommServerSession* CHtiBtCommServerSession::NewL(
- CHtiBtCommServer* aServer )
- {
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: NewL()")))
- CHtiBtCommServerSession* session =
- new (ELeave) CHtiBtCommServerSession( aServer );
- CleanupStack::PushL( session );
- session->ConstructL();
- CleanupStack::Pop( session );
- return session;
- }
-
-/*---------------------------------------------------------------------------*/
-
-void CHtiBtCommServerSession::ConstructL()
- {
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: ConstructL()")))
- iBtClient = CBtSerialClient::NewL(*this);
- iIncomingDataBuf = HBufC8::NewL(KIncomingDataBufSize);
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: ConstructL(): Done")))
- }
-
-/*---------------------------------------------------------------------------*/
-CHtiBtCommServerSession::~CHtiBtCommServerSession()
- {
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: ~CHtiBtCommServerSession()")))
- delete iBtClient;
- ResetAll(KErrCancel);
- delete iIncomingDataBuf;
- if ( iBtCommServer )
- {
- iBtCommServer->SessionFreed();
- }
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: ~CHtiBtCommServerSession(): Done")))
- }
-
-/*---------------------------------------------------------------------------*/
-void CHtiBtCommServerSession::ServiceL( const RMessage2& aMessage )
- {
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: ServiceL()")))
-
- TRAPD( error, DispatchMessageL( aMessage ) );
- if ( error != KErrNone )
- {
- LOGFW(DebugLog(_L("CHtiBtCommServerSession::ServiceL error %d"), error);)
- }
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: ServiceL(): Done")))
- }
-
-
-/*---------------------------------------------------------------------------*/
-void CHtiBtCommServerSession::DispatchMessageL( const RMessage2 &aMessage )
- {
- LOGFW( DebugLog( _L( "CHtiBtCommServerSession: DispatchMessageL()" ) ) )
-
- switch ( aMessage.Function() )
- {
- case EBtCommServerConnect:
- {
- HandleConnectRequestL( aMessage );
- }
- break;
-
- case EBtCommServerSend:
- {
- HandleSendRequestL( aMessage );
- }
- break;
- case EBtCommServerRecv:
- {
- HandleReadRequestL( aMessage );
- }
- break;
-
- case ECancelBtCommServerRecv:
- case ECancelBtCommServerSend:
- {
- HandleCancelRequestL( aMessage );
- }
- break;
-
- case EGetServicePortNumber:
- {
- HandlePortNumberRequestL( aMessage );
- }
- break;
-
- default:
- {
- LOGFW(ErrLog(_L("CHtiBtCommServerSession::DispatchMessageL: Unknown request: %d. Panicing Client"), aMessage.Function());)
- PanicClient( EBadRequest );
- User::Panic( KBtComSessPanic, 1 );
- }
- break;
- }
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: DispatchMessageL(): Done")))
- }
-
-/*---------------------------------------------------------------------------*/
-void CHtiBtCommServerSession::HandleConnectRequestL( const RMessage2& aMessage )
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer:HandleConnectRequestL()")))
- if ( !iConnectRequestComplete )
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer:HandleConnectRequestL(): Already connecting")))
- aMessage.Complete( KErrNotReady );
- }
- else
- {
- if ( iBtClient->Connected() )
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer:HandleConnectRequestL(): Already connected")))
- aMessage.Complete( KErrNone ); // Already connected. This is not an error?
- }
- else
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer:HandleConnectRequestL(): Starting to connect to remote host")))
- iConnectRequest = aMessage;
- iConnectRequestComplete = EFalse;
-
- TInt dataLength = (TUint16)aMessage.GetDesLength( 0 ); //first message slot
- LOGFW(DebugLog(_L("CHtiBtCommServer:HandleConnectRequestL(): Data length = %d"), dataLength));
-
- TInt port = aMessage.Int1();
- LOGFW(DebugLog(_L("CHtiBtCommServer:HandleConnectRequestL(): Port = %d"), port));
-
- if ( dataLength < 1 )
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer:HandleConnectRequestL(): No address or name - need to ask device")))
- iBtClient->ConnectL(); // Request is completed in ConnectedToServer
- }
- else if ( dataLength == KBtAddressHexStringLength )
- {
- TBuf8<KBtAddressHexStringLength> addressBuf8;
- aMessage.ReadL( 0, addressBuf8 );
- TBuf<KBtAddressHexStringLength> addressBuf;
- addressBuf.Copy( addressBuf8 );
- TBTDevAddr address;
- TInt result = address.SetReadable( addressBuf );
- LOGFW(DebugLog(_L("CHtiBtCommServer:HandleConnectRequestL(): SetReadable result = %d"), result));
- if ( result != KBtAddressHexStringLength )
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer:HandleConnectRequestL(): Not valid address - use it as name")))
- iBtClient->ConnectL( addressBuf, port );
- }
- else
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer:HandleConnectRequestL(): Valid address - connect")))
- iBtClient->ConnectL( address, port );
- }
- }
- else
- {
- LOGFW(DebugLog(_L("CHtiBtCommServer:HandleConnectRequestL(): Using name to connect")))
- TBTDeviceName8 deviceName8;
- aMessage.ReadL( 0, deviceName8 );
- TBTDeviceName deviceName;
- deviceName.Copy( deviceName8 );
- iBtClient->ConnectL( deviceName, port );
- }
- }
- }
- LOGFW(DebugLog(_L("CHtiBtCommServer:HandleConnectRequestL(): Done")))
- }
-
-/*---------------------------------------------------------------------------*/
-void CHtiBtCommServerSession::HandleReadRequestL( const RMessage2& aMessage )
- {
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: HandleReadRequestL()")))
-
- if ( !iReadRequestComplete )
- {
- LOGFW(WarnLog(_L("CHtiBtCommServerSession: HandleReadRequestL(): Pending request. ret=KErrNotReady")))
- // Two simultaneous read requests are not allowed.
- aMessage.Complete(KErrNotReady);
- return;
- }
-
- // No data in read buffer. Must wait for new data before completing request
- iReadRequest = aMessage;
- iReadRequestComplete = EFalse; // Not ready to complete next request
- TryCompleteReadRequest(); // if there is something in the readbuffer,
- // use it for completion.
-
- if ( iIncomingDataBuf->Des().Length() == 0 )
- {
- // Read some bytes to buffer even before client's request.
- iBtClient->ReadAsyncL(); // Issue async request to read more data.
- }
-
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: HandleReadRequestL(): Done")))
- }
-
-/*---------------------------------------------------------------------------*/
-void CHtiBtCommServerSession::HandleSendRequestL( const RMessage2& aMessage )
- {
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: HandleSendRequestL()")))
-
- TInt dataLength = (TUint16)aMessage.GetDesLength( 0 ); //first message slot
- LOGFW( InfoLog( _L( "Framework requested to send data: %d bytes" ), dataLength ) )
- if ( iBtClient->SendBufferMaxSize() < dataLength )
- {
- aMessage.Complete(KErrOverflow);
- LOGFW(ErrLog(_L("CHtiBtCommServerSession: HandleSendRequestL(): client is giving too big data. Cannot handle.")))
- }
- else if ( !iWriteRequestComplete )
- {
- LOGFW(WarnLog(_L("CHtiBtCommServerSession: HandleSendRequestL(): Pending request. ret=KErrNotReady")))
- // Already pending send request. Two simultaneous send requests not allowed.
- aMessage.Complete( KErrNotReady );
- }
- else
- {
- if ( iBtClient->FreeSpaceInSendBuffer() < dataLength )
- {
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: HandleSendRequestL(): Completing send request delayed")))
- // No space in the iBtClient's send buffer. Copy the data to internal
- // buffer and wait for iBtClient to send its data out before adding
- // data to its send buffer.
- delete iSendBuffer;
- iSendBuffer = NULL;
- iSendBuffer = HBufC8::NewL(dataLength);
- TPtr8 ptr = iSendBuffer->Des();
- aMessage.ReadL( 0, ptr );
- iWriteRequestComplete = EFalse;
- iWriteRequest = aMessage;
- // Wait for callback call AllBufferedDataSent. Complete request there.
- }
- else
- {
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: HandleSendRequestL(): Completing send request immediately")))
- // All data can be sent immediately, because there is enough space in
- // iBtClient's send buffer.
- HBufC8* data = HBufC8::NewLC( dataLength );
- TPtr8 ptr = data->Des();
- aMessage.ReadL( 0, ptr );
- iBtClient->SendL( ptr );
- CleanupStack::PopAndDestroy( data );
- aMessage.Complete( KErrNone );
- }
- }
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: HandleSendRequestL(): Done")))
- }
-
-/*---------------------------------------------------------------------------*/
-void CHtiBtCommServerSession::HandleCancelRequestL( const RMessage2& aMessage )
- {
- ResetAll( KErrCancel );
- aMessage.Complete( KErrNone );
- }
-
-/*---------------------------------------------------------------------------*/
-void CHtiBtCommServerSession::HandlePortNumberRequestL(const RMessage2& aMessage)
- {
- TPckgBuf<TInt> p( iBtClient->ServicePort() );
- TInt err = aMessage.Write( 0, p, 0 );
- aMessage.Complete( err );
- }
-
-/*---------------------------------------------------------------------------*/
-
-void CHtiBtCommServerSession::PanicClient(TInt aPanic) const
- {
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: PanicClient(): %d"), aPanic))
- LOGFW(WarnLog(_L("CHtiBtCommServerSession: PanicClient(): %d. NOT IMPLEMENTED"), aPanic))
- aPanic = aPanic;
- // should be done with RMessage2?
- }
-
-/*---------------------------------------------------------------------------*/
-void CHtiBtCommServerSession::ResetAll(TInt aCompletionCode)
- {
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: ResetAll()")))
- if ( !iWriteRequestComplete )
- iWriteRequest.Complete( aCompletionCode );
- if ( !iReadRequestComplete )
- iReadRequest.Complete( aCompletionCode );
- if ( !iConnectRequestComplete )
- iConnectRequest.Complete( aCompletionCode ); // error when making connection
- iWriteRequestComplete = ETrue;
- iReadRequestComplete = ETrue;
- iConnectRequestComplete = ETrue;
- delete iIncomingDataBuf;
- iIncomingDataBuf = NULL;
- delete iSendBuffer;
- iSendBuffer = NULL;
- iIncomingDataBuf = HBufC8::New(KIncomingDataBufSize);
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: ResetAll(): Done")))
- }
-
-/*---------------------------------------------------------------------------*/
-void CHtiBtCommServerSession::ConnectedToServer(TInt aError)
- {
- // Connected to server. Reading has been started.
- LOGFW(InfoLog(_L("CHtiBtCommServerSession: ConnectedToServer: connected to remote host")))
- iConnectRequestComplete = ETrue;
- iConnectRequest.Complete( aError );
- }
-
-/*---------------------------------------------------------------------------*/
-void CHtiBtCommServerSession::DisconnectedFromServer()
- {
- LOGFW(InfoLog(_L("CHtiBtCommServerSession: DisconnectedFromServer: disconnected from remote host")))
- ResetAll( KErrDisconnected );
- }
-
-/*---------------------------------------------------------------------------*/
-void CHtiBtCommServerSession::DataFromServer(const TDesC8& aData)
- {
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: DataFromServer: %d bytes"), aData.Length()))
- TPtr8 ptr = iIncomingDataBuf->Des();
- if ( aData.Length() > ptr.MaxLength() - ptr.Length() )
- PanicClient( KErrUnderflow ); // Client is reading too slowly
-
- ptr.Append( aData );
- TryCompleteReadRequest();
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: DataFromServer: done"), aData.Length()))
- }
-
-/*---------------------------------------------------------------------------*/
-void CHtiBtCommServerSession::AllBufferedDataSent()
- {
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: AllBufferedDataSent")))
- if ( !iWriteRequestComplete )
- {
- // iBtClient has sent all of its data and is ready to send more.
- TPtr8 ptr = iSendBuffer->Des();
- TRAPD( err, iBtClient->SendL( ptr ); )
- iWriteRequest.Complete( err );
- iWriteRequestComplete = ETrue;
- delete iSendBuffer;
- iSendBuffer = NULL;
- }
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: AllBufferedDataSent: Done")))
- }
-
-/*---------------------------------------------------------------------------*/
-void CHtiBtCommServerSession::TryCompleteReadRequest()
- {
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: TryCompleteReadRequest")))
- TPtr8 ptr = iIncomingDataBuf->Des();
-
- if ( iReadRequestComplete || ptr.Length() == 0 )
- {
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: TryCompleteReadRequest: Nothing to complete")))
- return; // No outstanding client request to complete
- }
-
- TInt dataMaxLength = (TUint16)iReadRequest.GetDesMaxLength(0); //first message slot
- TPtrC8 dataToClient = ptr.Left(dataMaxLength);
- TRAPD(err, iReadRequest.WriteL(0, dataToClient);)
-
- ptr.Delete(0, dataToClient.Length());
- iReadRequest.Complete(err);
- iReadRequestComplete = ETrue;
- LOGFW(DebugLog(_L("CHtiBtCommServerSession: TryCompleteReadRequest: Done")))
- }
-
-// End of file
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/HtiBtCommServer/src/Logger.cpp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,201 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Logger implementation.
-*
-*/
-
-
-// INCLUDE FILES
-#include "Logger.h"
-#include <f32file.h>
-
-#ifdef __ENABLE_LOGGING__
-
-// CONSTANTS
-_LIT(KDebugStr, "DEBUG: ");
-_LIT(KInfoStr, "INFO: ");
-_LIT(KWarnStr, "WARN: ");
-_LIT(KErrStr, "ERROR: ");
-
-
-/*---------------------------------------------------------------------------*/
-void LogBytes( const TDesC8& aData, TInt aMaxBytesToLog )
- {
- TInt i = 0;
- while ( i < aData.Length() && i < aMaxBytesToLog )
- {
- TBuf<64> hexbuf;
- TBuf<32> stringbuf;
- TInt k=0;
- while ( i < aMaxBytesToLog && i < aData.Length() && k < 16 )
- {
- const TUint8 uint8 = aData[i];
- hexbuf.AppendFormat( _L( "%02X "), uint8 );
-
- if ( uint8 == '%' )
- {
- stringbuf.Append( _L( "%%" ) ); // escape character in format string
- }
- else if ( uint8 < 32 || uint8 > 126 )
- {
- stringbuf.Append( _L(".") );
- }
- else
- {
- stringbuf.Append( ( TChar ) uint8 );
- }
- i++;
- k++;
- }
- TBuf<128> finalbuf;
- finalbuf.Copy( hexbuf );
- finalbuf.Append( _L(" | " ) );
- finalbuf.Append( stringbuf );
- DebugLog( finalbuf );
- }
- }
-
-/*---------------------------------------------------------------------------*/
-class TOverflowHandler : public TDes16Overflow
- {
- void Overflow( TDes16& aDes )
- {
- TBuf<KLogEntryMaxLength> logString( _L("LOG ERROR: overflow: ") );
- logString.Append( aDes.Left(
- KLogEntryMaxLength - logString.Length() ) );
- aDes.Copy( logString );
- }
- };
-
-/*---------------------------------------------------------------------------*/
-// Usage example: DOLOG(_L("Logstring"));
-void DebugLog( TRefByValue<const TDesC> aFmt, ... )
- {
- VA_LIST list;
- VA_START( list, aFmt );
- Log( KLogLevelDebug, aFmt, list );
- }
-
-/*---------------------------------------------------------------------------*/
-void InfoLog( TRefByValue<const TDesC> aFmt, ... )
- {
- VA_LIST list;
- VA_START( list, aFmt );
- Log( KLogLevelInfo, aFmt, list );
- }
-
-/*---------------------------------------------------------------------------*/
-void WarnLog( TRefByValue<const TDesC> aFmt, ... )
- {
- VA_LIST list;
- VA_START( list, aFmt );
- Log( KLogLevelWarning, aFmt, list );
- }
-
-/*---------------------------------------------------------------------------*/
-void ErrLog( TRefByValue<const TDesC> aFmt, ...)
- {
- VA_LIST list;
- VA_START( list, aFmt );
- Log( KLogLevelError, aFmt, list );
- }
-
-/*---------------------------------------------------------------------------*/
-void Log( TInt aLevel, TRefByValue<const TDesC> aText, VA_LIST list )
- {
-
- if ( aLevel < KMinimumLogLevel )
- return;
-
- _LIT( KLineFeed, "\n" );
-
- /**
- * Log time format (see TTime) is
- * Day-Month-Year Hours:Minutes:Seconds:Milliseconds
- *
- * Example: 30-12-2004 23:00:55:990
- */
- _LIT( KLogTimeFormat, "%F%D-%M-%Y %H:%T:%S:%*C3" );
-
- TBuf8<KLogEntryMaxLength> writeBuffer;
- TBuf16<KLogEntryMaxLength> logEntry;
- RFs FileServer;
- RFile File;
-
- if ( FileServer.Connect() != KErrNone )
- {
- FileServer.Close(); // just in case
- User::Panic( KLogPanicCategory(), KPanicFsConnectFailed );
- return;
- }
-
- // Open file for writing, if exists. Othervise create new file.
- if ( File.Open( FileServer, KLogFileName(), EFileWrite ) != KErrNone )
- {
- if ( File.Create( FileServer, KLogFileName(), EFileWrite )
- != KErrNone )
- {
- FileServer.Close();
- User::Panic( KLogPanicCategory(), KPanicFileCreateFailed );
- }
- }
-
- TTime currentTime;
- currentTime.UniversalTime();
- TBuf<32> timeString;
-
- // currentTime is now in universal time. Convert it to home time.
- TLocale locale;
- TTimeIntervalSeconds universalTimeOffset( locale.UniversalTimeOffset() );
- TTimeIntervalHours daylightSaving( 0 );
- if ( locale.QueryHomeHasDaylightSavingOn() )
- {
- daylightSaving = 1;
- }
- currentTime = currentTime + universalTimeOffset + daylightSaving;
- currentTime.FormatL( timeString, KLogTimeFormat );
-
- // Add LogString to the end of file and close the file
- TInt currentSize = 0, returnCode;
- writeBuffer.Append( timeString );
- writeBuffer.Append( _L(": ") );
-
- if ( aLevel < KLogLevelInfo )
- writeBuffer.Append(KDebugStr);
- else if ( aLevel < KLogLevelWarning )
- writeBuffer.Append(KInfoStr);
- else if ( aLevel < KLogLevelError )
- writeBuffer.Append(KWarnStr);
- else
- writeBuffer.Append(KErrStr);
-
- logEntry.AppendFormatList( aText, list ); //, &overFlowHandler );
- writeBuffer.Append( logEntry.Left(
- KLogEntryMaxLength - writeBuffer.Length() ) );
- writeBuffer.Append( KLineFeed );
- File.Size( currentSize );
- returnCode = File.Write( currentSize,
- writeBuffer,
- writeBuffer.Length() );
- File.Close();
- // Close file server session
- FileServer.Close();
-
- if ( returnCode != KErrNone )
- {
- User::Panic( KLogPanicCategory(), KPanicFileWriteFailed );
- }
- }
-
-#endif // __ENABLE_LOGGING__
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/eabi/HtiBtCommInterfaceu.def Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-EXPORTS
- _ZN19RHtiBtCommInterface10CancelSendEv @ 1 NONAME
- _ZN19RHtiBtCommInterface13CancelReceiveEv @ 2 NONAME
- _ZN19RHtiBtCommInterface4SendERK6TDesC8R14TRequestStatus @ 3 NONAME
- _ZN19RHtiBtCommInterface5CloseEv @ 4 NONAME
- _ZN19RHtiBtCommInterface7ConnectER6TDesC8i @ 5 NONAME
- _ZN19RHtiBtCommInterface7ReceiveER5TDes8R14TRequestStatus @ 6 NONAME
- _ZN19RHtiBtCommInterfaceC1Ev @ 7 NONAME
- _ZN19RHtiBtCommInterfaceC2Ev @ 8 NONAME
- _ZNK19RHtiBtCommInterface13GetPortNumberEv @ 9 NONAME
- _ZNK19RHtiBtCommInterface17GetSendBufferSizeEv @ 10 NONAME
- _ZNK19RHtiBtCommInterface20GetReceiveBufferSizeEv @ 11 NONAME
- _ZNK19RHtiBtCommInterface7VersionEv @ 12 NONAME
-
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/eabi/HtiBtCommServeru.def Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-EXPORTS
- _Z11StartThreadv @ 1 NONAME
- _ZTI16CHtiBtCommServer @ 2 NONAME ; #<TI>#
- _ZTI23CHtiBtCommServerSession @ 3 NONAME ; #<TI>#
- _ZTV16CHtiBtCommServer @ 4 NONAME ; #<VT>#
- _ZTV23CHtiBtCommServerSession @ 5 NONAME ; #<VT>#
-
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/eabi/HtiBtSerialComHelperu.def Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-EXPORTS
- _ZN15CBtSerialClient10ConnectingEv @ 1 NONAME
- _ZN15CBtSerialClient10DisconnectEv @ 2 NONAME
- _ZN15CBtSerialClient10ReadAsyncLEv @ 3 NONAME
- _ZN15CBtSerialClient11ServicePortEv @ 4 NONAME
- _ZN15CBtSerialClient14ServerAddressLEv @ 5 NONAME
- _ZN15CBtSerialClient17SendBufferMaxSizeEv @ 6 NONAME
- _ZN15CBtSerialClient21FreeSpaceInSendBufferEv @ 7 NONAME
- _ZN15CBtSerialClient4NewLER23MBtSerialClientObserver @ 8 NONAME
- _ZN15CBtSerialClient5SendLERK6TDesC8 @ 9 NONAME
- _ZN15CBtSerialClient8ConnectLE10TBTDevAddri @ 10 NONAME
- _ZN15CBtSerialClient8ConnectLERK7TDesC16i @ 11 NONAME
- _ZN15CBtSerialClient8ConnectLEv @ 12 NONAME
- _ZN15CBtSerialClient9ConnectedEv @ 13 NONAME
- _ZN15CBtSerialClientD0Ev @ 14 NONAME
- _ZN15CBtSerialClientD1Ev @ 15 NONAME
- _ZN15CBtSerialClientD2Ev @ 16 NONAME
- _ZTI13CTimeOutTimer @ 17 NONAME ; #<TI>#
- _ZTI14CSocketsReader @ 18 NONAME ; #<TI>#
- _ZTI14CSocketsWriter @ 19 NONAME ; #<TI>#
- _ZTI15CBtSerialClient @ 20 NONAME ; #<TI>#
- _ZTI18CBTServiceSearcher @ 21 NONAME ; #<TI>#
- _ZTI19TSdpAttributeParser @ 22 NONAME ; #<TI>#
- _ZTI23CMessageServiceSearcher @ 23 NONAME ; #<TI>#
- _ZTV13CTimeOutTimer @ 24 NONAME ; #<VT>#
- _ZTV14CSocketsReader @ 25 NONAME ; #<VT>#
- _ZTV14CSocketsWriter @ 26 NONAME ; #<VT>#
- _ZTV15CBtSerialClient @ 27 NONAME ; #<VT>#
- _ZTV18CBTServiceSearcher @ 28 NONAME ; #<VT>#
- _ZTV19TSdpAttributeParser @ 29 NONAME ; #<VT>#
- _ZTV23CMessageServiceSearcher @ 30 NONAME ; #<VT>#
-
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/group/HtiBtComm.cfg Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-# HTIBtComm communication plugin configuration file
-
-# Following parameters configure the PC where HTI will try to connect.
-# Define only one of them, either PC's Bluetooth name or Bluetooth address.
-# If both are defined, address will be used and name is ignored.
-# If neither is defined the device selection dialog will be shown and user
-# has to select the device where to connect.
-#
-# The BtDeviceAddress must be 12 hex characters.
-
-#BtDeviceName=MyComputer
-#BtDeviceAddress=01A2B3C4D5EF
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/group/HtiBtCommEcomPlugin.mmp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: ECOM Plugin project to support communication over serial port
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-TARGET HtiBtCommEcomPlugin.dll
-TARGETTYPE PLUGIN
-
-// ECom Dll recognition UID followed by the unique UID for this dll
-UID 0x10009D8D 0x200212CB
-
-VENDORID 0x101FB657
-
-CAPABILITY ALL -TCB
-
-SOURCEPATH ../HtiBtCommEcomPlugin/src
-SOURCE proxy.cpp
-SOURCE HtiBtCommEcomPlugin.cpp
-
-USERINCLUDE ../HtiBtCommEcomPlugin/inc ../BtEngine/inc ../HtiBtCommServer/inc
-APP_LAYER_SYSTEMINCLUDE
-
-START RESOURCE ../data/200212CB.rss
-TARGET HtiBtCommEcomPlugin.rsc
-END
-
-LIBRARY euser.lib
-LIBRARY ecom.lib
-LIBRARY c32.lib
-LIBRARY hticfg.lib
-LIBRARY htibtcomminterface.lib
-LIBRARY flogger.lib
-
-SMPSAFE
-
-// End of file
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/group/HtiBtCommInterface.mmp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: HtiBtCommInterface. Client interface to HtiBtCommServer
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-TARGET HtiBtCommInterface.dll
-TARGETTYPE DLL
-
-UID 0x200212D2
-DEFFILE HtiBtCommInterface.def
-
-VENDORID 0x101FB657
-
-CAPABILITY ALL -TCB
-
-SOURCEPATH ../HtiBtCommServer/src
-SOURCE HtiBtCommInterface.cpp
-
-USERINCLUDE ../HtiBtCommServer/inc
-APP_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib
-LIBRARY htibtcommserver.lib
-LIBRARY flogger.lib
-
-SMPSAFE
-
-// End of file
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/group/HtiBtCommServer.mmp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: HtiBtCommServer DLL project
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-TARGET HtiBtCommServer.dll
-TARGETTYPE DLL
-
-UID 0x200212D1
-DEFFILE HtiBtCommServer.def
-
-VENDORID 0x101FB657
-
-CAPABILITY ALL -TCB
-
-SOURCEPATH ../HtiBtCommServer/src
-SOURCE HtiBtCommServer.cpp
-SOURCE HtiBtCommServerSession.cpp
-SOURCE Logger.cpp
-
-USERINCLUDE ../HtiBtCommServer/inc ../BtEngine/inc
-APP_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib
-LIBRARY efsrv.lib
-LIBRARY bluetooth.lib
-LIBRARY htibtserialcomhelper.lib
-
-SMPSAFE
-
-// End of file
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/group/HtiBtSerialComHelper.mmp Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: HtiBtSerialComHelper project definition.
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-TARGET HtiBtSerialComHelper.dll
-TARGETTYPE DLL
-
-UID 0x1000008d 0x200212D3
-
-VENDORID 0x101FB657
-
-CAPABILITY ALL -TCB
-
-SOURCEPATH ../BtEngine/src
-SOURCE timeouttimer.cpp
-SOURCE socketsreader.cpp
-SOURCE socketswriter.cpp
-SOURCE BtSerialClient.cpp
-SOURCE messageservicesearcher.cpp
-SOURCE btservicesearcher.cpp
-SOURCE sdpattributeparser.cpp
-
-USERINCLUDE ../BtEngine/inc
-APP_LAYER_SYSTEMINCLUDE
-
-LIBRARY apparc.lib
-LIBRARY avkon.lib
-LIBRARY eikcoctl.lib
-LIBRARY eikcore.lib
-LIBRARY bafl.lib
-LIBRARY bluetooth.lib
-LIBRARY btextnotifiers.lib
-LIBRARY btmanclient.lib
-LIBRARY btdevice.lib
-LIBRARY btengsettings.lib
-LIBRARY cone.lib
-LIBRARY efsrv.lib
-LIBRARY esock.lib
-LIBRARY euser.lib
-LIBRARY flogger.lib
-LIBRARY sdpagent.lib
-LIBRARY sdpdatabase.lib
-
-SMPSAFE
-
-// End of file
--- a/htiui/HtiCommPlugins/HtiBtCommPlugin/group/bld.inf Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: HtiBtCommPlugin build info
-*
-*/
-
-
-PRJ_PLATFORMS
-
-PRJ_EXPORTS
-
-PRJ_MMPFILES
-HtiBtSerialComHelper.mmp
-HtiBtCommServer.mmp
-HtiBtCommInterface.mmp
-HtiBtCommEcomPlugin.mmp
--- a/htiui/HtiServicePlugins/HtiAppServicePlugin/group/HtiAppControl.mmp Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiAppServicePlugin/group/HtiAppControl.mmp Fri Apr 16 14:59:17 2010 +0300
@@ -45,9 +45,7 @@
LIBRARY ws32.lib
LIBRARY swinstcli.lib
LIBRARY sisregistryclient.lib
-#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
LIBRARY javaregistryclient.lib
-#endif
LIBRARY widgetregistryclient.lib
LIBRARY flogger.lib
--- a/htiui/HtiServicePlugins/HtiAppServicePlugin/src/HtiAppControl.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiAppServicePlugin/src/HtiAppControl.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -34,14 +34,10 @@
#include <SWInstApi.h>
#include <swi/sisregistrysession.h>
#include <swi/sisregistrypackage.h>
-#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
- #include <javaregistryincludes.h>
-#endif
+#include <javaregistryincludes.h>
#include <WidgetRegistryClient.h>
-#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
- using namespace Java;
-#endif
+using namespace Java;
// CONSTANTS
const static TUid KAppServiceUid = { 0x1020DEC7 }; //This is Uid of AppServiceOS
@@ -1638,7 +1634,6 @@
else if ( aMimeIndex > 2 && aMimeIndex < 7 ) // Java
{
- #if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
RArray<TUid> uids;
CleanupClosePushL( uids );
@@ -1675,9 +1670,6 @@
CleanupStack::PopAndDestroy( &uids );
User::LeaveIfError( uid );
return uid;
- #else
- User::Leave( KErrNotSupported );
- #endif
}
else if ( aMimeIndex == 7 ) // Widget
--- a/htiui/HtiServicePlugins/HtiKeyEventServicePlugin/group/HtiKeyEventServicePlugin.mmp Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiKeyEventServicePlugin/group/HtiKeyEventServicePlugin.mmp Fri Apr 16 14:59:17 2010 +0300
@@ -33,6 +33,7 @@
SOURCE HtiKeyEventServicePlugin.cpp
SOURCE KeyEventHandler.cpp
SOURCE PointerEventHandler.cpp
+SOURCE MultiTouchPointerEventHandler.cpp MultiTouchPointerEvent.cpp
USERINCLUDE ../inc
APP_LAYER_SYSTEMINCLUDE
--- a/htiui/HtiServicePlugins/HtiKeyEventServicePlugin/inc/HtiKeyEventServicePlugin.h Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiKeyEventServicePlugin/inc/HtiKeyEventServicePlugin.h Fri Apr 16 14:59:17 2010 +0300
@@ -67,6 +67,7 @@
CKeyEventHandler* iKeyHandler;
CPointerEventHandler* iPointerHandler;
+
TInt iLightTimeout;
CRepository* iCenRepSession;
CCenRepNotifyHandler* iLightTimeoutSettingHandler;
--- a/htiui/HtiServicePlugins/HtiKeyEventServicePlugin/inc/KeyEventHandler.h Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiKeyEventServicePlugin/inc/KeyEventHandler.h Fri Apr 16 14:59:17 2010 +0300
@@ -64,6 +64,7 @@
ELongKeyPress = 0x05,
ETypeTextPassword = 0x06,
EPressKeySequence = 0x07,
+ EPointer = 0x10,
EResultOk = 0xFF // only for response message
};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiServicePlugins/HtiKeyEventServicePlugin/inc/MultiTouchPointerEvent.h Fri Apr 16 14:59:17 2010 +0300
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Functional implementation of one touch(pointer sequence) event service.
+*
+*/
+
+#ifndef CMULTITOUCHPOINTER_UNIT_H
+#define CMULTITOUCHPOINTER_UNIT_H
+
+// INCLUDES
+#include <HtiServicePluginInterface.h>
+#include <w32std.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+class CMultiTouchPointerEventHandler;
+
+/**
+* Functional implentation of pointer event service.
+*/
+class CMultiTouchPointerEvent : public CActive
+ {
+ public:
+
+ /**
+ * Two-phased constructor.
+ */
+ static CMultiTouchPointerEvent* NewL(TUint8 aTouchNumber,
+ CMultiTouchPointerEventHandler* aEventHandler);
+
+ /**
+ * Destructor.
+ */
+ virtual ~CMultiTouchPointerEvent();
+
+
+ /**
+ * Touch active object start function
+ * @param aDelayTime initial wait time to start "finger" down for touch
+ */
+ void StartTouch();
+
+ void AddPointL(TTimeIntervalMicroSeconds32 aTime,
+ TInt aX, TInt aY, TInt aZ, TRawEvent::TType aEventType);
+
+ void PrintInfo();
+
+ /**
+ * Insert a dragging event between two given pointers
+ * Interpolate pointer sequence with step aStepCount and dragging time.
+ * @param aX1, aY1, aZ1 3D coordinate of start point
+ * @param aX2, aY2, aZ2 3D coordinate of end point
+ * @param aDragTime dragging time between start point and end point
+ * @param aStepCount step count between two points
+ */
+ void InterpolatePointL(TInt aX1,TInt aY1, TInt aZ1, TInt aX2,TInt aY2, TInt aZ2,
+ TTimeIntervalMicroSeconds32 aDragTime, TInt aStepCount);
+
+ protected: // Functions from base classes
+
+ // From CActive
+ void RunL();
+ TInt RunError(TInt aError);
+ void DoCancel();
+
+ private:
+
+ /**
+ * C++ default constructor.
+ */
+ CMultiTouchPointerEvent(TUint8 aTouchNumber, CMultiTouchPointerEventHandler* aEventHandler);
+
+ /**
+ * 2nd phase constructor.
+ */
+ void ConstructL();
+
+ void SimulatePointerEvent();
+
+ /**
+ * Insert an advanced pointer to pointer sequence array for a touch
+ * @param aX, aY, aZ pointer 3D coordinate
+ * @param aEventType event type
+ */
+ void InsertPointArrayL(TInt aX, TInt aY, TInt aZ, TRawEvent::TType aEventType);
+
+ /**
+ * Insert time duration to time array
+ * @param aDelayTime time duation to wait for
+ */
+ void InsertTimeArrayL(TTimeIntervalMicroSeconds32 aDelayTime);
+
+ private: // data
+
+ struct TAdvancedPointer
+ {
+ TInt X;
+ TInt Y;
+ TInt Z;
+ TRawEvent::TType EventType;
+ };
+
+ CMultiTouchPointerEventHandler* iEventHandler;
+ TUint8 iTouchNumber;
+
+ RTimer iTimer;
+
+ RPointerArray<TAdvancedPointer> iAdvPointerArray;
+ RPointerArray<TTimeIntervalMicroSeconds32> iTimeArray;
+ };
+
+#endif // CMULTITOUCHPOINTER_UNIT_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiServicePlugins/HtiKeyEventServicePlugin/inc/MultiTouchPointerEventHandler.h Fri Apr 16 14:59:17 2010 +0300
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Functional implementation of advanced pointer multitouch service.
+*
+*/
+
+#ifndef CMULTITOUCHPOINTEREVENTHANDLER_H
+#define CMULTITOUCHPOINTEREVENTHANDLER_H
+
+// INCLUDES
+#include <HtiServicePluginInterface.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+class CMultiTouchPointerEvent;
+
+/**
+* Observer interface for Multi touch event.
+*/
+class MHtiMultiTouchObserver
+ {
+public:
+ /**
+ * Notify multi touch event completed
+ */
+ virtual void NotifyMultiTouchComplete() = 0;
+
+ };
+/**
+* Functional implentation of pointer event service.
+*/
+class CMultiTouchPointerEventHandler
+ {
+ public:
+ /**
+ * Two-phased constructor.
+ */
+ static CMultiTouchPointerEventHandler* NewL(MHtiMultiTouchObserver& aObserver);
+
+ /**
+ * Destructor.
+ */
+ virtual ~CMultiTouchPointerEventHandler();
+
+
+ TBool HandleMultiTouchL( const TDesC8& aData );
+
+ /**
+ * Callback function called by CMultiTouchPointerEvent to notify CMultiTouchPointerEventHandler
+ * that this touch action(pointer sequence) is conpleted.
+ * @param aTouchNumber touch number ordinal
+ */
+ void NotifyTouchComplete(TUint8 aTouchNumber);
+
+ void SimulateEvent(TUint8 aTouchNumber,TInt aX, TInt aY, TInt aZ, TRawEvent::TType aEventType);
+
+ void Clear();
+
+ private:
+
+ /**
+ * C++ default constructor.
+ */
+ CMultiTouchPointerEventHandler(MHtiMultiTouchObserver& aObserver);
+
+ /**
+ * 2nd phase constructor.
+ */
+ void ConstructL();
+
+ TBool ParsePoint( const TDesC8& aData, TInt& aoffset,
+ TInt& aX, TInt& aY, TInt& aZ,
+ TTimeIntervalMicroSeconds32& aWait, TTimeIntervalMicroSeconds32& aHold );
+
+ TBool ParseMove( const TDesC8& aData, TInt& aoffset,
+ TTimeIntervalMicroSeconds32& aDragTime, TInt& aStepCount );
+
+ private: // data
+ RWsSession iWsSession;
+ RPointerArray<CMultiTouchPointerEvent> iTouchPointerArray;
+ TUint8 iFinishedCount;
+
+ MHtiMultiTouchObserver& iObserver;
+ };
+
+#endif // CKEYEVENTHANDLER_H
--- a/htiui/HtiServicePlugins/HtiKeyEventServicePlugin/inc/PointerEventHandler.h Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiKeyEventServicePlugin/inc/PointerEventHandler.h Fri Apr 16 14:59:17 2010 +0300
@@ -21,7 +21,7 @@
// INCLUDES
#include <HtiServicePluginInterface.h>
#include <w32std.h>
-
+#include "MultiTouchPointerEventHandler.h"
// CONSTANTS
// MACROS
@@ -38,7 +38,9 @@
/**
* Functional implentation of pointer event service.
*/
-class CPointerEventHandler : public CActive
+class CPointerEventHandler :
+ public CActive,
+ public MHtiMultiTouchObserver
{
public:
@@ -57,8 +59,9 @@
ETapAndDragMultipoint = 0x12,
EPressPointerDown = 0x13,
ELiftPointerUp = 0x14,
- EAdvancedTapScreen = 0x15, //for advanced
- EPinchZoom = 0x16, //for advanced
+ EAdvancedTapScreen = 0x15, //for advanced pointer
+ EPinchZoom = 0x16, //for advanced pointer
+ EMultiTouch = 0x17, //for advanced pointer
EResultOk = 0xFF // only for response message
};
@@ -111,6 +114,9 @@
void RunL();
TInt RunError(TInt aError);
void DoCancel();
+
+ // From MHtiMultiTouchObserver
+ void NotifyMultiTouchComplete();
private:
@@ -129,8 +135,11 @@
void HandleTapAndDragL( const TDesC8& aData );
void HandleTapAndDragMultipointL( const TDesC8& aData );
void HandlePointerDownOrUpL( const TDesC8& aData );
- void HandleAdvancedTapScreenL( const TDesC8& aData ); //for advanced
- void HandlePinchZoomL( const TDesC8& aData ); //for advanced
+
+ //for advanced pointer
+ void HandleAdvancedTapScreenL( const TDesC8& aData );
+ void HandlePinchZoomL( const TDesC8& aData );
+ void HandleMultiTouchL( const TDesC8& aData );
void SendOkMsgL();
void SendErrorMessageL( TInt aError, const TDesC8& aDescription );
@@ -166,6 +175,8 @@
RPointerArray<TAdvancedPointer> iAdvPointerMoveArray;
RPointerArray<TTimeIntervalMicroSeconds32> iDelayArray;
+
+ CMultiTouchPointerEventHandler* iMultiTouchHandler;
};
#endif // CKEYEVENTHANDLER_H
--- a/htiui/HtiServicePlugins/HtiKeyEventServicePlugin/src/HtiKeyEventServicePlugin.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiKeyEventServicePlugin/src/HtiKeyEventServicePlugin.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -61,6 +61,7 @@
HTI_LOG_TEXT( "CHtiKeyEventServicePlugin destroy" );
delete iKeyHandler;
delete iPointerHandler;
+
if ( iLightTimeoutSettingHandler )
{
iLightTimeoutSettingHandler->StopListening();
@@ -120,7 +121,7 @@
iKeyHandler->ProcessMessageL( aMessage, aPriority );
}
- else
+ else
{
if ( iPointerHandler == NULL )
{
@@ -128,7 +129,8 @@
iPointerHandler->SetDispatcher( iDispatcher );
}
iPointerHandler->ProcessMessageL( aMessage, aPriority );
- }
+ }
+
HTI_LOG_FUNC_OUT( "CHtiKeyEventServicePlugin::ProcessMessageL: Done" );
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiServicePlugins/HtiKeyEventServicePlugin/src/MultiTouchPointerEvent.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -0,0 +1,257 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Functional implementation of one touch(pointer sequence) event service.
+*
+*/
+
+// INCLUDE FILES
+#include "HtiKeyEventServicePlugin.h"
+#include "MultiTouchPointerEvent.h"
+#include "MultiTouchPointerEventHandler.h"
+
+#include <HtiLogging.h>
+
+
+// CONSTANTS
+_LIT8( KErrorInternalFailure, "Internal pointer command failure" );
+_LIT (KPrintInfoString, "PrintInfo event id=%d time=%d type=%d X=%d Y=%d Z=%d");
+
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerUnit::NewL()
+// ----------------------------------------------------------------------------
+CMultiTouchPointerEvent* CMultiTouchPointerEvent::NewL(TUint8 aTouchNumber,
+ CMultiTouchPointerEventHandler* aEventHandler)
+ {
+ HTI_LOG_FUNC_IN( "CMultiTouchPointerEvent::NewL" );
+ CMultiTouchPointerEvent* self = new (ELeave) CMultiTouchPointerEvent(aTouchNumber, aEventHandler);
+ CleanupStack::PushL ( self );
+ self->ConstructL();
+ CleanupStack::Pop();
+ HTI_LOG_FUNC_OUT( "CMultiTouchPointerEvent::NewL" );
+ return self;
+ }
+
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEvent::CMultiTouchPointerEvent()
+// ----------------------------------------------------------------------------
+CMultiTouchPointerEvent::CMultiTouchPointerEvent(TUint8 aTouchNumber,
+ CMultiTouchPointerEventHandler *aEventHandler)
+ : CActive(CActive::EPriorityStandard),
+ iEventHandler(aEventHandler),
+ iTouchNumber(aTouchNumber)
+ {
+ HTI_LOG_TEXT( "CMultiTouchPointerEvent constructor" );
+ }
+
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEvent::~CMultiTouchPointerEvent()
+// ----------------------------------------------------------------------------
+CMultiTouchPointerEvent::~CMultiTouchPointerEvent()
+ {
+ HTI_LOG_TEXT( "CMultiTouchPointerEvent destructor" );
+ Cancel();
+ iTimer.Close();
+
+ iTimeArray.ResetAndDestroy();
+ iAdvPointerArray.ResetAndDestroy();
+ }
+
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEvent::ConstructL()
+// ----------------------------------------------------------------------------
+void CMultiTouchPointerEvent::ConstructL()
+ {
+ HTI_LOG_TEXT( "CMultiTouchPointerEvent::ConstructL" );
+ iTimeArray.Reset();
+
+ User::LeaveIfError( iTimer.CreateLocal() );
+ CActiveScheduler::Add( this );
+ }
+
+
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEvent::StartTouch()
+// ----------------------------------------------------------------------------
+void CMultiTouchPointerEvent::StartTouch()
+ {
+ HTI_LOG_FUNC_IN( "CMultiTouchPointerEvent::StartTouch" );
+ TBool bcontinue=ETrue;
+ while (iTimeArray.Count()>0 && bcontinue)
+ {
+ TTimeIntervalMicroSeconds32* time=iTimeArray[0];
+ iTimeArray.Remove(0);
+ HTI_LOG_FORMAT( "Event time=%d ", time->Int() );
+ if (time->Int()==0)
+ {
+ // execute immediately
+ SimulatePointerEvent();
+ }
+ else
+ {
+ // wait for specified time
+ iTimer.After( iStatus, *time );
+ SetActive();
+ bcontinue=EFalse;
+ }
+ delete time;
+ }
+
+ if (iTimeArray.Count()==0)
+ {
+ HTI_LOG_FORMAT( "Notify touch %d complete", iTouchNumber );
+ iEventHandler->NotifyTouchComplete(iTouchNumber);
+ }
+ HTI_LOG_FUNC_OUT( "CMultiTouchPointerEvent::StartTouch" );
+ }
+
+// ----------------------------------------------------------------------------
+// void CMultiTouchPointerEvent::InsertPointArrayL()
+// ----------------------------------------------------------------------------
+void CMultiTouchPointerEvent::InsertPointArrayL(TInt aX,TInt aY,TInt aZ,TRawEvent::TType aEventType)
+ {
+
+ TAdvancedPointer* point = new (ELeave) TAdvancedPointer;
+ CleanupStack::PushL(point);
+ iAdvPointerArray.AppendL(point);
+ CleanupStack::Pop();
+
+ point->X=aX;
+ point->Y=aY;
+ point->Z=aZ;
+ point->EventType=aEventType;
+
+ }
+
+// ----------------------------------------------------------------------------
+// void CMultiTouchPointerEvent::InsertTimeArrayL()
+// ----------------------------------------------------------------------------
+void CMultiTouchPointerEvent::InsertTimeArrayL(TTimeIntervalMicroSeconds32 aDelayTime)
+ {
+
+ TTimeIntervalMicroSeconds32* time=new (ELeave) TTimeIntervalMicroSeconds32(aDelayTime);
+ iTimeArray.AppendL(time);
+
+ }
+
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEvent::InterpolatePointL()
+// ----------------------------------------------------------------------------
+void CMultiTouchPointerEvent::InterpolatePointL(TInt aX1,TInt aY1, TInt aZ1,
+ TInt aX2,TInt aY2, TInt aZ2, TTimeIntervalMicroSeconds32 aDragTime, TInt aStepCount)
+ {
+ HTI_LOG_FUNC_IN( "CMultiTouchPointerEvent::InterpolatePointL" );
+ TInt dx = (aX2-aX1)/aStepCount;
+ TInt dy = (aY2-aY1)/aStepCount;
+
+ TTimeIntervalMicroSeconds32 dt = aDragTime.Int()/aStepCount;
+ TInt X,Y,Z;
+ for (TInt i=1;i<=aStepCount;i++)
+ {
+ if (i<aStepCount)
+ {
+ X=aX1+i*dx;
+ Y=aY1+i*dy;
+ Z=aZ1;
+ }
+ else
+ {
+ X=aX2;
+ Y=aY2;
+ Z=aZ2;
+ }
+ AddPointL(dt,X,Y,Z,TRawEvent::EPointerMove);
+ }
+
+ HTI_LOG_FUNC_OUT( "CMultiTouchPointerEvent::InterpolatePointL" );
+ }
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEvent::RunL()
+// ----------------------------------------------------------------------------
+void CMultiTouchPointerEvent::RunL()
+ {
+ HTI_LOG_FUNC_IN( "CMultiTouchPointerEvent::RunL" );
+ SimulatePointerEvent();
+ StartTouch();
+ HTI_LOG_FUNC_OUT( "CMultiTouchPointerEvent::RunL" );
+ }
+
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEvent::RunError()
+// ----------------------------------------------------------------------------
+TInt CMultiTouchPointerEvent::RunError( TInt aError )
+ {
+ HTI_LOG_FORMAT( "CMultiTouchPointerEvent::RunError %d", aError );
+
+ return KErrNone;
+ }
+
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEvent::DoCancel()
+// ----------------------------------------------------------------------------
+void CMultiTouchPointerEvent::DoCancel()
+ {
+ HTI_LOG_FUNC_IN( "CMultiTouchPointerEvent::DoCancel" );
+ iTimer.Cancel();
+ HTI_LOG_FUNC_OUT( "CMultiTouchPointerEvent::DoCancel" );
+ }
+
+void CMultiTouchPointerEvent::PrintInfo()
+ {
+#ifdef __ENABLE_LOGGING__
+ HTI_LOG_FUNC_IN( "CMultiTouchPointerEvent::PrintInfo" );
+
+ HTI_LOG_FORMAT( "PrintInfo touch number=%d ", iTouchNumber );
+
+ TInt size=iTimeArray.Count();
+ HTI_LOG_FORMAT( "PrintInfo event array=%d ", size );
+
+ TBuf<255> buf;
+
+ for (TInt i=0;i<size;i++)
+ {
+ buf.Format(KPrintInfoString,
+ i, iTimeArray[i]->Int(),iAdvPointerArray[i]->EventType ,
+ iAdvPointerArray[i]->X ,iAdvPointerArray[i]->Y, iAdvPointerArray[i]->Z );
+ HTI_LOG_DES(buf);
+ }
+ HTI_LOG_FUNC_OUT( "CMultiTouchPointerEvent::PrintInfo" );
+#endif
+ }
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEvent::SimulatePointerEvent()
+// Sends the pointer event as a raw event.
+// ----------------------------------------------------------------------------
+void CMultiTouchPointerEvent::SimulatePointerEvent()
+ {
+ HTI_LOG_FUNC_IN( "CMultiTouchPointerEvent::SimulatePointerEvent" );
+
+ if (iAdvPointerArray.Count()>0)
+ {
+ TAdvancedPointer* pointer = iAdvPointerArray[0];
+ iAdvPointerArray.Remove(0);
+
+ iEventHandler->SimulateEvent(iTouchNumber, pointer->X, pointer->Y, pointer->Z,pointer->EventType);
+ delete pointer;
+ }
+
+ HTI_LOG_FUNC_OUT( "CMultiTouchPointerEvent::SimulatePointerEvent" );
+
+ }
+void CMultiTouchPointerEvent::AddPointL(TTimeIntervalMicroSeconds32 aTime,
+ TInt aX, TInt aY, TInt aZ, TRawEvent::TType aEventType)
+ {
+ InsertPointArrayL( aX, aY, aZ,aEventType);
+ InsertTimeArrayL(aTime);
+ }
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/HtiServicePlugins/HtiKeyEventServicePlugin/src/MultiTouchPointerEventHandler.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -0,0 +1,286 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Functional implementation of advanced pointer multitouch service
+*
+*/
+
+// INCLUDE FILES
+#include "HtiKeyEventServicePlugin.h"
+#include "MultiTouchPointerEventHandler.h"
+#include "MultiTouchPointerEvent.h"
+
+#include <HtiDispatcherInterface.h>
+#include <HtiLogging.h>
+
+// CONSTANTS
+
+
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEventHandler::NewL()
+// ----------------------------------------------------------------------------
+CMultiTouchPointerEventHandler* CMultiTouchPointerEventHandler::NewL(MHtiMultiTouchObserver& aObserver)
+ {
+ HTI_LOG_FUNC_IN( "CMultiTouchPointerEventHandler::NewL" );
+ CMultiTouchPointerEventHandler* self = new (ELeave) CMultiTouchPointerEventHandler(aObserver);
+ CleanupStack::PushL ( self );
+ self->ConstructL();
+ CleanupStack::Pop();
+ HTI_LOG_FUNC_OUT( "CMultiTouchPointerEventHandler::NewL" );
+ return self;
+ }
+
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEventHandler::CMultiTouchPointerEventHandler()
+// ----------------------------------------------------------------------------
+CMultiTouchPointerEventHandler::CMultiTouchPointerEventHandler(MHtiMultiTouchObserver& aObserver)
+ :iFinishedCount(0), iObserver(aObserver)
+ {
+ HTI_LOG_TEXT( "CMultiTouchPointerEventHandler constructor" );
+ }
+
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEventHandler::~CMultiTouchPointerEventHandler()
+// ----------------------------------------------------------------------------
+CMultiTouchPointerEventHandler::~CMultiTouchPointerEventHandler()
+ {
+ HTI_LOG_TEXT( "CMultiTouchPointerEventHandler destructor" );
+ Clear();
+ iWsSession.Close();
+ }
+
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEventHandler::ConstructL()
+// ----------------------------------------------------------------------------
+void CMultiTouchPointerEventHandler::ConstructL()
+ {
+ HTI_LOG_TEXT( "CMultiTouchPointerEventHandler::ConstructL" );
+ User::LeaveIfError( iWsSession.Connect() );
+ }
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEventHandler::Clear()
+// ----------------------------------------------------------------------------
+void CMultiTouchPointerEventHandler::Clear()
+ {
+ HTI_LOG_TEXT( "CMultiTouchPointerEventHandler::Clear" );
+ iTouchPointerArray.ResetAndDestroy();
+ iFinishedCount=0;
+ }
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEventHandler::NotifyTouchComplete()
+// ----------------------------------------------------------------------------
+void CMultiTouchPointerEventHandler::NotifyTouchComplete(TUint8 aTouchNumber)
+ {
+ HTI_LOG_FUNC_IN("CMultiTouchPointerEventHandler::NotifyTouchComplete");
+
+ iFinishedCount++;
+ HTI_LOG_FORMAT( "touch number %d finished", aTouchNumber);
+ HTI_LOG_FORMAT( "%d touch finished", iFinishedCount);
+
+ if(iTouchPointerArray.Count() == iFinishedCount)
+ {
+ // notify observer
+ iObserver.NotifyMultiTouchComplete();
+ }
+
+ HTI_LOG_FUNC_OUT("CMultiTouchPointerEventHandler::NotifyTouchComplete");
+ }
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEventHandler::ParsePoint()
+// ----------------------------------------------------------------------------
+TBool CMultiTouchPointerEventHandler::ParsePoint( const TDesC8& aData, TInt& aoffset,
+ TInt& aX, TInt& aY, TInt& aZ,
+ TTimeIntervalMicroSeconds32& aWait, TTimeIntervalMicroSeconds32& aHold )
+ {
+ HTI_LOG_FUNC_IN( "CMultiTouchPointerEventHandler::ParsePoint" );
+
+ TInt dataLength = aData.Length();
+ if ( dataLength-aoffset < 14 )
+ return EFalse ;
+
+ aX = aData[aoffset] + ( aData[aoffset+1] << 8 );
+ aoffset += 2;
+
+ aY = aData[aoffset] + ( aData[aoffset+1] << 8 );
+ aoffset += 2;
+
+ aZ = aData[aoffset] + ( aData[aoffset+1] << 8 );
+ aoffset += 2;
+
+ aWait = (aData[aoffset] + ( aData[aoffset+1] << 8 )
+ + ( aData[aoffset+2] << 16 ) + (aData[aoffset+3] << 24) ) * 1000;
+ aoffset += 4;
+
+ aHold = ( aData[aoffset] + ( aData[aoffset+1] << 8 )
+ + ( aData[aoffset+2] << 16 ) + (aData[aoffset+3] << 24) ) * 1000;
+ aoffset += 4;
+
+ HTI_LOG_FUNC_OUT( "CMultiTouchPointerEventHandler::ParsePoint" );
+ return ETrue;
+ }
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEventHandler::ParseMove()
+// ----------------------------------------------------------------------------
+TBool CMultiTouchPointerEventHandler::ParseMove( const TDesC8& aData, TInt& aoffset,
+ TTimeIntervalMicroSeconds32& aDragTime, TInt& aStepCount )
+ {
+ HTI_LOG_FUNC_IN( "CMultiTouchPointerEventHandler::ParseMove" );
+
+ TInt dataLength = aData.Length();
+ if ( dataLength-aoffset < 6 )
+ return EFalse ;
+
+ aDragTime = ( aData[aoffset] + ( aData[aoffset+1] << 8 )
+ + ( aData[aoffset+2] << 16 ) + (aData[aoffset+3] << 24) ) * 1000;
+ aoffset += 4;
+
+ aStepCount = aData[aoffset] + ( aData[aoffset+1] << 8 );
+ aoffset += 2;
+
+ HTI_LOG_FUNC_OUT( "CMultiTouchPointerEventHandler::ParseMove" );
+ return ETrue;
+ }
+// ----------------------------------------------------------------------------
+// CMultiTouchPointerEventHandler::HandleMultiTouchL()
+// ----------------------------------------------------------------------------
+TBool CMultiTouchPointerEventHandler::HandleMultiTouchL( const TDesC8& aData )
+ {
+ HTI_LOG_FUNC_IN( "CMultiTouchPointerEventHandler::HandleMultiTouchL" );
+ TBool validparameter=EFalse;
+
+ TInt dataLength = aData.Length();
+ if ( dataLength < 1 )
+ return validparameter;
+
+ // Parse the parameters - correct length is already verified
+ TInt offset = 0;
+
+ TInt touchCount = aData[offset];
+ offset += 1;
+ HTI_LOG_FORMAT( "Number of touches: %d", touchCount );
+ if (touchCount<=0)
+ return validparameter;
+
+ for(TInt i=0; i<touchCount; i++)
+ {
+ //check valid data length
+ if(dataLength-offset < 3)
+ return validparameter;
+
+ TInt pointerNumber = aData[offset];
+ offset += 1;
+ HTI_LOG_FORMAT( "Pointer Number %d", pointerNumber );
+
+ TInt pointerCount = aData[offset] + ( aData[offset+1] << 8 );
+ offset += 2;
+ HTI_LOG_FORMAT( "Number of points: %d", pointerCount );
+
+ if (pointerCount == 0 )
+ return validparameter;
+
+ CMultiTouchPointerEvent* touch = CMultiTouchPointerEvent::NewL(pointerNumber,this);
+ CleanupStack::PushL(touch);
+ iTouchPointerArray.AppendL(touch);
+ CleanupStack::Pop();
+
+ TInt lastX, lastY, lastZ, stepCount;
+ TTimeIntervalMicroSeconds32 dragTime;
+
+ for (TInt j=0;j<pointerCount;j++)
+ {
+ // read point
+ TInt X1, Y1, Z1;
+ TTimeIntervalMicroSeconds32 waitTime, holdTime;
+ if (!ParsePoint( aData, offset,X1, Y1, Z1, waitTime, holdTime))
+ return validparameter;
+
+ HTI_LOG_FORMAT( "X coord down = %d", X1 );
+ HTI_LOG_FORMAT( "Y coord down = %d", Y1 );
+ HTI_LOG_FORMAT( "Z coord down = %d", Z1 );
+ HTI_LOG_FORMAT( "Event wait time = %d", waitTime.Int() );
+ HTI_LOG_FORMAT( "Point holding time = %d", holdTime.Int() );
+
+ if ( waitTime.Int() < 0 || holdTime.Int() < 0 )
+ return validparameter;
+
+ // add move event from last point to this point
+ if (j!=0)
+ {
+ HTI_LOG_FORMAT( "Point dragging time = %d", dragTime.Int() );
+ HTI_LOG_FORMAT( "Step count between two points = %d", stepCount );
+ touch->InterpolatePointL(lastX, lastY, lastZ,X1,Y1,Z1,dragTime,stepCount);
+ }
+
+ // set last point
+ lastX=X1;
+ lastY=Y1;
+ lastZ=Z1;
+
+ // wait event
+ touch->AddPointL(waitTime,X1,Y1,Z1,TRawEvent::EButton1Down);
+
+ // hold event
+ touch->AddPointL(holdTime, X1,Y1,Z1,TRawEvent::EPointerMove);
+
+ if (j!=pointerCount-1)
+ {
+ // not last point
+ if (!ParseMove(aData, offset, dragTime, stepCount))
+ return validparameter;
+ if (dragTime.Int() < 0 || stepCount <= 0)
+ return validparameter;
+ }
+ else
+ {
+ // last point
+ touch->AddPointL(0,X1,Y1,Z1,TRawEvent::EButton1Up);
+ }
+ }
+
+ touch->PrintInfo();
+
+ }
+
+
+ for (TInt i=0;i<touchCount;i++)
+ iTouchPointerArray[i]->StartTouch();
+
+ validparameter=ETrue;
+
+ HTI_LOG_FUNC_OUT( "CMultiTouchPointerEventHandler::HandleMultiTouchL" );
+ return validparameter;
+ }
+
+void CMultiTouchPointerEventHandler::SimulateEvent(TUint8 aTouchNumber,
+ TInt aX, TInt aY, TInt aZ, TRawEvent::TType aEventType)
+ {
+ HTI_LOG_FUNC_IN( "CMultiTouchPointerEventHandler::SimulateEvent" );
+
+ TRawEvent rawEvent;
+ rawEvent.SetPointerNumber( aTouchNumber );
+ rawEvent.Set( aEventType, aX, aY, aZ);
+
+ HTI_LOG_FORMAT( "SimulatePointer touch number=%d ", aTouchNumber );
+ HTI_LOG_FORMAT( "SimulatePointer event=%d ", aEventType );
+ HTI_LOG_FORMAT( "SimulatePointer X=%d ", aX );
+ HTI_LOG_FORMAT( "SimulatePointer Y=%d ", aY );
+ HTI_LOG_FORMAT( "SimulatePointer Z=%d", aZ );
+
+ iWsSession.SimulateRawEvent( rawEvent );
+ iWsSession.Flush();
+
+ HTI_LOG_FUNC_OUT( "CMultiTouchPointerEventHandler::SimulateEvent" );
+
+ }
+
+// End of file
--- a/htiui/HtiServicePlugins/HtiKeyEventServicePlugin/src/PointerEventHandler.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiKeyEventServicePlugin/src/PointerEventHandler.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -19,6 +19,7 @@
#include "HtiKeyEventServicePlugin.h"
#include "PointerEventHandler.h"
+
#include <HtiDispatcherInterface.h>
#include <HtiLogging.h>
@@ -56,7 +57,7 @@
// CPointerEventHandler::CPointerEventHandler()
// ----------------------------------------------------------------------------
CPointerEventHandler::CPointerEventHandler()
- : CActive( CActive::EPriorityStandard ), iReady( ETrue ), iCommand( 0 ),
+ : CActive( CActive::EPriorityStandard ), iReady( ETrue ), iCommand( 0 ), iMultiTouchHandler(NULL),
iState( EPointerUp )
{
}
@@ -75,6 +76,7 @@
iCoords->Close();
}
delete iCoords;
+ delete iMultiTouchHandler;
iAdvancedPointers.ResetAndDestroy();
iDelayArray.ResetAndDestroy();
@@ -134,6 +136,7 @@
MoveToNextPointL(); // Continuing current line
}
}
+
else if ( iCommand == EPinchZoom )
{
PointerMove();
@@ -141,9 +144,17 @@
{
PointerUp();
SendOkMsgL();
+ iAdvPointerMoveArray.ResetAndDestroy();
iReady = ETrue;
}
}
+
+ else if ( iCommand == EMultiTouch )
+ {
+ SendOkMsgL();
+ iMultiTouchHandler->Clear();
+ iReady = ETrue;
+ }
HTI_LOG_FUNC_OUT( "CPointerEventHandler::RunL" );
}
@@ -216,7 +227,9 @@
case EPinchZoom:
HandlePinchZoomL( aMessage.Right( aMessage.Length() - 1 ) );
break;
-
+ case EMultiTouch:
+ HandleMultiTouchL(aMessage.Right( aMessage.Length() - 1 ));
+ break;
default:
SendErrorMessageL( EUnrecognizedCommand,
KErrorUnrecognizedCommand );
@@ -525,7 +538,13 @@
TTimeIntervalMicroSeconds32 eventDelay = ( aData[offset] + ( aData[offset+1] << 8 ) ) * 1000;
offset += 2;
HTI_LOG_FORMAT( "Event time = %d", eventDelay.Int() );
-
+
+ if (eventDelay.Int()<=0)
+ {
+ SendErrorMessageL( EInvalidParameters, KErrorInvalidParameters );
+ return;
+ }
+
TInt stepCount = aData[offset] + ( aData[offset+1] << 8 );
offset += 2;
HTI_LOG_FORMAT( "Step Count = %d", stepCount );
@@ -541,6 +560,12 @@
{
TInt pointNumber,X1, Y1, Z1,X2,Y2, Z2 ;
+ // invalid pointer array
+ if ((dataLength-offset)<3*2*2+1)
+ {
+ SendErrorMessageL( EInvalidParameters, KErrorInvalidParameters );
+ return;
+ }
// start point
pointNumber = aData[offset];
offset += 1;
@@ -588,7 +613,40 @@
HTI_LOG_FUNC_OUT( "CPointerEventHandler::HandlePinchZoomL" );
}
-
+// ----------------------------------------------------------------------------
+// void CPointerEventHandler::HandleMultiTouchL()
+// ----------------------------------------------------------------------------
+void CPointerEventHandler::HandleMultiTouchL( const TDesC8& aData )
+ {
+ HTI_LOG_FUNC_IN( "CPointerEventHandler::HandleMultiTouchL" );
+
+ if (iMultiTouchHandler == NULL)
+ iMultiTouchHandler=CMultiTouchPointerEventHandler::NewL(*this);
+
+ if ( !iMultiTouchHandler->HandleMultiTouchL ( aData ) )
+ {
+ iMultiTouchHandler->Clear();
+ SendErrorMessageL( EInvalidParameters, KErrorInvalidParameters );
+ }
+ else
+ iReady = EFalse;
+
+ HTI_LOG_FUNC_OUT( "CPointerEventHandler::HandleMultiTouchL" );
+ }
+// ----------------------------------------------------------------------------
+// void CPointerEventHandler::NotifyMultiTouchComplete()
+// ----------------------------------------------------------------------------
+void CPointerEventHandler::NotifyMultiTouchComplete()
+ {
+ HTI_LOG_FUNC_IN("CPointerEventHandler::NotifyMultiTouchComplete");
+
+ // wait for 1000 microsecond then clear multi touch and send ok msg
+ TTimeIntervalMicroSeconds32 time(1000);
+ iTimer.After( iStatus, time );
+ SetActive();
+
+ HTI_LOG_FUNC_OUT("CPointerEventHandler::NotifyMultiTouchComplete");
+ }
// ----------------------------------------------------------------------------
// CPointerEventHandler::AdvancedStartDelay()
// ----------------------------------------------------------------------------
--- a/htiui/HtiServicePlugins/HtiMessagesServicePlugin/inc/HtiIAPHandler.h Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiMessagesServicePlugin/inc/HtiIAPHandler.h Fri Apr 16 14:59:17 2010 +0300
@@ -22,7 +22,7 @@
// INCLUDES
#include <cmpsettingsconsts.h>
-#include <HTIServicePluginInterface.h>
+#include <HtiServicePluginInterface.h>
// CONSTANTS
--- a/htiui/HtiServicePlugins/HtiMessagesServicePlugin/inc/HtiMailboxHandler.h Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiMessagesServicePlugin/inc/HtiMailboxHandler.h Fri Apr 16 14:59:17 2010 +0300
@@ -22,7 +22,7 @@
// INCLUDES
#include <cmmanager.h>
#include <msvapi.h>
-#include <HTIServicePluginInterface.h>
+#include <HtiServicePluginInterface.h>
// CONSTANTS
--- a/htiui/HtiServicePlugins/HtiMessagesServicePlugin/inc/HtiMessagesServicePlugin.h Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiMessagesServicePlugin/inc/HtiMessagesServicePlugin.h Fri Apr 16 14:59:17 2010 +0300
@@ -21,7 +21,7 @@
#define CHTIMESSAGESSERVICEPLUGIN_H
// INCLUDES
-#include <HTIServicePluginInterface.h>
+#include <HtiServicePluginInterface.h>
// CONSTANTS
const TInt KHtiMessagesServiceUidValue = 0x10210CCF; // ECOM Implementation UID
--- a/htiui/HtiServicePlugins/HtiMessagesServicePlugin/inc/HtiMsgSettingsHandler.h Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiMessagesServicePlugin/inc/HtiMsgSettingsHandler.h Fri Apr 16 14:59:17 2010 +0300
@@ -21,7 +21,7 @@
// INCLUDES
-#include <HTIServicePluginInterface.h>
+#include <HtiServicePluginInterface.h>
// CONSTANTS
--- a/htiui/HtiServicePlugins/HtiMessagesServicePlugin/inc/MessageMgmntHandler.h Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiMessagesServicePlugin/inc/MessageMgmntHandler.h Fri Apr 16 14:59:17 2010 +0300
@@ -22,7 +22,7 @@
// INCLUDES
#include <msvapi.h>
-#include <HTIServicePluginInterface.h>
+#include <HtiServicePluginInterface.h>
// CONSTANTS
--- a/htiui/HtiServicePlugins/HtiMessagesServicePlugin/src/HtiIAPHandler.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiMessagesServicePlugin/src/HtiIAPHandler.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -21,7 +21,7 @@
#include "HtiIAPHandler.h"
#include <HtiDispatcherInterface.h>
-#include <HTILogging.h>
+#include <HtiLogging.h>
#include <cmconnectionmethodext.h>
#include <cmconnectionmethoddef.h>
#include <cmdestinationext.h>
@@ -30,7 +30,7 @@
#include <cmpluginhscsddef.h>
#include <cmpluginpacketdatadef.h>
#include <cmpluginwlandef.h>
-#include <RConnMon.h>
+#include <rconnmon.h>
using namespace CMManager;
--- a/htiui/HtiServicePlugins/HtiMessagesServicePlugin/src/HtiMailboxHandler.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiMessagesServicePlugin/src/HtiMailboxHandler.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -26,13 +26,13 @@
#include <iapprefs.h>
#include <imapset.h>
#include <mtmuibas.h>
-#include <senduiconsts.h>
+#include <SendUiConsts.h>
#include <pop3set.h>
#include <smtpset.h>
#include <txtrich.h>
#include <HtiDispatcherInterface.h>
-#include <HTILogging.h>
+#include <HtiLogging.h>
#include "HtiMessagesServicePlugin.h"
#include "HtiMailboxHandler.h"
--- a/htiui/HtiServicePlugins/HtiMessagesServicePlugin/src/HtiMessagesServicePlugin.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiMessagesServicePlugin/src/HtiMessagesServicePlugin.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -24,7 +24,7 @@
#include "HtiMsgSettingsHandler.h"
#include <HtiDispatcherInterface.h>
-#include <HTILogging.h>
+#include <HtiLogging.h>
// CONSTANTS
_LIT8( KErrorMissingCommand, "Command was not given - message was empty" );
--- a/htiui/HtiServicePlugins/HtiMessagesServicePlugin/src/HtiMsgSettingsHandler.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiMessagesServicePlugin/src/HtiMsgSettingsHandler.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -21,7 +21,7 @@
#include "HtiMsgSettingsHandler.h"
#include <HtiDispatcherInterface.h>
-#include <HTILogging.h>
+#include <HtiLogging.h>
#include <cmconnectionmethod.h>
#include <cmconnectionmethoddef.h>
@@ -31,7 +31,7 @@
#include <csmsaccount.h>
#include <mmssettings.h>
#include <smutset.h>
-#include <CentralRepository.h>
+#include <centralrepository.h>
// EXTERNAL DATA STRUCTURES
--- a/htiui/HtiServicePlugins/HtiMessagesServicePlugin/src/MessageMgmntHandler.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiMessagesServicePlugin/src/MessageMgmntHandler.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -21,7 +21,7 @@
#include "MessageMgmntHandler.h"
#include <HtiDispatcherInterface.h>
-#include <HTILogging.h>
+#include <HtiLogging.h>
#include <mtclreg.h>
#include <smscmds.h>
#include <smtcmtm.h>
@@ -374,6 +374,18 @@
TBool isNew = (TBool)aData[position];
TBool isUnread = (TBool)aData[position+1];
TFolder folder = (TFolder)aData[position+2];
+ TInt extraAttNum;
+ position += 3;
+ TInt len = aData.Length();
+ if( aData.Length() > position )
+ {
+ extraAttNum = (TInt)aData[position];
+ }
+ else
+ {
+ extraAttNum = 0;
+ }
+ position++;
HTI_LOG_TEXT( "Creating MMS Client MTM" );
CMmsClientMtm* mmsMtm = NULL;
@@ -539,72 +551,154 @@
// handle attachment
TBool attachmentsExist = EFalse;
- if ( attPath->Length() > 0 )
- {
- HTI_LOG_TEXT( "Handling attachment..." );
- // check that attachment exists
- RFs fsSession;
- if ( fsSession.Connect() != KErrNone )
+ if ( attPath->Length() > 0 )
+ {
+ HTI_LOG_TEXT( "Handling attachment..." );
+ // check that attachment exists
+ RFs fsSession;
+ if ( fsSession.Connect() != KErrNone )
+ {
+ HTI_LOG_FORMAT( "Error in connecting to file server session: %d", err );
+ SendErrorMessageL( KErrCouldNotConnect, KErrorRfsConnectFailed );
+ CleanupStack::PopAndDestroy( store );
+ CleanupStack::PopAndDestroy( mmsMtm );
+ CleanupStack::PopAndDestroy( attPath );
+ CleanupStack::PopAndDestroy( body );
+ CleanupStack::PopAndDestroy( description );
+ CleanupStack::PopAndDestroy( fromTo );
+ return;
+ }
+
+ TBool fileExists = BaflUtils::FileExists( fsSession, attPath->Des() );
+ fsSession.Close();
+ if ( !fileExists )
+ {
+ HTI_LOG_TEXT( "Attachment file not found" );
+ SendErrorMessageL( KErrPathNotFound, KErrorAttachmentNotFound );
+ store->RevertL();
+ CleanupStack::PopAndDestroy( store );
+ CleanupStack::PopAndDestroy( mmsMtm );
+ CleanupStack::PopAndDestroy( attPath );
+ CleanupStack::PopAndDestroy( body );
+ CleanupStack::PopAndDestroy( description );
+ CleanupStack::PopAndDestroy( fromTo );
+ return;
+ }
+ else
+ {
+ // save the attachment
+ TParse parser;
+ parser.Set( *attPath, NULL, NULL);
+ TFileName shortFileName = parser.NameAndExt();
+
+ // get the mime type
+ RApaLsSession ls;
+ User::LeaveIfError( ls.Connect() );
+ CleanupClosePushL( ls );
+ TUid appUid;
+ TDataType dataType;
+ ls.AppForDocument( *attPath, appUid, dataType );
+ CleanupStack::PopAndDestroy(); // ls
+ TPtrC8 mimeType = dataType.Des8();
+
+ // attachment settings
+ // ownership of attachment will be transferred
+ CMsvAttachment* attachment = CMsvAttachment::NewL(
+ CMsvAttachment::EMsvFile );
+ attachment->SetAttachmentNameL( shortFileName );
+ attachment->SetMimeTypeL( mimeType );
+
+ // save
+ CWaiter* waiter = CWaiter::NewLC();
+ attachMan.AddAttachmentL( *attPath, attachment, waiter->iStatus );
+ waiter->StartAndWait();
+ CleanupStack::PopAndDestroy( waiter );
+ attachmentsExist = ETrue;
+ }
+ }
+
+ do
+ {
+ HBufC16* attPath2;
+ if(extraAttNum-- > 0)
{
- HTI_LOG_FORMAT( "Error in connecting to file server session: %d", err );
- SendErrorMessageL( KErrCouldNotConnect, KErrorRfsConnectFailed );
- CleanupStack::PopAndDestroy( store );
- CleanupStack::PopAndDestroy( mmsMtm );
- CleanupStack::PopAndDestroy( attPath );
- CleanupStack::PopAndDestroy( body );
- CleanupStack::PopAndDestroy( description );
- CleanupStack::PopAndDestroy( fromTo );
- return;
- }
-
- TBool fileExists = BaflUtils::FileExists( fsSession, attPath->Des() );
- fsSession.Close();
- if ( !fileExists )
- {
- HTI_LOG_TEXT( "Attachment file not found" );
- SendErrorMessageL( KErrPathNotFound, KErrorAttachmentNotFound );
- store->RevertL();
- CleanupStack::PopAndDestroy( store );
- CleanupStack::PopAndDestroy( mmsMtm );
- CleanupStack::PopAndDestroy( attPath );
- CleanupStack::PopAndDestroy( body );
- CleanupStack::PopAndDestroy( description );
- CleanupStack::PopAndDestroy( fromTo );
- return;
+ attPath2 = ExtractDesLC( aData, position, 1 );
}
else
{
- // save the attachment
- TParse parser;
- parser.Set( *attPath, NULL, NULL);
- TFileName shortFileName = parser.NameAndExt();
-
- // get the mime type
- RApaLsSession ls;
- User::LeaveIfError( ls.Connect() );
- CleanupClosePushL( ls );
- TUid appUid;
- TDataType dataType;
- ls.AppForDocument( *attPath, appUid, dataType );
- CleanupStack::PopAndDestroy(); // ls
- TPtrC8 mimeType = dataType.Des8();
+ break;
+ }
- // attachment settings
- // ownership of attachment will be transferred
- CMsvAttachment* attachment = CMsvAttachment::NewL(
- CMsvAttachment::EMsvFile );
- attachment->SetAttachmentNameL( shortFileName );
- attachment->SetMimeTypeL( mimeType );
+ if ( attPath2->Length() > 0 )
+ {
+ HTI_LOG_TEXT( "Handling attachment..." );
+ // check that attachment exists
+ RFs fsSession;
+ if ( fsSession.Connect() != KErrNone )
+ {
+ HTI_LOG_FORMAT( "Error in connecting to file server session: %d", err );
+ SendErrorMessageL( KErrCouldNotConnect, KErrorRfsConnectFailed );
+ CleanupStack::PopAndDestroy( store );
+ CleanupStack::PopAndDestroy( mmsMtm );
+ CleanupStack::PopAndDestroy( attPath );
+ CleanupStack::PopAndDestroy( body );
+ CleanupStack::PopAndDestroy( description );
+ CleanupStack::PopAndDestroy( fromTo );
+ CleanupStack::PopAndDestroy( attPath2 );
+ return;
+ }
+
+ TBool fileExists = BaflUtils::FileExists( fsSession, attPath2->Des() );
+ fsSession.Close();
+ if ( !fileExists )
+ {
+ HTI_LOG_TEXT( "Attachment file not found" );
+ SendErrorMessageL( KErrPathNotFound, KErrorAttachmentNotFound );
+ store->RevertL();
+ CleanupStack::PopAndDestroy( store );
+ CleanupStack::PopAndDestroy( mmsMtm );
+ CleanupStack::PopAndDestroy( attPath );
+ CleanupStack::PopAndDestroy( body );
+ CleanupStack::PopAndDestroy( description );
+ CleanupStack::PopAndDestroy( fromTo );
+ CleanupStack::PopAndDestroy( attPath2 );
+ return;
+ }
+ else
+ {
+ // save the attachment
+ TParse parser;
+ parser.Set( *attPath2, NULL, NULL);
+ TFileName shortFileName = parser.NameAndExt();
+
+ // get the mime type
+ RApaLsSession ls;
+ User::LeaveIfError( ls.Connect() );
+ CleanupClosePushL( ls );
+ TUid appUid;
+ TDataType dataType;
+ ls.AppForDocument( *attPath2, appUid, dataType );
+ CleanupStack::PopAndDestroy(); // ls
+ TPtrC8 mimeType = dataType.Des8();
+
+ // attachment settings
+ // ownership of attachment will be transferred
+ CMsvAttachment* attachment = CMsvAttachment::NewL(
+ CMsvAttachment::EMsvFile );
+ attachment->SetAttachmentNameL( shortFileName );
+ attachment->SetMimeTypeL( mimeType );
+
+ // save
+ CWaiter* waiter = CWaiter::NewLC();
+ attachMan.AddAttachmentL( *attPath2, attachment, waiter->iStatus );
+ waiter->StartAndWait();
+ CleanupStack::PopAndDestroy( waiter );
+ attachmentsExist = ETrue;
+ }
- // save
- CWaiter* waiter = CWaiter::NewLC();
- attachMan.AddAttachmentL( *attPath, attachment, waiter->iStatus );
- waiter->StartAndWait();
- CleanupStack::PopAndDestroy( waiter );
- attachmentsExist = ETrue;
- }
- }
-
+ CleanupStack::PopAndDestroy( attPath2 );
+ }
+ } while(ETrue);
// save the changes made to the message store
store->CommitL();
CleanupStack::PopAndDestroy( store );
@@ -691,6 +785,18 @@
TBool isNew = (TBool)aData[position];
TBool isUnread = (TBool)aData[position+1];
TFolder folder = (TFolder)aData[position+2];
+ TInt extraAttNum;
+ position += 3;
+ TInt len = aData.Length();
+ if( aData.Length() > position )
+ {
+ extraAttNum = (TInt)aData[position];
+ }
+ else
+ {
+ extraAttNum = 0;
+ }
+ position++;
HTI_LOG_TEXT( "Creating SMTP Client MTM" );
CSmtpClientMtm* smtpMtm = NULL;
@@ -845,6 +951,73 @@
CleanupStack::PopAndDestroy(); // fsSession
}
+ do
+ {
+ HBufC16* attPath2;
+ if(extraAttNum-- > 0)
+ {
+ attPath2 = ExtractDesLC( aData, position, 1 );
+ }
+ else
+ {
+ break;
+ }
+ // check that attachment exists
+ RFs fsSession;
+ if ( fsSession.Connect() != KErrNone )
+ {
+ HTI_LOG_FORMAT( "Error in connecting to file server session: %d", err );
+ SendErrorMessageL( KErrCouldNotConnect, KErrorRfsConnectFailed );
+ CleanupStack::PopAndDestroy( smtpMtm );
+ CleanupStack::PopAndDestroy( attPath );
+ CleanupStack::PopAndDestroy( body );
+ CleanupStack::PopAndDestroy( description );
+ CleanupStack::PopAndDestroy( fromTo );
+ CleanupStack::PopAndDestroy( attPath2 );
+ return;
+ }
+ CleanupClosePushL( fsSession );
+
+ TBool fileExists = BaflUtils::FileExists( fsSession, attPath2->Des() );
+ if ( !fileExists )
+ {
+ HTI_LOG_TEXT( "Attachment file not found" );
+ SendErrorMessageL( KErrPathNotFound, KErrorAttachmentNotFound );
+ CleanupStack::PopAndDestroy(); // fsSession
+ CleanupStack::PopAndDestroy( smtpMtm );
+ CleanupStack::PopAndDestroy( attPath );
+ CleanupStack::PopAndDestroy( body );
+ CleanupStack::PopAndDestroy( description );
+ CleanupStack::PopAndDestroy( fromTo );
+ CleanupStack::PopAndDestroy( attPath2 );
+ return;
+ }
+ else
+ {
+ // get the mime type
+ HTI_LOG_TEXT( "Getting the attachment's mime type" );
+ RApaLsSession ls;
+ User::LeaveIfError( ls.Connect() );
+ TUid appUid;
+ TDataType dataType;
+ ls.AppForDocument( *attPath2, appUid, dataType );
+ TPtrC8 mimeType = dataType.Des8();
+
+ HTI_LOG_TEXT( "Adding the attachment" );
+ CWaiter* waiter = CWaiter::NewLC();
+ smtpMtm->AddAttachmentL( attPath2->Des(), mimeType, charset,
+ waiter->iStatus );
+ waiter->StartAndWait();
+ CleanupStack::PopAndDestroy( waiter );
+ HTI_LOG_TEXT( "Attachment added succesfully" );
+ ls.Close();
+ attachmentsExist = ETrue;
+ }
+
+ CleanupStack::PopAndDestroy(); // fsSession
+ CleanupStack::PopAndDestroy( attPath2 );
+ } while(ETrue);
+
// save the message
smtpMtm->SaveMessageL();
@@ -1574,6 +1747,28 @@
1 + // is unread
1; // folder
+ TInt extraAttPathLength = 0;
+ TInt extraAttNum = 0;
+ TInt extraNumLen = 0;
+ if( wholeLength < aData.Length() )
+ {
+ offset = wholeLength;
+ extraAttNum = aData[offset];
+ offset ++;
+
+ extraNumLen = 1;
+
+ while( offset < aData.Length() && extraAttNum > 0)
+ {
+ extraAttPathLength += aData[offset];
+ extraAttPathLength ++;
+ extraAttNum --;
+ offset += 1 + aData[offset];
+ }
+ }
+
+ wholeLength += extraNumLen + extraAttPathLength;
+
if ( wholeLength != aData.Length() )
{
HTI_LOG_TEXT( "Error: wrong length of data (wholeLength)" );
--- a/htiui/HtiServicePlugins/HtiPIMServicePlugin/src/HtiSimDirHandlerVPbk.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiPIMServicePlugin/src/HtiSimDirHandlerVPbk.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -67,6 +67,8 @@
_LIT8( KErrorSimStoreOpenFailed, "Failed to open SIM contact store" );
_LIT8( KErrorSimStoreUnavailable, "SIM contact store unavailable" );
+_LIT8( KErrorContactOperationFailed, "SIM contact operation failed" );
+
// MODULE DATA STRUCTURES
// LOCAL FUNCTION PROTOTYPES
@@ -420,13 +422,16 @@
// Called when a contact operation has failed.
// From MVPbkContactObserver
// ----------------------------------------------------------------------------
-void CHtiSimDirHandlerVPbk::ContactOperationFailed( TContactOp /*aOpCode*/,
- TInt /*aErrorCode*/,
- TBool /*aErrorNotified*/ )
+void CHtiSimDirHandlerVPbk::ContactOperationFailed( TContactOp aOpCode,
+ TInt aErrorCode,
+ TBool aErrorNotified )
{
HTI_LOG_FUNC_IN( "CHtiSimDirHandlerVPbk::ContactOperationFailed" );
-
+ HTI_LOG_FORMAT( "aOpCode: %d", aOpCode );
+ HTI_LOG_FORMAT( "aErrorCode: %d", aErrorCode );
+ HTI_LOG_FORMAT( "aErrorNotified: %d", aErrorNotified );
+ TRAP_IGNORE( SendErrorMessageL( aErrorCode, KErrorContactOperationFailed ) );
HTI_LOG_FUNC_OUT( "CHtiSimDirHandlerVPbk::ContactOperationFailed" );
}
@@ -767,6 +772,7 @@
break;
case EAdditNumberField:
param.Add( EVPbkVersitParamCELL );
+ param.Add( EVPbkVersitParamHOME );
prop.SetName( EVPbkVersitNameTEL );
prop.SetParameters( param );
fieldType = iContactManager->FieldTypes().FindMatch( prop, 0 );
--- a/htiui/HtiServicePlugins/HtiScreenshotServicePlugin/group/HtiScreenshotServicePlugin.mmp Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiScreenshotServicePlugin/group/HtiScreenshotServicePlugin.mmp Fri Apr 16 14:59:17 2010 +0300
@@ -17,6 +17,7 @@
#include <platform_paths.hrh>
+#include "../../../symbian_version.hrh"
TARGET HtiScreenshotServicePlugin.dll
TARGETTYPE PLUGIN
@@ -40,7 +41,10 @@
TARGET HtiScreenshotServicePlugin.rsc
END
-LIBRARY avkon.lib // AknUtils for font handling
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
+LIBRARY avkon.lib
+#endif
+
LIBRARY bitgdi.lib
LIBRARY ecom.lib
LIBRARY efsrv.lib
@@ -53,6 +57,7 @@
LIBRARY imageconversion.lib
LIBRARY ws32.lib
LIBRARY flogger.lib
+LIBRARY apgrfx.lib
SMPSAFE
--- a/htiui/HtiServicePlugins/HtiScreenshotServicePlugin/inc/HtiScreenshotServicePlugin.h Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiScreenshotServicePlugin/inc/HtiScreenshotServicePlugin.h Fri Apr 16 14:59:17 2010 +0300
@@ -232,7 +232,10 @@
//void InitFontCache();
TBool IsMIMETypeSupported(TDesC8 &aMime);
-
+
+ void SetScreenNumber(TInt aScreenNumber);
+
+ void HandleRotateScreen(const TDesC8& aData);
protected:
CFbsBitmap* iScreen; //raw screen bitmap
HBufC8* iEncodedBitmap; //ready to send
--- a/htiui/HtiServicePlugins/HtiScreenshotServicePlugin/src/HtiScreenshotServicePlugin.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiScreenshotServicePlugin/src/HtiScreenshotServicePlugin.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -17,6 +17,9 @@
// INCLUDE FILES
+#include "../../../symbian_version.hrh"
+
+
#include "HtiScreenshotServicePlugin.h"
#include <HtiDispatcherInterface.h>
#include <HtiLogging.h>
@@ -25,6 +28,14 @@
#include <ezcompressor.h>
#include <hal.h>
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
+
+#include <AknLayoutConfig.h>
+#include <apgtask.h>
+#include <AknCapServerDefs.h>
+
+#endif
+
// CONSTANTS
const static TUid KScreenshotServiceUid = {0x1020DEC3};
@@ -55,6 +66,9 @@
// Gets the current screen size and orientation
ECmdScreenMode = 0x3A,
+
+ // Rotates the screen to portrait or landscape
+ ECmdRotateScreen = 0x3B,
// Screencapture on updated part of screen only
ECmdDeltaCaptureMask = 0x80,
@@ -91,14 +105,16 @@
const static TInt KMinScreenRegionCmdLength = 9;
const static TInt KScreenDisplayOffset = 1;
const static TInt KScreenMIMEOffset = KScreenDisplayOffset + 1;
+const static TInt KScreenScreenNumber = KScreenMIMEOffset + 8;
const static TInt KRegionDisplayOffset = KMinScreenRegionCmdLength;
const static TInt KRegionMIMEOffset = KRegionDisplayOffset + 1;
-
+const static TInt KRegionScreenNumber = KRegionMIMEOffset + 8;
const static TInt KSeriesDurationOffset = 1;
const static TInt KSeriesIntervalOffset = KSeriesDurationOffset + 4;
const static TInt KSeriesDisplayOffset = KSeriesIntervalOffset + 4;
const static TInt KSeriesMIMEOffset = KSeriesDisplayOffset + 1;
+const static TInt KSeriesScreenNumber = KSeriesMIMEOffset + 8;
const static TInt KMinSeriesCmdLength = KSeriesMIMEOffset;
const static TInt KRegionSeriesTlX = KSeriesDisplayOffset + 1;
@@ -106,6 +122,7 @@
const static TInt KRegionSeriesBlX = KRegionSeriesTlY + 2;
const static TInt KRegionSeriesBlY = KRegionSeriesBlX + 2;
const static TInt KRegionSeriesMIMEOffset = KRegionSeriesBlY + 2;
+const static TInt KRegionSeriesScreenNumber = KRegionSeriesMIMEOffset + 8;
const static TInt KMinRegionSeriesCmdLength = KRegionSeriesMIMEOffset;
const static TInt KDeltaResetCmdLength = 1;
@@ -113,6 +130,7 @@
const static TInt KScreenNrOffset = 1;
const static TInt KSelectScreenCmdLength = 2;
+const static TInt KRotateScreenCmdLength = 2;
_LIT( KSeriesShotPath, "c:\\Hti\\SeriesShot\\" );
@@ -1189,11 +1207,44 @@
}
}
+ bool screenNumberSet = false;
+ //check screen number
+ if ( (aMessage.Length() > KScreenScreenNumber) &&
+ ((aMessage[aMessage.Length()-1] == 0) || (aMessage[aMessage.Length()-1] == 1)))
+ {
+ TInt screenNumber = aMessage[aMessage.Length()-1];
+ HTI_LOG_FORMAT( "set screen number: %d", screenNumber );
+ screenNumberSet = true;
+ TInt screens;
+ TInt ret = HAL::Get(HAL::EDisplayNumberOfScreens, screens);
+ if(ret)
+ {
+ HTI_LOG_FORMAT( "HAL::Get failed %d", ret );
+ User::Leave(ret);
+ }
+ HTI_LOG_FORMAT( "HAL::Get number of screens %d", screens );
+ if( ( screenNumber>screens-1 ) || ( screenNumber<0 ) )
+ {
+ iDispatcher->DispatchOutgoingErrorMessage(
+ KErrArgument, KErrDescrScreenNotSupported, KScreenshotServiceUid);
+ return;
+ }
+ SetScreenNumber(screenNumber);
+ }
+
CreateBitmapL( empty, displayMode );
+
//check mime
if ( aMessage.Length() > KScreenMIMEOffset )
{
- mime.Set( aMessage.Mid( KScreenMIMEOffset ) );
+ if(screenNumberSet)
+ {
+ mime.Set( aMessage.Mid( KScreenMIMEOffset, aMessage.Length()-1-KScreenMIMEOffset ) );
+ }
+ else
+ {
+ mime.Set( aMessage.Mid( KScreenMIMEOffset ) );
+ }
if ( !IsMIMETypeSupported( mime ) )
{
iDispatcher->DispatchOutgoingErrorMessage(
@@ -1203,7 +1254,7 @@
return;
}
}
- }
+ }
break;
case ECmdScreenRegion:
@@ -1211,6 +1262,30 @@
case ECmdDeltaScreenRegion:
case ECmdDeltaScreenRegionZip:
{
+ //check screen number
+ bool screenNumberSet = false;
+ if ( (aMessage.Length() > KRegionScreenNumber) &&
+ ((aMessage[aMessage.Length()-1] == 0) || (aMessage[aMessage.Length()-1] == 1)))
+ {
+ TInt screenNumber = aMessage[aMessage.Length()-1];
+ screenNumberSet = true;
+ TInt screens;
+ TInt ret = HAL::Get(HAL::EDisplayNumberOfScreens, screens);
+ if(ret)
+ {
+ HTI_LOG_FORMAT( "HAL::Get failed %d", ret );
+ User::Leave(ret);
+ }
+ HTI_LOG_FORMAT( "HAL::Get number of screens %d", screens );
+ if( ( screenNumber>screens-1 ) || ( screenNumber<0 ) )
+ {
+ iDispatcher->DispatchOutgoingErrorMessage(
+ KErrArgument, KErrDescrScreenNotSupported, KScreenshotServiceUid);
+ return;
+ }
+ SetScreenNumber(screenNumber);
+ }
+
if ( aMessage.Length() >= KMinScreenRegionCmdLength )
{
TRect region;
@@ -1271,11 +1346,18 @@
KScreenshotServiceUid );
return;
}
-
+
//check mime
if ( aMessage.Length() > KRegionMIMEOffset )
{
- mime.Set( aMessage.Mid( KRegionMIMEOffset ) );
+ if(!screenNumberSet)
+ {
+ mime.Set( aMessage.Mid( KRegionMIMEOffset ) );
+ }
+ else
+ {
+ mime.Set( aMessage.Mid( KRegionMIMEOffset, aMessage.Length()-1-KRegionMIMEOffset ) );
+ }
if ( !IsMIMETypeSupported( mime ) )
{
iDispatcher->DispatchOutgoingErrorMessage(
@@ -1285,6 +1367,7 @@
return;
}
}
+
}
else
{
@@ -1308,6 +1391,30 @@
KScreenshotServiceUid );
return;
}
+
+ bool screenNumberSet = false;
+ if ( (aMessage.Length() > KSeriesScreenNumber) &&
+ ((aMessage[aMessage.Length()-1] == 0) || (aMessage[aMessage.Length()-1] == 1)) )
+ {
+ TInt screenNumber = aMessage[aMessage.Length()-1];
+ screenNumberSet = true;
+ TInt screens;
+ TInt ret = HAL::Get(HAL::EDisplayNumberOfScreens, screens);
+ if(ret)
+ {
+ HTI_LOG_FORMAT( "HAL::Get failed %d", ret );
+ User::Leave(ret);
+ }
+ HTI_LOG_FORMAT( "HAL::Get number of screens %d", screens );
+ if( ( screenNumber>screens-1 ) || ( screenNumber<0 ) )
+ {
+ iDispatcher->DispatchOutgoingErrorMessage(
+ KErrArgument, KErrDescrScreenNotSupported, KScreenshotServiceUid);
+ return;
+ }
+ SetScreenNumber(screenNumber);
+ }
+
TInt duration = ParseInt32( aMessage.Ptr() + KSeriesDurationOffset );
TInt interval = ParseInt32( aMessage.Ptr() + KSeriesIntervalOffset );
@@ -1320,10 +1427,17 @@
KScreenshotServiceUid );
return;
}
-
+
if ( aMessage.Length() > KSeriesMIMEOffset )
{
- mime.Set( aMessage.Mid( KSeriesMIMEOffset ) );
+ if(screenNumberSet)
+ {
+ mime.Set( aMessage.Mid( KSeriesMIMEOffset, aMessage.Length()-1-KSeriesMIMEOffset ) );
+ }
+ else
+ {
+ mime.Set( aMessage.Mid( KSeriesMIMEOffset ) );
+ }
if ( !IsMIMETypeSupported( mime ) )
{
iDispatcher->DispatchOutgoingErrorMessage(
@@ -1342,6 +1456,29 @@
case ECmdScreenRegionSeries:
case ECmdScreenRegionZipSeries:
{
+ bool screenNumberSet = false;
+ if ( (aMessage.Length() > KRegionSeriesScreenNumber) &&
+ ((aMessage[aMessage.Length()-1] == 0) || (aMessage[aMessage.Length()-1] == 1)) )
+ {
+ TInt screenNumber = aMessage[aMessage.Length()-1];
+ screenNumberSet = true;
+ TInt screens;
+ TInt ret = HAL::Get(HAL::EDisplayNumberOfScreens, screens);
+ if(ret)
+ {
+ HTI_LOG_FORMAT( "HAL::Get failed %d", ret );
+ User::Leave(ret);
+ }
+ HTI_LOG_FORMAT( "HAL::Get number of screens %d", screens );
+ if( ( screenNumber>screens-1 ) || ( screenNumber<0 ) )
+ {
+ iDispatcher->DispatchOutgoingErrorMessage(
+ KErrArgument, KErrDescrScreenNotSupported, KScreenshotServiceUid);
+ return;
+ }
+ SetScreenNumber(screenNumber);
+ }
+
if ( aMessage.Length() < KMinRegionSeriesCmdLength )
{
iDispatcher->DispatchOutgoingErrorMessage(
@@ -1403,10 +1540,17 @@
KScreenshotServiceUid );
return;
}
-
+
if ( aMessage.Length() > KRegionSeriesMIMEOffset )
{
- mime.Set( aMessage.Mid( KRegionSeriesMIMEOffset ) );
+ if(screenNumberSet)
+ {
+ mime.Set( aMessage.Mid( KRegionSeriesMIMEOffset, aMessage.Length()-1-KRegionSeriesMIMEOffset ) );
+ }
+ else
+ {
+ mime.Set( aMessage.Mid( KRegionSeriesMIMEOffset ) );
+ }
if ( !IsMIMETypeSupported( mime ) )
{
iDispatcher->DispatchOutgoingErrorMessage(
@@ -1526,7 +1670,17 @@
respMsg.AllocL(), KScreenshotServiceUid );
}
return;
-
+ case ECmdRotateScreen:
+ {
+ if (aMessage.Length() != KRotateScreenCmdLength)
+ {
+ iDispatcher->DispatchOutgoingErrorMessage(KErrArgument,
+ KErrDescrInvalid, KScreenshotServiceUid);
+ return;
+ }
+ HandleRotateScreen(aMessage.Right(aMessage.Length() -1));
+ return;
+ }
default:
//Error: unknown command
iDispatcher->DispatchOutgoingErrorMessage(
@@ -1559,7 +1713,109 @@
HTI_LOG_FUNC_OUT( "HtiScreenshotServicePlugin::ProcessMessage" );
}
+// ----------------------------------------------------------------------------
+void CHtiScreenshotServicePlugin::HandleRotateScreen(const TDesC8& aData)
+ {
+ HTI_LOG_FUNC_IN( "CHtiScreenshotServicePlugin::HandleRotateScreen" );
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
+ TInt orientation = aData[0];
+ if (orientation > 1 || orientation < 0)
+ {
+ iDispatcher->DispatchOutgoingErrorMessage(KErrArgument,
+ KErrDescrInvalid, KScreenshotServiceUid);
+ return;
+ }
+ TBool isLandScape = orientation;
+
+ RWsSession ws;
+ User::LeaveIfError(ws.Connect());
+ CWsScreenDevice* screenDevice = new (ELeave) CWsScreenDevice(ws);
+ CleanupStack::PushL(screenDevice);
+ User::LeaveIfError(screenDevice->Construct());
+ TSize currentScreenSize = screenDevice->SizeInPixels();
+
+ TBool needsRotating = ETrue;
+ if (currentScreenSize.iWidth > currentScreenSize.iHeight && isLandScape)
+ {
+ // we are already in landscape
+ HTI_LOG_TEXT("The screen are already in landscape.");
+ needsRotating = EFalse;
+ }
+ if (currentScreenSize.iWidth < currentScreenSize.iHeight
+ && (!isLandScape))
+ {
+ // we are already in portrait
+ HTI_LOG_TEXT("The screen are already in portrait.");
+ needsRotating = EFalse;
+ }
+
+ CAknLayoutConfig* layoutConfigPtr = CAknLayoutConfig::NewL();
+ CleanupStack::PushL(layoutConfigPtr);
+
+ CAknLayoutConfig& layoutConfig = *layoutConfigPtr;
+
+ const CAknLayoutConfig::THardwareStateArray& hwStates =
+ layoutConfig.HardwareStates();
+ const CAknLayoutConfig::TScreenModeArray& screenModes =
+ layoutConfig.ScreenModes();
+
+ TInt newHwStateIndex = KErrNotFound;
+
+ // lets select alternate state from current
+ TSize newScreenSize;
+ if (needsRotating)
+ {
+ newScreenSize = TSize(currentScreenSize.iHeight,
+ currentScreenSize.iWidth);
+ HTI_LOG_FORMAT("Rotate the screen to the new width %d", newScreenSize.iWidth);
+ HTI_LOG_FORMAT("Rotate the screen to the new height %d", newScreenSize.iHeight);
+ }
+ else // basicly select current state again to ensure correct mode is informed to akncapserver
+ {
+ newScreenSize = TSize(currentScreenSize.iWidth,
+ currentScreenSize.iHeight);
+ }
+
+ for (TInt i = 0; i < hwStates.Count(); i++)
+ {
+ const CAknLayoutConfig::THardwareState hwState = hwStates.At(i);
+
+ const CAknLayoutConfig::TScreenMode normal = screenModes.Find(
+ hwState.ScreenMode());
+
+ if (normal.SizeInPixels() == newScreenSize)
+ {
+ newHwStateIndex = i;
+ break;
+ }
+ }
+
+ if (newHwStateIndex >= 0)
+ {
+ const CAknLayoutConfig::THardwareState newHwState = hwStates.At(
+ newHwStateIndex);
+ TApaTaskList taskList(ws);
+ TApaTask aknCapsrvTask = taskList.FindApp(KAknCapServerUid);
+ TInt keyCode = newHwState.KeyCode();
+ HTI_LOG_FORMAT( "Send key code %d to akncapserver", keyCode );
+ aknCapsrvTask.SendKey(keyCode, 0);
+ }
+
+ TBuf8<1> okMsg;
+ okMsg.Append(0);
+ iDispatcher->DispatchOutgoingMessage(okMsg.AllocL(),
+ KScreenshotServiceUid);
+
+ CleanupStack::PopAndDestroy(layoutConfigPtr);
+ CleanupStack::PopAndDestroy(screenDevice);
+ ws.Close();
+#else
+ iDispatcher->DispatchOutgoingErrorMessage(KErrArgument,
+ KErrDescrScreenNotSupported, KScreenshotServiceUid);
+#endif
+ HTI_LOG_FUNC_OUT( "CHtiScreenshotServicePlugin::HandleRotateScreen" );
+ }
// ----------------------------------------------------------------------------
void CHtiScreenshotServicePlugin::CreateBitmapL( TRect& aRegion,
TDisplayMode aMode )
@@ -1961,6 +2217,28 @@
}
// ----------------------------------------------------------------------------
+void CHtiScreenshotServicePlugin::SetScreenNumber(TInt aScreenNumber)
+ {
+ HTI_LOG_FUNC_IN("CHtiScreenshotServicePlugin::SetScreenNumber");
+ TInt currentScreen = iScreenDevice->GetScreenNumber();
+ HTI_LOG_FORMAT("current screen: %d", currentScreen);
+ HTI_LOG_FORMAT("new screen number: %d", aScreenNumber);
+ if(aScreenNumber == currentScreen)
+ {
+ return;
+ }
+
+ // Clear the previous delta bitmap to avoid error
+ iPreviousBitmap->Reset();
+ //delete old screendevice and create a new one
+ delete iScreenDevice;
+ iScreenDevice = NULL;
+ iScreenDevice = new (ELeave) CWsScreenDevice(iWs);
+ User::LeaveIfError(iScreenDevice->Construct(aScreenNumber));
+ HTI_LOG_FUNC_OUT("CHtiScreenshotServicePlugin::SetScreenNumber");
+ }
+
+// ----------------------------------------------------------------------------
CSeriesShot* CSeriesShot::NewL( MSeriesShotObserver* aServicePlugin )
{
HTI_LOG_FUNC_IN( "CSeriesShot::NewL" );
--- a/htiui/HtiServicePlugins/HtiScreenshotServicePlugin/src/HtiTextRcg.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiScreenshotServicePlugin/src/HtiTextRcg.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -17,7 +17,6 @@
#include "HtiTextRcg.h"
-#include <AknUtils.h>
#include <HtiLogging.h>
const static TInt KDefaultStrategy = EHintEdge;
--- a/htiui/HtiServicePlugins/HtiSysInfoServicePlugin/group/HtiSysInfoServicePlugin.mmp Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiSysInfoServicePlugin/group/HtiSysInfoServicePlugin.mmp Fri Apr 16 14:59:17 2010 +0300
@@ -17,6 +17,7 @@
#include <platform_paths.hrh>
+#include "../../../symbian_version.hrh"
TARGET HtiSysInfoServicePlugin.dll
TARGETTYPE PLUGIN
@@ -41,8 +42,11 @@
TARGET HtiSysInfoServicePlugin.rsc
END
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
+LIBRARY avkon.lib
+#endif
+
LIBRARY aknskinsrv.lib
-LIBRARY avkon.lib
LIBRARY bafl.lib
LIBRARY btdevice.lib
LIBRARY btmanclient.lib
--- a/htiui/HtiServicePlugins/HtiSysInfoServicePlugin/inc/HtiSysInfoServicePlugin.h Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiSysInfoServicePlugin/inc/HtiSysInfoServicePlugin.h Fri Apr 16 14:59:17 2010 +0300
@@ -21,6 +21,8 @@
#define HTISYSINFOPLUGIN_H
// INCLUDES
+#include "../../../symbian_version.hrh"
+
#include <e32property.h>
#include <f32file.h>
#include <HtiServicePluginInterface.h>
@@ -48,7 +50,9 @@
void NotifyMemoryChange( TInt aAvailableMemory );
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
static TInt HandleAllowSSPropertyChange( TAny* aPtr );
+#endif
protected:
@@ -98,6 +102,7 @@
void ParseTimeDataL( const TDesC8& aTimeData, TTime& aResult );
TInt CleanUpTempFiles();
TBool CanTurnBluetoothOnL( const TBool aUseForce );
+ TInt CreatFileToEatDiskSpace( TFileName aPath, TInt64 aSpaceToEat );
private: // private data
RFs iFs;
@@ -105,10 +110,12 @@
HBufC8* iMemEater;
HBufC8* iReply;
CHtiLightsController* iLightsController;
+ CHtiPropertySubscriber* iAllowSSSubscriber;
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
TInt iAllowSSValue;
- CHtiPropertySubscriber* iAllowSSSubscriber;
RProperty iAllowSSProperty;
TBool iAllowSSPropertyAttached;
+#endif
TBool iGalleryUpdateSupported;
};
@@ -137,6 +144,7 @@
private:
CActiveSchedulerWait* iWait;
TInt iResult;
+
};
--- a/htiui/HtiServicePlugins/HtiSysInfoServicePlugin/src/HtiSysInfoServicePlugin.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/HtiServicePlugins/HtiSysInfoServicePlugin/src/HtiSysInfoServicePlugin.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -23,7 +23,11 @@
#include <HtiDispatcherInterface.h>
#include <HtiLogging.h>
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
#include <aknkeylock.h>
+#include <ScreensaverInternalPSKeys.h>
+#endif
+
#include <AknSkinsInternalCRKeys.h>
#include <AknsSkinUID.h>
#include <AknsSrvClient.h>
@@ -43,7 +47,6 @@
#include <mmtsy_names.h>
#include <rmmcustomapi.h>
#include <hwrmpowerstatesdkpskeys.h>
-#include <ScreensaverInternalPSKeys.h>
#include <settingsinternalcrkeys.h>
#include <sysutil.h>
#include <tz.h>
@@ -60,6 +63,7 @@
_LIT( KTempFilePath, "\\" );
_LIT( KTempFileName, "HtiTempFile.tmp" );
+_LIT( KMatchFileName, "HtiTempFile.tmp*" );
_LIT( KDateSeparatorChars, ".:/-" );
_LIT( KTimeSeparatorChars, ".:" );
@@ -79,7 +83,6 @@
_LIT8( KErrDescrSysUtil, "SysUtil failed" );
_LIT8( KErrDescrSetTime, "Setting time failed" );
_LIT8( KErrDescrDateTimeFormat, "Setting date and time formats failed" );
-_LIT8( KErrDescrScreenSaver, "Setting screen saver state failed" );
_LIT8( KErrDescrGetNetworkModes, "Getting network modes failed" );
_LIT8( KErrDescrSetNetworkMode, "Setting network mode failed" );
_LIT8( KErrDescrIrActivation, "IR activation failed" );
@@ -89,11 +92,14 @@
_LIT8( KErrDescrBtOffDenied, "Turning BT off not allowed (active connections)" );
_LIT8( KErrDescrBtSettings, "Bluetooth settings failed" );
_LIT8( KErrDescrBtDeletePairings, "Deleting Bluetooth pairing(s) failed" );
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
_LIT8( KErrDescrKeyLock, "Key lock toggle failed" );
+_LIT8( KErrDescrScreenSaver, "Setting screen saver state failed" );
+_LIT8( KErrDescrInvalidSSTimeout, "Invalid screen saver timeout value" );
+_LIT8( KErrDescrSSTimeoutFailed, "Setting screen saver timeout failed" );
+#endif
_LIT8( KErrDescrInvalidTime, "Auto key guard time value too large (max 3600)" );
_LIT8( KErrDescrAutoKeyGuardFailed, "Setting auto key guard time failed" );
-_LIT8( KErrDescrInvalidSSTimeout, "Invalid screen saver timeout value" );
-_LIT8( KErrDescrSSTimeoutFailed, "Setting screen saver timeout failed" );
_LIT8( KErrDescrDrmDbConnect, "DRM DB connect failed." );
_LIT8( KErrDescrDrmDbDelete, "DRM DB delete failed." );
_LIT8( KErrDescrBatteryLevel, "Getting battery level failed." );
@@ -175,9 +181,12 @@
// Constructor
//------------------------------------------------------------------------------
CHtiSysInfoServicePlugin::CHtiSysInfoServicePlugin():
- iMemEater( NULL ), iReply( NULL ), iAllowSSValue( -1 ),
- iAllowSSPropertyAttached( EFalse ), iGalleryUpdateSupported( ETrue )
+ iMemEater( NULL ), iReply( NULL ), iGalleryUpdateSupported( ETrue )
{
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
+ iAllowSSValue = -1;
+ iAllowSSPropertyAttached = EFalse;
+#endif
}
//------------------------------------------------------------------------------
@@ -198,7 +207,9 @@
{
iAllowSSSubscriber->Unsubscribe();
}
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
iAllowSSProperty.Close();
+#endif
delete iAllowSSSubscriber;
}
@@ -513,6 +524,7 @@
}
}
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
//------------------------------------------------------------------------------
// CHtiSysInfoServicePlugin::HandleAllowSSPropertyChange
//------------------------------------------------------------------------------
@@ -536,7 +548,7 @@
return err;
}
-
+#endif
/*
* Private helper methods
*/
@@ -1088,39 +1100,25 @@
//------------------------------------------------------------------------------
void CHtiSysInfoServicePlugin::HandleEatDiskSpaceL( const TDesC8& aMessage )
{
+ HTI_LOG_FUNC_IN( "CHtiSysInfoServicePlugin::HandleEatDiskSpaceL" );
+
if ( aMessage.Length() != 10 )
{
iDispatcher->DispatchOutgoingErrorMessage(
KErrArgument,
KErrDescrArgument,
KSysInfoServiceUid );
+ HTI_LOG_FUNC_OUT( "CHtiSysInfoServicePlugin::HandleEatDiskSpaceL" );
return;
}
-
+ TFileName commonpath;
+ commonpath.Append( aMessage[1] );
+ commonpath.Append( _L( ":" ) );
+ commonpath.Append( KTempFilePath );
+ commonpath.Append( KTempFileName );
TFileName path;
- path.Append( aMessage[1] );
- path.Append( _L( ":" ) );
- path.Append( KTempFilePath );
- path.Append( KTempFileName );
-
- HTI_LOG_TEXT( "Temp file path:" );
- HTI_LOG_DES( path );
-
- // check if previous temp file exists and delete it
- if ( BaflUtils::FileExists( iFs, path ) )
- {
- TInt err = iFileMan->Delete( path );
- if ( err )
- {
- iDispatcher->DispatchOutgoingErrorMessage(
- err,
- KErrDescrDeleteTempFile,
- KSysInfoServiceUid );
- return;
- }
- }
-
+
// get free disk space
TInt drive;
RFs::CharToDrive( TChar( aMessage[1] ), drive );
@@ -1132,6 +1130,7 @@
err,
KErrDescrVolInfo,
KSysInfoServiceUid );
+ HTI_LOG_FUNC_OUT( "CHtiSysInfoServicePlugin::HandleEatDiskSpaceL" );
return;
}
@@ -1157,37 +1156,70 @@
KErrDiskFull,
KErrDescrNotEnoughSpace,
KSysInfoServiceUid );
+ HTI_LOG_FUNC_OUT( "CHtiSysInfoServicePlugin::HandleEatDiskSpaceL" );
return;
}
// check if scaceToEat is greater than KMaxTInt
// --> it must be eaten in several chunks
// --> not yet supported.
- if ( spaceToEat > KMaxTInt )
+
+ TInt64 size;
+ for(TInt i=1; spaceToEat>0; i++)
{
- HTI_LOG_TEXT( "Cannot allocate a file bigger than KMaxTInt" );
-
- iDispatcher->DispatchOutgoingErrorMessage(
- KErrOverflow,
- KErrDescrSetSizeTempFile,
- KSysInfoServiceUid );
- return;
+ path.Zero();
+ path.Copy(commonpath);
+ path.AppendNum(i);
+ if ( BaflUtils::FileExists( iFs, path ) )
+ {
+ continue;
+ }
+
+ if(spaceToEat > KMaxTInt)
+ size=KMaxTInt;
+ else
+ size=spaceToEat;
+
+ err = CreatFileToEatDiskSpace(path, size);
+ if(err)
+ {
+ HTI_LOG_FUNC_OUT( "CHtiSysInfoServicePlugin::HandleEatDiskSpaceL CreateFile Fail" );
+ return;
+ }
+
+ iFs.Volume( volInfo, drive );
+ HTI_LOG_FORMAT( "current free space: %Ld", volInfo.iFree );
+ spaceToEat = volInfo.iFree - spaceLeftFree;
}
+ // all ok, send the remaining disk size back
+ iReply = HBufC8::NewL( 8 );
+ iReply->Des().Append( ( TUint8* )( &volInfo.iFree ), 8 );
+ HTI_LOG_FUNC_OUT( "CHtiSysInfoServicePlugin::HandleEatDiskSpaceL" );
+ }
+
+TInt CHtiSysInfoServicePlugin::CreatFileToEatDiskSpace( TFileName aPath, TInt64 aSpaceToEat )
+ {
+ HTI_LOG_FUNC_IN( "CHtiSysInfoServicePlugin::CreatFileToEatDiskSpace" );
+
+ HTI_LOG_FORMAT( "Create file: %S", &aPath );
+ HTI_LOG_FORMAT( "file size %Ld", aSpaceToEat );
+
// create a temp file
RFile diskEater;
- err = diskEater.Replace( iFs, path, EFileWrite );
+ TInt err = diskEater.Replace( iFs, aPath, EFileWrite );
if ( err )
{
iDispatcher->DispatchOutgoingErrorMessage(
err,
KErrDescrCreateTempFile,
KSysInfoServiceUid );
- return;
+ HTI_LOG_FUNC_OUT( "CHtiSysInfoServicePlugin::CreatFileToEatDiskSpace Replace error" );
+ return err;
}
-
+
// set the size for temp file
- err = diskEater.SetSize( I64LOW( spaceToEat ) );
+ err = diskEater.SetSize( I64LOW( aSpaceToEat ) );
if ( err )
{
iDispatcher->DispatchOutgoingErrorMessage(
@@ -1195,23 +1227,12 @@
KErrDescrSetSizeTempFile,
KSysInfoServiceUid );
diskEater.Close();
- return;
+ HTI_LOG_FUNC_OUT( "CHtiSysInfoServicePlugin::CreatFileToEatDiskSpace SetSize error" );
+ return err;
}
diskEater.Close();
-
- err = iFs.Volume( volInfo, drive );
- if ( err )
- {
- iDispatcher->DispatchOutgoingErrorMessage(
- err,
- KErrDescrVolInfo,
- KSysInfoServiceUid );
- return;
- }
-
- // all ok, send the remaining disk size back
- iReply = HBufC8::NewL( 8 );
- iReply->Des().Append( ( TUint8* )( &volInfo.iFree ), 8 );
+ HTI_LOG_FUNC_OUT( "CHtiSysInfoServicePlugin::CreatFileToEatDiskSpace" );
+ return 0;
}
//------------------------------------------------------------------------------
@@ -1219,41 +1240,33 @@
//------------------------------------------------------------------------------
void CHtiSysInfoServicePlugin::HandleReleaseDiskSpaceL( const TDesC8& aMessage )
{
+ HTI_LOG_FUNC_IN( "CHtiSysInfoServicePlugin::HandleReleaseDiskSpaceL" );
if ( aMessage.Length() != 2 )
{
iDispatcher->DispatchOutgoingErrorMessage(
KErrArgument,
KErrDescrArgument,
KSysInfoServiceUid);
+ HTI_LOG_FUNC_OUT( "CHtiSysInfoServicePlugin::HandleReleaseDiskSpaceL" );
return;
}
TFileName path;
path.Append( aMessage[1] );
path.Append( _L( ":" ) );
- path.Append( KTempFilePath );
- path.Append( KTempFileName );
-
- HTI_LOG_TEXT( "Temp file path:" );
- HTI_LOG_DES( path );
-
- TInt err = KErrNone;
- // check that temp file exists
- if ( BaflUtils::FileExists( iFs, path ) )
+ path.Append(KTempFilePath);
+ path.Append(KMatchFileName);
+ TInt err = iFileMan->Delete(path);
+ if ( err )
{
- // try to delete the temp file
- err = iFileMan->Delete( path );
- if ( err )
- {
- iDispatcher->DispatchOutgoingErrorMessage(
+ iDispatcher->DispatchOutgoingErrorMessage(
err,
KErrDescrDeleteTempFile,
KSysInfoServiceUid );
-
- return;
- }
- }
-
+ HTI_LOG_FUNC_OUT( "CHtiSysInfoServicePlugin::HandleReleaseDiskSpaceL" );
+ return;
+ }
+
// query the free disk space
TInt drive;
RFs::CharToDrive( TChar( aMessage[1] ), drive );
@@ -1265,13 +1278,15 @@
err,
KErrDescrVolInfo,
KSysInfoServiceUid );
-
+ HTI_LOG_FUNC_OUT( "CHtiSysInfoServicePlugin::HandleReleaseDiskSpaceL" );
return;
}
// all ok, send the free disk space back
iReply = HBufC8::NewL( 8 );
iReply->Des().Append( ( TUint8* )( &volInfo.iFree ), 8 );
+
+ HTI_LOG_FUNC_OUT( "CHtiSysInfoServicePlugin::HandleReleaseDiskSpaceL" );
}
//------------------------------------------------------------------------------
@@ -1454,6 +1469,9 @@
void CHtiSysInfoServicePlugin::HandleScreenSaverCommandL(
const TDesC8& aMessage )
{
+ HTI_LOG_FUNC_IN(
+ "CHtiSysInfoServicePlugin::HandleScreenSaverCommandL" );
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
if ( aMessage.Length() != 1 )
{
iDispatcher->DispatchOutgoingErrorMessage(
@@ -1518,6 +1536,12 @@
iReply = HBufC8::NewL( 1 );
iReply->Des().Append( 0 );
+#else
+ iDispatcher->DispatchOutgoingErrorMessage(KErrArgument,
+ KErrDescrNotSupported, KSysInfoServiceUid);
+#endif
+ HTI_LOG_FUNC_OUT(
+ "CHtiSysInfoServicePlugin::HandleScreenSaverCommandL" );
}
//------------------------------------------------------------------------------
@@ -1528,6 +1552,7 @@
{
HTI_LOG_FUNC_IN(
"CHtiSysInfoServicePlugin::HandleScreenSaverTimeoutCommandL" );
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
if ( aMessage.Length() != 2 )
{
iDispatcher->DispatchOutgoingErrorMessage(
@@ -1562,6 +1587,10 @@
}
delete persRep;
+#else
+ iDispatcher->DispatchOutgoingErrorMessage(KErrArgument,
+ KErrDescrNotSupported, KSysInfoServiceUid);
+#endif
HTI_LOG_FUNC_OUT(
"CHtiSysInfoServicePlugin::HandleScreenSaverTimeoutCommandL" );
}
@@ -2141,7 +2170,7 @@
void CHtiSysInfoServicePlugin::HandleKeyLockToggleL( const TDesC8& aMessage )
{
HTI_LOG_FUNC_IN( "CHtiSysInfoServicePlugin::HandleKeyLockToggleL" );
-
+#if ( SYMBIAN_VERSION_SUPPORT < SYMBIAN_4 )
if ( aMessage.Length() != 3 )
{
iDispatcher->DispatchOutgoingErrorMessage( KErrArgument,
@@ -2208,7 +2237,10 @@
}
keyLock.Close();
-
+#else
+ iDispatcher->DispatchOutgoingErrorMessage(KErrArgument,
+ KErrDescrNotSupported, KSysInfoServiceUid);
+#endif
HTI_LOG_FUNC_OUT( "CHtiSysInfoServicePlugin::HandleKeyLockToggleL" );
}
@@ -2857,27 +2889,25 @@
TInt CHtiSysInfoServicePlugin::CleanUpTempFiles()
{
HTI_LOG_FUNC_IN( "CHtiSysInfoServicePlugin::CleanUpTempFiles" );
-
TFindFile finder( iFs );
- TFileName path( KTempFilePath );
- TInt err = finder.FindByPath( KTempFileName, &path );
-
- while ( err == KErrNone )
+ CDir* dir = NULL;
+ TInt err = finder.FindWildByDir(KMatchFileName, KTempFilePath, dir);
+ TInt safeDeleteCount = 0;
+ while ( err == KErrNone && safeDeleteCount < 20)
{
- TFileName tempFile = finder.File();
-
- HTI_LOG_TEXT( "Found temp file: " );
- HTI_LOG_DES( tempFile );
-
- err = iFileMan->Delete( tempFile );
-
- // return if deleting does not succeed to prevent mad man loop
- if ( err != KErrNone ) return err;
-
- // try to find next temp file
- err = finder.FindByPath( KTempFileName, &path );
+ safeDeleteCount++;
+ TFileName path;
+ path.Copy(finder.File());
+ HTI_LOG_FORMAT( "found file: %S", &path );
+ TInt ret = iFileMan->Delete(path);
+ delete dir;
+ dir = NULL;
+ if(ret != KErrNone)
+ {
+ break;
+ }
+ err = finder.FindWildByDir(KMatchFileName, KTempFilePath, dir);
}
-
HTI_LOG_FUNC_OUT("CHtiSysInfoServicePlugin::CleanUpTempFiles");
return KErrNone;
}
--- a/htiui/group/bld.inf Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/group/bld.inf Fri Apr 16 14:59:17 2010 +0300
@@ -23,10 +23,6 @@
PRJ_EXPORTS
../rom/htiui.iby CORE_IBY_EXPORT_PATH(tools,htiui.iby)
-
-// Communication plugins
-#include "../HtiCommPlugins/HtiBtCommPlugin/group/bld.inf"
-
// Service plugins
#include "../HtiServicePlugins/HtiAppServicePlugin/group/bld.inf"
#include "../HtiServicePlugins/HtiAudioServicePlugin/group/bld.inf"
--- a/htiui/sis/HTI_S60-52.pkg Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/sis/HTI_S60-52.pkg Fri Apr 16 14:59:17 2010 +0300
@@ -18,7 +18,7 @@
&EN
; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,16,0
+#{"HTI"},(0x1020DEB6),2,18,0
; Series60 product id for S60 5.2
[0x20022E6D], 0, 0, 0, {"Series60ProductID"}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/htiui/sis/HTI_S60_Upgrade-52.pkg Fri Apr 16 14:59:17 2010 +0300
@@ -0,0 +1,114 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: Installation file for HTI
+
+
+; Languages
+&EN
+
+; Using UID of HtiFramework project
+#{"HTI"},(0x1020DEB6),2,18,0,TYPE=SA,RU
+
+; Series60 product id for S60 5.2
+[0x20022E6D], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Install files
+
+; HtiCfg library
+"\epoc32\release\armv5\urel\HtiCfg.dll" - "!:\sys\bin\HtiCfg.dll"
+
+; HtiAdmin
+"\epoc32\release\armv5\urel\HtiAdmin.exe" - "!:\sys\bin\HtiAdmin.exe"
+"\epoc32\data\Z\Resource\apps\HtiAdmin.rsc" - "!:\Resource\Apps\HtiAdmin.rsc"
+"\epoc32\data\Z\private\10003a3f\apps\HtiAdmin_reg.rsc" - "!:\private\10003a3f\import\apps\HtiAdmin_reg.rsc"
+
+; Serial comm module
+"\epoc32\data\Z\Resource\Plugins\HtiSerialCommEcomPlugin.rsc" - "!:\Resource\Plugins\HtiSerialCommEcomPlugin.rsc"
+"\epoc32\release\armv5\urel\HtiSerialCommEcomPlugin.dll" - "!:\sys\bin\HtiSerialCommEcomPlugin.dll"
+
+; BtSerial comm module
+"\epoc32\release\armv5\urel\HtiBtSerialComHelper.dll" - "!:\sys\bin\HtiBtSerialComHelper.dll"
+"\epoc32\release\armv5\urel\HtiBtCommServer.dll" - "!:\sys\bin\HtiBtCommServer.dll"
+"\epoc32\release\armv5\urel\HtiBtCommInterface.dll" - "!:\sys\bin\HtiBtCommInterface.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiBtCommEcomPlugin.rsc" - "!:\Resource\Plugins\HtiBtCommEcomPlugin.rsc"
+"\epoc32\release\armv5\urel\HtiBtCommEcomPlugin.dll" - "!:\sys\bin\HtiBtCommEcomPlugin.dll"
+
+; IPComm module
+"\epoc32\release\armv5\urel\HtiIPCommServer.exe" - "!:\sys\bin\HtiIPCommServer.exe"
+"\epoc32\release\armv5\urel\HtiIPCommServerClient.dll" - "!:\sys\bin\HtiIPCommServerClient.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiIPCommEcomPlugin.rsc" - "!:\Resource\Plugins\HtiIPCommEcomPlugin.rsc"
+"\epoc32\release\armv5\urel\HtiIPCommEcomPlugin.dll" - "!:\sys\bin\HtiIPCommEcomPlugin.dll"
+
+; USB serial comm module
+"\epoc32\data\Z\Resource\Plugins\HtiUsbSerialCommEcomPlugin.rsc" - "!:\Resource\Plugins\HtiUsbSerialCommEcomPlugin.rsc"
+"\epoc32\release\armv5\urel\HtiUsbSerialCommEcomPlugin.dll" - "!:\sys\bin\HtiUsbSerialCommEcomPlugin.dll"
+
+; Test service plug-ins
+"\epoc32\release\armv5\urel\HtiEchoServicePlugin.dll" - "!:\sys\bin\HtiEchoServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiEchoServicePlugin.rsc" - "!:\Resource\Plugins\HtiEchoServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiKeyEventServicePlugin.dll" - "!:\sys\bin\HtiKeyEventServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiKeyEventServicePlugin.rsc" - "!:\Resource\Plugins\HtiKeyEventServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiScreenshotServicePlugin.dll" - "!:\sys\bin\HtiScreenshotServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiScreenshotServicePlugin.rsc" - "!:\Resource\Plugins\HtiScreenshotServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiFtpServicePlugin.dll" - "!:\sys\bin\HtiFtpServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiFtpServicePlugin.rsc" - "!:\Resource\Plugins\HtiFtpServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiAppServicePlugin.dll" - "!:\sys\bin\HtiAppServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiAppServicePlugin.rsc" - "!:\Resource\Plugins\HtiAppServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiAppControl.dll" - "!:\sys\bin\HtiAppControl.dll"
+"\epoc32\release\armv5\urel\HtiStifTfServicePlugin.dll" - "!:\sys\bin\HtiStifTfServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiStifTfServicePlugin.rsc" - "!:\Resource\Plugins\HtiStifTfServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiSysInfoServicePlugin.dll" - "!:\sys\bin\HtiSysInfoServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiSysInfoServicePlugin.rsc" - "!:\Resource\Plugins\HtiSysInfoServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiAudioServicePlugin.dll" - "!:\sys\bin\HtiAudioServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiAudioServicePlugin.rsc" - "!:\Resource\Plugins\HtiAudioServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiMessagesServicePlugin.dll" - "!:\sys\bin\HtiMessagesServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiMessagesServicePlugin.rsc" - "!:\Resource\Plugins\HtiMessagesServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiPIMServicePlugin.dll" - "!:\sys\bin\HtiPIMServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiPIMServicePlugin.rsc" - "!:\Resource\Plugins\HtiPIMServicePlugin.rsc"
+"\epoc32\release\armv5\urel\HtiIpProxyServicePlugin.dll" - "!:\sys\bin\HtiIpProxyServicePlugin.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiIpProxyServicePlugin.rsc" - "!:\Resource\Plugins\HtiIpProxyServicePlugin.rsc"
+
+; Helper to add notepad memos
+"\epoc32\release\armv5\urel\HtiNpdHlp.exe" - "!:\sys\bin\HtiNpdHlp.exe"
+
+; File helper with capability ALL - for file operations to TCB folders
+"\epoc32\release\armv5\urel\HtiFileHlp.exe" - "!:\sys\bin\HtiFileHlp.exe"
+
+; Backup fake DLL used by HtiFtpServicePlugin
+"\epoc32\release\armv5\urel\HtiFtpBackupFake.dll" - "!:\sys\bin\HtiFtpBackupFake.dll"
+
+; HTI watchdog
+"\epoc32\release\armv5\urel\HtiWatchDog.exe" - "!:\sys\bin\HtiWatchDog.exe"
+
+; HTI device reboot
+"\epoc32\release\armv5\urel\HtiDeviceRebootUI.exe" - "!:\sys\bin\HtiDeviceRebootUI.exe"
+
+; HTI Framework
+"\epoc32\release\armv5\urel\HTIFramework.exe" - "!:\sys\bin\HTIFramework.exe"
+
+; AutoStart recogniser plug-in
+"\epoc32\release\armv5\urel\HtiAutoStart.dll" - "!:\sys\bin\HtiAutoStart.dll"
+"\epoc32\data\Z\Resource\Plugins\HtiAutoStart.rsc" - "!:\Resource\Plugins\HtiAutoStart.rsc"
+
+; HTI startup wait
+"\epoc32\release\armv5\urel\HtiStartupWait.dll" - "!:\sys\bin\HtiStartupWait.dll"
+
+; Startup list resource file for starting HTIFramework.exe in device boot
+"\epoc32\data\Z\private\101f875a\import\1020deb6.rsc" - "c:\private\101f875a\import\[1020deb6].rsc"
--- a/htiui/sis/HTI_stub.pkg Fri Mar 19 09:29:26 2010 +0200
+++ b/htiui/sis/HTI_stub.pkg Fri Apr 16 14:59:17 2010 +0300
@@ -18,7 +18,7 @@
&EN
; Using UID of HtiFramework project
-#{"HTI"},(0x1020DEB6),2,16,0
+#{"HTI"},(0x1020DEB6),2,18,0
; Localised Vendor name
%{"Nokia"}
@@ -98,7 +98,7 @@
""- "z:\sys\bin\HtiDeviceRebootUI.exe"
; HTI Framework
-""- "z:\sys\bin\HTIFramework.exe"
+""- "z:\sys\bin\HtiFramework.exe"
; AutoStart recogniser plug-in
""- "z:\sys\bin\HtiAutoStart.dll"
--- a/layers.sysdef.xml Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
- <!ENTITY layer_real_source_path "sf/app/rndtools" >
-]>
-
-<SystemDefinition name="rndtools" schema="1.4.0">
- <systemModel>
- <layer name="app_layer">
- <module name="rndtools">
- <unit unitID="tools.rndtools" mrp="" bldFile="&layer_real_source_path;/group" name="rndtools" />
- </module>
- </layer>
- </systemModel>
-</SystemDefinition>
\ No newline at end of file
--- a/package_definition.xml Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SystemDefinition schema="3.0.0">
- <package id="rndtools" name="R&D tools" levels="support generic test util">
- <collection id="creator" name="Creator" level="support">
- <component id="creator_build" filter="s60" name="Creator Tool" purpose="development" target="device" class="tool">
- <unit bldFile="creator/group"/>
- </component>
- </collection>
- <collection id="filebrowser" name="File Browser" level="util">
- <!-- consider collapsing into a single component -->
- <component id="fileopserver" filter="s60" name="File Operations Server" purpose="development" target="device" class="tool">
- <unit bldFile="filebrowser/fileopserver/group"/>
- </component>
- <component id="fileopclient" filter="s60" name="File Operations Client" purpose="development" target="device" class="tool">
- <unit bldFile="filebrowser/fileopclient/group"/>
- </component>
- <component id="filebrowser_build" filter="s60" name="File Browser Application" purpose="development" target="device" class="tool">
- <unit bldFile="filebrowser/group"/>
- </component>
- </collection>
- <collection id="launcher" name="Launcher" level="util">
- <component id="launcher_build" filter="s60" name="Launcher Utility" purpose="development" target="device" class="tool">
- <unit bldFile="launcher/group"/>
- </component>
- </collection>
- <collection id="screengrabber" name="Screen Grabber" level="util">
- <component id="screengrabber_build" filter="s60" name="ScreenGrabber" purpose="development" target="device" class="tool">
- <unit bldFile="screengrabber/group"/>
- </component>
- </collection>
- <collection id="stifui" name="STIF UI" level="generic">
- <component id="stifui_stifui" filter="s60" name="STIF UI" purpose="development" target="device">
- <unit bldFile="stifui/stifui/group"/>
- </component>
- <component id="uitestserverstarter" filter="s60" name="UI Test Server Starter" purpose="development" target="device">
- <unit bldFile="stifui/uitestserverstarter/group"/>
- </component>
- <component id="stifui_build" filter="s60" name="STIF UI Build" purpose="development">
- <!-- can this be split up into the other components? -->
- <unit bldFile="stifui/group"/>
- </component>
- </collection>
- <collection id="loadgen" name="Load Generator" level="test">
- <component id="loadgen_build" filter="s60" name="Load Generator Application" purpose="development" target="device" class="tool">
- <unit bldFile="loadgen/group"/>
- </component>
- </collection>
- <collection id="perfmon" name="Performance Monitor" level="test">
- <component id="perfmon_build" filter="s60" name="Performance Monitor Tool" purpose="development" target="device" class="tool">
- <unit bldFile="perfmon/group"/>
- </component>
- </collection>
- <collection id="htiui" name="Harmonized Test Interface UI" level="generic">
- <component id="HtiCommPlugins" filter="s60" name="HTI Comm Plugins" purpose="development" target="device" class="plugin">
- <unit bldFile="htiui/HtiCommPlugins/HtiBtCommPlugin/group"/>
- </component>
- <component id="HtiServicePlugins" filter="s60" name="HTI Service Plugins" purpose="development" target="device" class="plugin">
- <!-- can only have a single unit. Should #include from a common bld.inf file -->
- <unit bldFile="htiui/HtiServicePlugins/HtiAppServicePlugin/group"/>
- <unit bldFile="htiui/HtiServicePlugins/HtiAudioServicePlugin/group"/>
- <unit bldFile="htiui/HtiServicePlugins/HtiKeyEventServicePlugin/group"/>
- <unit bldFile="htiui/HtiServicePlugins/HtiMessagesServicePlugin/group"/>
- <unit bldFile="htiui/HtiServicePlugins/HtiPIMServicePlugin/group"/>
- <unit bldFile="htiui/HtiServicePlugins/HtiScreenshotServicePlugin/group"/>
- <unit bldFile="htiui/HtiServicePlugins/HtiSysInfoServicePlugin/group"/>
- <unit bldFile="htiui/HtiServicePlugins/HtiFtpBackupFake/group"/>
- </component>
- <component id="htidevicereboot" filter="s60" name="HTI Device Reboot" purpose="development" target="device">
- <unit bldFile="htiui/htidevicereboot/group"/>
- </component>
- <component id="htistartupwait" filter="s60" name="HTI Startup Wait" purpose="development" target="device">
- <unit bldFile="htiui/htistartupwait/group"/>
- </component>
- <component id="htiadmin" filter="s60" name="HTI Admin" purpose="development" target="device">
- <unit bldFile="htiui/htiadmin/group"/>
- </component>
- <component id="htiui_build" filter="s60" name="HTI UI Build" purpose="development">
- <!-- can this be split up into the other components? -->
- <unit bldFile="htiui/group"/>
- </component>
- </collection>
- <collection id="memspyui" name="Memspy UI" level="generic">
- <component id="memspyui_build" filter="s60" name="Memspy UI Application" purpose="development" target="device" class="tool">
- <unit bldFile="memspyui/group"/>
- </component>
- </collection>
- </package>
-</SystemDefinition>
--- a/perfmon/src/perfmon_model.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/perfmon/src/perfmon_model.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -755,7 +755,7 @@
iSettings.iCPUMode = ECPUModeCPUTime;
iSettings.iKeepBacklightOn = ETrue;
- iSettings.iDataPopupVisibility = EDataPopupVisbilityAlwaysOn;
+ iSettings.iDataPopupVisibility = EDataPopupVisbilityAlwaysAlwaysOff;
iSettings.iDataPopupLocation = EDataPopupLocationTopRight;
iSettings.iDataPopupSources.SetDefaults1();
--- a/stifui/group/ReleaseNote.txt Fri Mar 19 09:29:26 2010 +0200
+++ b/stifui/group/ReleaseNote.txt Fri Apr 16 14:59:17 2010 +0300
@@ -1,5 +1,5 @@
========================================================================
-RELEASE NOTE FOR STIF UI - STIF_201006 (7.3.26)
+RELEASE NOTE FOR STIF UI - STIF_201010 (7.3.28)
SUPPORTING SERIES 60 3.0 ->
========================================================================
Binary file stifui/sis/Stifui_31.sis has changed
--- a/stifui/stifui/group/Stifui.mmp Fri Mar 19 09:29:26 2010 +0200
+++ b/stifui/stifui/group/Stifui.mmp Fri Apr 16 14:59:17 2010 +0300
@@ -119,4 +119,5 @@
END
EPOCHEAPSIZE 0x10000 0x500000
+EPOCSTACKSIZE 32768
// End of file
--- a/stifui/stifui/inc/version.h Fri Mar 19 09:29:26 2010 +0200
+++ b/stifui/stifui/inc/version.h Fri Apr 16 14:59:17 2010 +0300
@@ -20,9 +20,9 @@
#define STIFUI_MAJOR_VERSION 7
#define STIFUI_MINOR_VERSION 3
-#define STIFUI_BUILD_VERSION 26
+#define STIFUI_BUILD_VERSION 28
-#define STIFUI_REL_DATE "09th Feb 2010"
+#define STIFUI_REL_DATE "09th Mar 2010"
#define TO_UNICODE(text) _L(text)
--- a/stifui/uitestserverstarter/src/TestServerThreadStarter.cpp Fri Mar 19 09:29:26 2010 +0200
+++ b/stifui/uitestserverstarter/src/TestServerThreadStarter.cpp Fri Apr 16 14:59:17 2010 +0300
@@ -105,13 +105,21 @@
User().CommandLine( moduleName );
- RDebug::Print (moduleName);
+ RDebug::Print(_L("CTestServerThreadStarter::TestServerStarterThreadFunction() Received data [%S]"), &moduleName);
+
+ // Extract semaphore name passed in data
+ TInt index = moduleName.Find(_L(" "));
+ RDebug::Print(_L("CTestServerThreadStarter::TestServerStarterThreadFunction() Space separator found at position [%d]"), index);
+ TPtrC semaphoreName = moduleName.Mid(index + 1);
+ moduleName = moduleName.Left(index);
+
+ RDebug::Print(_L("CTestServerThreadStarter::TestServerStarterThreadFunction() Extracted module name [%S] and sempahore name [%S]"), &moduleName, &semaphoreName);
// Open start-up synchronization semaphore
RSemaphore startup;
RDebug::Print(_L(" Openingstart-up semaphore"));
- TName semaphoreName = _L("startupSemaphore");
- semaphoreName.Append( moduleName );
+ //TName semaphoreName = _L("startupSemaphore");
+ //semaphoreName.Append( moduleName );
TInt res = startup.OpenGlobal(semaphoreName);
RDebug::Print(_L("Opening result %d"), res);
@@ -123,7 +131,7 @@
if ( r == KErrAlreadyExists )
{
// Ok, server was already started
- RDebug::Print(_L("UI TestServer already started, signaling semaphore and existing"));
+ RDebug::Print(_L("UI TestServer already started, signaling semaphore and exiting"));
startup.Signal();
delete cmdLine;
--- a/sysdef_1_4_0.dtd Fri Mar 19 09:29:26 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
- <!ELEMENT SystemDefinition (systemModel?, build?)>
- <!ATTLIST SystemDefinition
- name CDATA #REQUIRED
- schema CDATA #REQUIRED>
- <!ELEMENT systemModel (layer+)>
- <!ELEMENT layer (logicalset* | module*)*>
- <!ATTLIST layer
- name CDATA #REQUIRED
- levels CDATA #IMPLIED
- span CDATA #IMPLIED>
- <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
- <!ATTLIST logicalset name CDATA #REQUIRED>
- <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
- <!ATTLIST logicalsubset name CDATA #REQUIRED>
- <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
- <!ATTLIST module
- name CDATA #REQUIRED
- level CDATA #IMPLIED>
- <!ELEMENT component (unit* | package* | prebuilt*)*>
- <!ATTLIST component name CDATA #REQUIRED>
- <!ELEMENT unit EMPTY>
- <!ATTLIST unit
- unitID ID #REQUIRED
- name CDATA #REQUIRED
- mrp CDATA #REQUIRED
- filter CDATA #IMPLIED
- bldFile CDATA #REQUIRED
- priority CDATA #IMPLIED
- contract CDATA #IMPLIED>
- <!ELEMENT package EMPTY>
- <!ATTLIST package
- name CDATA #REQUIRED
- mrp CDATA #REQUIRED
- filter CDATA #IMPLIED
- contract CDATA #IMPLIED>
- <!ELEMENT prebuilt EMPTY>
- <!ATTLIST prebuilt
- name CDATA #REQUIRED
- version CDATA #REQUIRED
- late (Y|N) #IMPLIED
- filter CDATA #IMPLIED
- contract CDATA #IMPLIED>
- <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
- <!ELEMENT unitList (unitRef+)>
- <!ATTLIST unitList
- name ID #REQUIRED
- description CDATA #REQUIRED>
- <!ELEMENT unitRef EMPTY>
- <!ATTLIST unitRef unit IDREF #REQUIRED>
- <!ELEMENT targetList EMPTY>
- <!ATTLIST targetList
- name ID #REQUIRED
- description CDATA #REQUIRED
- target IDREFS #REQUIRED>
- <!ELEMENT target EMPTY>
- <!ATTLIST target
- name ID #REQUIRED
- abldTarget CDATA #REQUIRED
- description CDATA #REQUIRED>
- <!ELEMENT option EMPTY>
- <!ATTLIST option
- name ID #REQUIRED
- abldOption CDATA #REQUIRED
- description CDATA #REQUIRED
- enable (Y | N | y | n) #REQUIRED>
- <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
- <!ATTLIST configuration
- name ID #REQUIRED
- description CDATA #REQUIRED
- filter CDATA #REQUIRED>
- <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
- <!ELEMENT unitListRef EMPTY>
- <!ATTLIST unitListRef unitList IDREF #REQUIRED>
- <!ELEMENT layerRef EMPTY>
- <!ATTLIST layerRef layerName CDATA #REQUIRED>
- <!ELEMENT buildLayer EMPTY>
- <!ATTLIST buildLayer
- command CDATA #REQUIRED
- targetList IDREFS #IMPLIED
- unitParallel (Y | N | y | n) #REQUIRED
- targetParallel (Y | N | y | n) #IMPLIED>
- <!ELEMENT specialInstructions EMPTY>
- <!ATTLIST specialInstructions
- name CDATA #REQUIRED
- cwd CDATA #REQUIRED
- command CDATA #REQUIRED>