.NET Components for Mobility

Error with "user-perm" in Brencham.Obex

Last post 10-12-2008 1:27 PM by mcnamara. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 10-03-2008 1:14 PM

    Error with "user-perm" in Brencham.Obex

    Hello all / Andy,

    I'm trying to use the library to browse my phone. I have a LG KF600, and this phone has a pretty weird bluetooth implementation (it reports itself as "Cordless Phone", for example). I know it supports OBEX because I can browse the phone with an application called "Medieval Bluetooth File Transfer", but that app throws an exception if I try to send/receive more than 1 file in sequence. That's why I want to use this library and make my own OBEX browser.

    When I try to browse the phone using the "FolderExplorer2" sample, it throws an exception saying the "user-perm" attribute has an invalid value. I believe that maybe my phone doesn't implement that attribute, and the parser is not prepared for that, but I don't understand much about BT and OBEX. Even with the exception, my root folders are listed, but then the program hangs there.

    Is there any way this can be fixed/changed in the library?

    Here's the full exception message:

    "System.Xml.Schema.XmlSchemaException: The 'user-perm' attribute has an invalid value according to its data type."

    Testing via source, I found that the exception in thrown in this line:

    "Dim item As ObexFolderListingItem = parser.GetNextItem"

    Thanks a lot!
    Rodrigo

  • 10-03-2008 4:15 PM In reply to

    Re: Error with "user-perm" in Brencham.Obex

    Bah I wish these phone manufacturers would stop sending listings that contained bad data.  I just made a workaround in the last release for a problem in LG phones!

    Can you run the GetFolderListings sample and use the 'L' command, that'll download the 'raw' folder-listing XML and we can see what sort of bad data it contains.  I can probably give you a workaround too.

    BTW the Folder-Listing XML DTD has

         <!ATTLIST folder user-perm NMTOKEN #IMPLIED>

    So it must be something very odd being sent in the user-perm attribute!

    Andy 

  • 10-03-2008 4:20 PM In reply to

    Re: Error with "user-perm" in Brencham.Obex

    Hello Andy,

    The same exception happens on sony ericsson phone but only with one folder. The parent folder is called system so I guess it has to do something with system files of the phone? I will try to post the raw xml too.

     

    Te xml file is 19KB. Can I e-mail to you Andy?

  • 10-04-2008 7:39 AM In reply to

    Re: Error with "user-perm" in Brencham.Obex

    Yup  email me at yahoo.co.uk, to user andyhume32.

    In the LG case, only the root folder contained invalid content, so it was probably static context created by a human.  Sound like that might the case here too!

    For the workaround.  We can get the .NET XmlReader to not validate by the DTD, set static property ObexFolderListingParser.StripDocType to Yes before you access the listing and all should be ok.  (The UserPerm property will obviously then contain the invalid value but I guess you don't care. :-,))

    Andy 

  • 10-04-2008 10:02 AM In reply to

    Re: Error with "user-perm" in Brencham.Obex

     E-mail sent. By the way, did you see my previous e-mail?

  • 10-06-2008 12:37 PM In reply to

    Re: Error with "user-perm" in Brencham.Obex

     Any news?

  • 10-07-2008 6:33 AM In reply to

    Re: Error with "user-perm" in Brencham.Obex

    Well firstly I hope the workaround I gave is allowing you to continue working.

    Looking back I see that your original issue was with a LG phone, can you let me see a 'bad' listing from it too.  It might be a different issue.  The issue I fixed for the LG previously was with the date/time format and not with -perm.

    So, the listing from the SonyEricsson contains file items like the following:

        <file name="Petanque_2" size="313" created="20080721T175000Z" accessed="20080721T040000Z" user-perm=""/>

    Note that the user-perm attribute has an empty string value.  However, the DTD defined in the OBEX specification defines the user-perm and related attributes as:

        <!ATTLIST file user-perm NMTOKEN #IMPLIED>

    NMTOKEN however doesn't allow an empty value.  So the value in that listing is illegal per the DTD and hence the error from the .NET XmlReader.  SonyEricsson haven't checked the validity of the listing against the DTD!

    Thinking about the specification of the user-perm attribute however, and one sees that if an item is not Readable, Writeable, nor Deletable then the empty string is the correct value.  (Again SonyEricsson is sending bad data thus, presumably those files are really "RWD"!)  So, I'm going to change the library to contain a modified version of the DTD that substitutes CDATA for NMTOKEN there, that'll allow the empty string to be accepted.  I just have to decide how to make the original (more strict) version available to any library consumers that want it.

    Andy 

  • 10-07-2008 6:35 AM In reply to

    Re: Error with "user-perm" in Brencham.Obex

    It had made its way in to my junk mail folder. :-(  I'll have a look at your application when I get a free moment. :-)  It looks good.

    Andy 

  • 10-07-2008 7:09 AM In reply to

    Re: Error with "user-perm" in Brencham.Obex

    Nice news. I guess these changes will be included in version 1.7?

    Hope you like the application. Please let me know when you see it :)

     

    Thanks.

  • 10-07-2008 11:48 AM In reply to

    Re: Error with "user-perm" in Brencham.Obex

    Hello Andy/mcnamara!

    Sorry it took me so long to reply.

    Anyway, after some testing with the raw XML (using the GetFolderListing sample) I believe my problem is the same reported by mcnamara with a SE phone: the user-perm is empty on the XML.

    In my case, I found that all files (only files, not directories) are returned with an empty user-perm attribute (user-perm=""). I believe LG simply doesn't implement any permission control, so it just returns the empty attribute.

    I did not try to set the StripDocType property yet, but I will and then I'll send you a follow up here.

    Thanks!
    Rodrigo Sieiro

  • 10-08-2008 7:27 AM In reply to

    Re: Error with "user-perm" in Brencham.Obex

    Sorry chaps I hadn't noticed that there were two of you.  That explains some things!

    Yup same problem then Rodrigo.  If a device doesn't support permissions then it shouldn't send that attribute, or at least send it with "RWD".  "" implies no permission. :-,(  If you don't mind, send me an example listing, I want to see as many different formats as possible to check for any oddities.

     

    Yup this fix will be in 1.7.  I'm just needing a wee bit more time to double check the changes I've made, but it'll definately be released before Monday .  (It's probably unimportant for most that the two versions of the DTD are available, but I'm careful that way...)

    Andy

  • 10-08-2008 7:43 AM In reply to

    Re: Error with "user-perm" in Brencham.Obex

    Thank you Andy. Waiting for the release :)

    By the way, I have just sent an e-mail to you. Hope it does not get it junk again.

  • 10-08-2008 9:00 AM In reply to

    Re: Error with "user-perm" in Brencham.Obex

    Hello Andy!

    Here are two XML samples. First, the root folder:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd">
    <folder-listing version="1.0">
            <folder name="Images" modified="39080201T000000"/>
            <folder name="Sounds" modified="39080201T000000"/>
            <folder name="Videos" modified="39080201T000000"/>
            <folder name="Others" modified="39080201T000000"/>
            <folder name="Documents" modified="39080201T000000"/>
            <file name="._.Trashes" modified="39081021T231932" size="4096" user-perm=""/>
            <folder name=".Trashes" modified="39081021T231932"/>
            <folder name=".fseventsd" modified="39081021T232444"/>
            <file name="KF600" modified="39081108T094749" size="0" user-perm=""/>
    </folder-listing>

    Also the "Sounds" folder:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd">
    <folder-listing version="1.0">
            <parent-folder/>
            <file name="top_gear.mp3" modified="39081021T225032" size="490524" user-perm=""/>
    </folder-listing>

    Apart from the empty user-perm attribute, the dates are also very weird, but apparently you already knew that, right?

    The dates in general are very weird in this phone. For example, even if my date is set up and showing correctly on screen, all the pictures I take come with an EXIF "date taken" sometime in 2006.

  • 10-12-2008 12:37 PM In reply to

    Re: Error with "user-perm" in Brencham.Obex

    I've just uploaded 1.7.  (Including remembering to update the assembly version numbers this time!)

    It should work with those dodgy listings without any special configuration.  Let me know if all is good.

    Thanks for the sample folder-listings chaps, I've included them in my test suite.  The LG problem I saw earlier was with negative time values, those are *very* positive dates!!

    Andy

  • 10-12-2008 1:27 PM In reply to

    Re: Error with "user-perm" in Brencham.Obex

    Thanks Andy for the library, I will update my application. By the way, did you have a look at it?

    As Andy has forgotten to post the link for the latest version, here is the link: http://32feet.net/files/folders/objectexchange/entry6351.aspx

Page 1 of 1 (15 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.