OpenMobileAlliance / OMA_LwM2M_for_Developers

OMA LightweightM2M public resources.
http://openmobilealliance.github.io/OMA_LwM2M_for_Developers/
Other
240 stars 52 forks source link

Bootstrap Discover format #460

Closed jaudiger closed 3 years ago

jaudiger commented 5 years ago

Information

Problem

The LwM2M specification says that the Bootstrap Discover operation will return:

a list of application/link-format CoRE Links [RFC6690] containing the LwM2M Enabler Version and for each targeted Object - in addition to the Object Version (see Section 7.2. Object Versioning and Table: 5.1.2.-1 Class Attributes - a sub-list of the Instances of such an Object Instance. In order to fully identify the Server Accounts supported by the Client, each element of the Instances list of the Security Object (Object ID:0) includes the associated Short Server ID and LwM2M Server URI in its parameters list while the elements of the Instances list of the Server Object (Object ID:1) also report the associated Short Server ID in their parameters list.

As said earlier, this payload contains the LwM2M Enabler version. But my concern is this attribute doesn't belong to an URI: lwm2m="1.0",</0/0>;ssid=101;uri="coaps://server_1.example.com", </0/1/>, /2>;ssid=102;uri="coaps://server_2.example.com"

Or the RFC 6690 describes how the CoRE Link format is formatted:

    Link            = link-value-list
    link-value-list = [ link-value *[ "," link-value ]]
    link-value     = "<" URI-Reference ">" *( ";" link-param )
    link-param     = ( ( "rel" "=" relation-types )
                   / ( "anchor" "=" DQUOTE URI-Reference DQUOTE )
                   / ( "rev" "=" relation-types )
                   / ( "hreflang" "=" Language-Tag )
                   / ( "media" "=" ( MediaDesc
                          / ( DQUOTE MediaDesc DQUOTE ) ) )
                   / ( "title" "=" quoted-string )
                   / ( "title*" "=" ext-value )
                   / ( "type" "=" ( media-type / quoted-mt ) )
                   / ( "rt" "=" relation-types )
                   / ( "if" "=" relation-types )
                   / ( "sz" "=" cardinal )
                   / ( link-extension ) )
    link-extension = ( parmname [ "=" ( ptoken / quoted-string ) ] )
                   / ( ext-name-star "=" ext-value )
    ext-name-star  = parmname "*" ; reserved for RFC-2231-profiled
                                  ; extensions.  Whitespace NOT
                                  ; allowed in between.
    ptoken         = 1*ptokenchar
    ptokenchar     = "!" / "#" / "$" / "%" / "&" / "'" / "("
                   / ")" / "*" / "+" / "-" / "." / "/" / DIGIT
                   / ":" / "<" / "=" / ">" / "?" / "@" / ALPHA
                   / "[" / "]" / "^" / "_" / "`" / "{" / "|"
                   / "}" / "~"
    media-type     = type-name "/" subtype-name
    quoted-mt      = DQUOTE media-type DQUOTE
    relation-types = relation-type
                   / DQUOTE relation-type *( 1*SP relation-type ) DQUOTE
    relation-type  = reg-rel-type / ext-rel-type
    reg-rel-type   = LOALPHA *( LOALPHA / DIGIT / "." / "-" )
    ext-rel-type   = URI
    cardinal       = "0" / ( %x31-39 *DIGIT )
    LOALPHA        = %x61-7A   ; a-z
    quoted-string  = <defined in [RFC2616]>
    URI            = <defined in [RFC3986]>
    URI-Reference  = <defined in [RFC3986]>
    type-name      = <defined in [RFC4288]>
    subtype-name   = <defined in [RFC4288]>
    MediaDesc      = <defined in [W3C.HTML.4.01]>
    Language-Tag   = <defined in [RFC5646]>
    ext-value      = <defined in [RFC5987]>
    parmname       = <defined in [RFC5987]>

The link-param cannot be defined without a link-value. At least, this is my interpretation of the RFC.

An other example is the registration payload which respects the CoRE Link format with the attribute ct=: </>;ct=110,</1/0>,</1/1>,</2/0>,</2/1>,</2/2>,</2/3>,</2/4>,</3/0>,</4/0>,</5>

So, is there a reason which explains the Bootstrap Discover payload format ?

hannestschofenig commented 5 years ago

Thanks for pointing this out. We indeed have a bug in our example, which needs to get fixed in the v1.1 bugfix release.