×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    20

    problem with inbox - Errno -21

    Hi
    I have problem with a simple thing and I cant to solve it . I dont know where is problem . Maybe you help me.
    I want to print incoming sms, so I write code:


    import inbox
    import e32

    def detect_sms(sms_id):
    box = inbox.Inbox()
    cont_sms = box.content(sms_id)
    number = box.address(sms_id)
    smsinfo = "id:" + str(sms_id) + "Number:" + str(number) + "Cont:" + str(cont_sms) + "|"
    print(smsinfo)

    box = inbox.Inbox()
    box.bind(detect_sms)


    Emulator returns error:

    Traceback (most recent call last)
    File "c:\python\z_test.py", line 7, in detect_sms
    number = box.address(sms_id)
    SymbianError: [Errno -21]
    KErrAccessDenied

    Thank you for help

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: problem with inbox - Errno -21

    hello adamski9000

    thats strange and never checked on emulator but you generally get ERROR -21 when you dont have sufficient permissions to access the place you are trying to access. In your case thats the inbox.

  3. #3
    Regular Contributor
    Join Date
    Jan 2009
    Location
    India
    Posts
    138

    Re: problem with inbox - Errno -21

    Quote Originally Posted by adamski9000 View Post
    Hi
    I have problem with a simple thing and I cant to solve it . I dont know where is problem . Maybe you help me.
    I want to print incoming sms, so I write code:


    import inbox
    import e32

    def detect_sms(sms_id):
    box = inbox.Inbox()
    cont_sms = box.content(sms_id)
    number = box.address(sms_id)
    smsinfo = "id:" + str(sms_id) + "Number:" + str(number) + "Cont:" + str(cont_sms) + "|"
    print(smsinfo)

    box = inbox.Inbox()
    box.bind(detect_sms)


    Emulator returns error:

    Traceback (most recent call last)
    File "c:\python\z_test.py", line 7, in detect_sms
    number = box.address(sms_id)
    SymbianError: [Errno -21]
    KErrAccessDenied

    Thank you for help
    Hi Adamski9000,

    In detect_sms() method you have to use wait for some seconds.I have modified your detect_sms() method try this code.

    Code:
    def detect_sms(sms_id):
        e32.ao_sleep(10)
        box = inbox.Inbox()
        cont_sms = box.content(sms_id)
        number = box.address(sms_id)
        smsinfo = "id:" + str(sms_id) + "Number:" + str(number) + "Cont:" + str(cont_sms) + "|"
        print(smsinfo)
    Hope it helps for you.
    Pavan Pareta
    Sr. Software Engineer
    http://windows-mobile-dev.blogspot.com

  4. #4
    Registered User
    Join Date
    Nov 2005
    Posts
    20

    Re: problem with inbox - Errno -21

    Thank you Pavan and Gaba88 for help.

    I dont understand this problem with waiting and sufficient permissions, but the most important - it works well !
    I added method e32.ao_sleep(10) and everything is OK !

    Thank you and rgards
    adamski9000

  5. #5
    Regular Contributor
    Join Date
    Aug 2004
    Posts
    295

    Re: problem with inbox - Errno -21

    The problem is that Inbox class is buggy, the callback is called too early. The c++ implementation should be changed.

Similar Threads

  1. Replies: 10
    Last Post: 2009-04-17, 16:49
  2. Creating MMS to Inbox problem
    By mikkoiv in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2007-12-10, 13:58
  3. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36
  4. 7210 Silent Problem
    By MarkMckim in forum Mobile Java General
    Replies: 1
    Last Post: 2003-03-18, 12:36
  5. PJava runtime problem within Nokia 9210, Hrlp~!
    By Nokia_Archive in forum PersonalJava
    Replies: 1
    Last Post: 2002-05-28, 13:15

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×