Discussion Board

Results 1 to 13 of 13
  1. #1
    Regular Contributor qt_chenchen's Avatar
    Join Date
    Jul 2008
    Posts
    51
    Hi guys, i am trying to get the IMSI of N6630. I've searched samples on how to get it, fortunately, i've found one. But this code gives me some errors. Could you look at it and tell whats possibly wrong with this code. Thanks!

    Here's the code for getting the imsi:
    Code:
    RTelServer iServer;
    RMobilePhone iPhone;
    RMobilePhone::TMobilePhoneSubscriberId imsi;
    TRequestStatus iImsiStatus;
    RTelServer::TPhoneInfo info;
    User::LeaveIfError(iServer.Connect());
    CleanupClosePushL(iServer);
    User::LeaveIfError(iServer.GetPhoneInfo(0, info));
    User::LeaveIfError(iPhone.Open(iServer, info.iName));
    CleanupClosePushL(iPhone);
    iPhone.GetSubscriberId(iImsiStatus, imsi);
    User::WaitForRequest(iImsiStatus);
    iImsi.Copy(imsi);
    iPhone.Close();
    CleanupStack::PopAndDestroy(&iPhone);
    iServer.Close();
    CleanupStack::PopAndDestroy(&iServer);
    The highlighted lines gives an error of:
    `imsi undeclared(first use this function)
    `TMobilePhoneSubriberId' is not a member of type `RMobilePhone'
    confused by earlier errors, bailing out
    parse error before `;'
    Thanks guys for helping!

  2. #2
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    Just guessing as may require platform / SDK information is missing.

    1) You have not included header files required.
    2) You are sdk does no have required headers.

  3. #3
    Regular Contributor qt_chenchen's Avatar
    Join Date
    Jul 2008
    Posts
    51
    Quote Originally Posted by skumar_rao View Post
    Just guessing as may require platform / SDK information is missing.

    1) You have not included header files required.
    2) You are sdk does no have required headers.
    Thanks for quick reply,

    Umm i have included the <etelmm.h> and linked against <etelmm.lib> is there any other headers that should be included?

    Can you check if i have the correct header file..
    Below is the etelmm.h source code:
    Code:
    // ETELMM.H
    //
    // Copyright (c) 1997-2003 Symbian Ltd.  All rights reserved.
    //
    
    #ifndef __ETELMM_H__
    #define __ETELMM_H__
    
    #include <e32base.h>
    #include <s32mem.h>
    #include <etel.h>
    
    class RMobilePhone : public RPhone
    	{
    	// cut-down version of this class for compilation consistency
    public:
    
    	// class needed to support TMobilePhoneStoreEntryV1 below
    	class TMultimodeType
    		{
    	public:
    		IMPORT_C TInt ExtensionId() const;
    	protected:
    		TMultimodeType();
    		void InternalizeL(RReadStream& aStream);
    		void ExternalizeL(RWriteStream& aStream) const;
    	protected:
    		TInt iExtensionId;
    		};
    
    	// enum needed by TGsmSmsTypeOfAddress in gsmuelem.h
    	enum TMobileTON
    		{
    		EUnknownNumber,			// 0
    		EInternationalNumber,	// 1
    		ENationalNumber,		// 2
    		ENetworkSpecificNumber, // 3
    		ESubscriberNumber,		// 4 - Also defined as "dedicated, short code" in GSM 04.08
    		EAlphanumericNumber,	// 5
    		EAbbreviatedNumber		// 6
    		};
    
    	// enum needed by TGsmSmsTypeOfAddress in gsmuelem.h
    	enum TMobileNPI
    		{
    		EUnknownNumberingPlan =0,
    		EIsdnNumberPlan=1,		
    		EDataNumberPlan=3,		
    		ETelexNumberPlan=4,	
    		EServiceCentreSpecificPlan1=5,
    		EServiceCentreSpecificPlan2=6,
    		ENationalNumberPlan=8,
    		EPrivateNumberPlan=9,
    		EERMESNumberPlan=10
    		};
    
    	// enum needed below
    	enum 
    		{
    		KMaxMobilePasswordSize=10,
    		KMaxMobileNameSize=32,
    		KMaxMobileTelNumberSize=100
    		};
    
    	// class needed to support TMobileGsmSmsEntryV1 below
    	class TMobileAddress
    		{
    	public:
    		IMPORT_C TMobileAddress();
    			
    		void InternalizeL(RReadStream& aStream);
    		void ExternalizeL(RWriteStream& aStream) const;
    			
    	public:
    		TMobileTON iTypeOfNumber;
    		TMobileNPI iNumberPlan;
    		TBuf<KMaxMobileTelNumberSize> iTelNumber;
    		};
    	
    	// typedef used by TGsmSmsSlot in gsmumsg.h
    	typedef TBuf<KMaxMobileNameSize> TMobileName;
    
    	// enum needed for CCommsDbAccess in dbaccess.h
    	enum TMobilePhoneNetworkMode
    		{
    		ENetworkModeUnknown,
    		ENetworkModeUnregistered,
    		ENetworkModeGsm,
    		ENetworkModeAmps,
    		ENetworkModeCdma95,
    		ENetworkModeCdma2000,
    		ENetworkModeWcdma
    		};
    	};
    
    
    // class needed to support RMobilePhoneStore below
    class RMobilePhoneStore : public RTelSubSessionBase
    	{
    	// cut-down version of this class for compilation consistency
    	public:
    
    		// class needed to support TMobileSmsEntryV1 below
    		class TMobilePhoneStoreEntryV1 : public RMobilePhone::TMultimodeType
    		{
    	protected:
    		TMobilePhoneStoreEntryV1();
    	public:
    		void InternalizeL(RReadStream& aStream);
    		void ExternalizeL(RWriteStream& aStream) const;
    	public:
    		TInt  iIndex;
    		};
    	};
    
    
    class RMobileSmsMessaging
    	{
    	// cut-down version of this class for compilation consistency
    public:
    
    	// enum needed below
    	enum 
    		{ 
    		KGsmTpduSize = 165,		// 140 bytes user data + 25 bytes TPDU header
    		KCdmaTpduSize  = 256	// Max size of Bearer Data in Transport Layer message
    		};
    
    	// typedef needed below
    	typedef TBuf8<KGsmTpduSize>	TMobileSmsGsmTpdu;
    	
    	// enum needed by CSmsSettings in smutset.h
    	enum TMobileSmsBearer
    		{
    		ESmsBearerPacketOnly,
    		ESmsBearerCircuitOnly,
    		ESmsBearerPacketPreferred,
    		ESmsBearerCircuitPreferred
    		};
    	};
    
    
    class RMobileSmsStore : public RMobilePhoneStore
    	{ 
    	// cut-down version of this class for compilation consistency
    public:
    
    	// enum needed to support CSmsMessage in gsmumsg.h and gsmumsg.inl
    	enum TMobileSmsStoreStatus
    		{
    		EStoredMessageUnknownStatus,
    		EStoredMessageUnread,
    		EStoredMessageRead,
    		EStoredMessageUnsent,
    		EStoredMessageSent,
    		EStoredMessageDelivered
    		};
    
    	// class needed to support TMobileGsmSmsEntryV1 below
    	class TMobileSmsEntryV1 : public RMobilePhoneStore::TMobilePhoneStoreEntryV1
    		{
    	public:
    		void InternalizeL(RReadStream& aStream);
    		void ExternalizeL(RWriteStream& aStream) const;
    	protected:
    		TMobileSmsEntryV1();
    	public:
    		TMobileSmsStoreStatus	iMsgStatus;	
    		};
    
    	// class needed to support a TGsmSlot constructor used in file gsmumsg.h
    	class TMobileGsmSmsEntryV1 : public TMobileSmsEntryV1
    		{
    	public:
    		void InternalizeL(RReadStream& aStream);
    		void ExternalizeL(RWriteStream& aStream) const;
    	public:
    		IMPORT_C TMobileGsmSmsEntryV1();
    	public:
    		RMobilePhone::TMobileAddress iServiceCentre;
    		RMobileSmsMessaging::TMobileSmsGsmTpdu	iMsgData;	
    		};
    	};
    	
    #endif
    Im guessing that this is not the right header file for getting the IMSI, am i correct?

    Thanks again.

  4. #4
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    Try including both

    #include <etel.h>
    #include <etelmm.h>

  5. #5
    Regular Contributor qt_chenchen's Avatar
    Join Date
    Jul 2008
    Posts
    51
    Quote Originally Posted by skumar_rao View Post
    Try including both

    #include <etel.h>
    #include <etelmm.h>
    I have included both, still same errors..

  6. #6
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    can you show us total error you are getting from "abld build armi urel" command by pasting it here.

  7. #7
    Regular Contributor qt_chenchen's Avatar
    Join Date
    Jul 2008
    Posts
    51
    Quote Originally Posted by skumar_rao View Post
    can you show us total error you are getting from "abld build armi urel" command by pasting it here.
    Here is it
    Code:
    removed for some reasons
    Thanks for helping..
    Last edited by qt_chenchen; 2009-05-06 at 04:08.

  8. #8
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    as it says TMobilePhoneSubscriberId' is not a member of type `RMobilePhone'
    so replace RMobilePhone::TMobilePhoneSubscriberId imsi; with TBuf<15> imsi;

  9. #9
    Regular Contributor qt_chenchen's Avatar
    Join Date
    Jul 2008
    Posts
    51
    Quote Originally Posted by skumar_rao View Post
    as it says TMobilePhoneSubscriberId' is not a member of type `RMobilePhone'
    so replace RMobilePhone::TMobilePhoneSubscriberId imsi; with TBuf<15> imsi;
    an error of "no matching function for call to `RMobilePhone::GetSubscriberId(TRequestStatus &, TBuf<15>&)'" occured

  10. #10
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    from header

    typedef TBuf<KIMSISize> TMobilePhoneSubscriberId;

    IMPORT_C void GetSubscriberId(TRequestStatus& aReqStatus, TMobilePhoneSubscriberId& aId) const;

  11. #11
    Regular Contributor qt_chenchen's Avatar
    Join Date
    Jul 2008
    Posts
    51
    Quote Originally Posted by skumar_rao View Post
    from header

    typedef TBuf<KIMSISize> TMobilePhoneSubscriberId;

    IMPORT_C void GetSubscriberId(TRequestStatus& aReqStatus, TMobilePhoneSubscriberId& aId) const;
    Can give some more details how/where to put this code? Thanks

  12. #12
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    in header
    TBuf<KIMSISize> imsi;

    in CPP

    iPhone.GetSubscriberId(iImsiStatus, imsi);

  13. #13
    Registered User anglina's Avatar
    Join Date
    Dec 2006
    Location
    Noida, India
    Posts
    150
    you can define this as-
    RMobilePhone::TMobilePhoneSubscriberId imsi;

Similar Threads

  1. Replies: 0
    Last Post: 2006-08-30, 02:14
  2. problems displaying video
    By gorsken in forum Mobile Java Media (Graphics & Sounds)
    Replies: 6
    Last Post: 2006-06-21, 17:18
  3. Link errors when trying to Display bitmap
    By Bkc82 in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2006-01-16, 22:46
  4. Whats wrong with this code?
    By jiasheng in forum Symbian C++
    Replies: 0
    Last Post: 2004-03-25, 19:20
  5. Progress bars: what's wrong with my code?
    By bobline in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2003-05-29, 18:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved