Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: LwM2M Device Object model. #57

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dnav
Copy link

@dnav dnav commented Mar 25, 2023

First version with some details to sort out:

  • the propery Error_Code is an integer between 0 and 32 with choices and reserved values.
  • the thing ExtDevInfo has no defined reference has this is dependant on the implementation

David Navarro added 2 commits March 25, 2023 09:47
"label": "Device",
"description": "This LwM2M Object provides a range of device related information which can be queried by the LwM2M Server, and a device reboot and factory reset function.",
"sdfRequired": [
"#/sdfObject/Device/sdfAction/",
Copy link
Collaborator

@akeranen akeranen Mar 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"#/sdfObject/Device/sdfAction/",
"#/sdfObject/Device/sdfAction/Reboot",

This seems to be missing the affordance name

Copy link
Author

@dnav dnav Mar 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed.

It seems there is bug in the LwM2M to SDF converter at http://wishi.nomadiclab.com/sdf-converter/. If you try the following XML definition, the sdfRequired contains "#/sdfObject/Test/sdfAction/" instead of "#/sdfObject/Test/sdfAction/MandatoryAction".

<?xml version="1.0" encoding="UTF-8"?>

<LWM2M xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.openmobilealliance.org/tech/profiles/LWM2M.xsd">
  <Object ObjectType="MODefinition">
        <Name>Test</Name>
        <Description1><![CDATA[Test.]]></Description1>
        <ObjectID>777</ObjectID>
        <ObjectURN>urn:oma:lwm2m:oma:777</ObjectURN>
        <LWM2MVersion>1.0</LWM2MVersion>
        <ObjectVersion>1.0</ObjectVersion>
        <MultipleInstances>Single</MultipleInstances>
        <Mandatory>Optional</Mandatory>
        <Resources>
            <Item ID="0">
                <Name>MandatoryProp</Name>
                <Operations>R</Operations>
                <MultipleInstances>Single</MultipleInstances>
                <Mandatory>Mandatory</Mandatory>
                <Type>String</Type>
                <RangeEnumeration></RangeEnumeration>
                <Units></Units>
                <Description><![CDATA[]]></Description>
            </Item>
            <Item ID="1">
                <Name>OptionalProp</Name>
                <Operations>R</Operations>
                <MultipleInstances>Single</MultipleInstances>
                <Mandatory>Optional</Mandatory>
                <Type>String</Type>
                <RangeEnumeration></RangeEnumeration>
                <Units></Units>
                <Description><![CDATA[]]></Description>
            </Item>
            <Item ID="2">
                <Name>MandatoryAction</Name>
                <Operations>E</Operations>
                <MultipleInstances>Single</MultipleInstances>
                <Mandatory>Mandatory</Mandatory>
                <Type></Type>
                <RangeEnumeration></RangeEnumeration>
                <Units></Units>
                <Description><![CDATA[]]></Description>
            </Item>
            <Item ID="3">
                <Name>OptionalAction</Name>
                <Operations>E</Operations>
                <MultipleInstances>Single</MultipleInstances>
                <Mandatory>Optional</Mandatory>
                <Type></Type>
                <RangeEnumeration></RangeEnumeration>
                <Units></Units>
                <Description><![CDATA[]]></Description>
            </Item>
        </Resources>
        <Description2></Description2>
    </Object>
</LWM2M>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Fixed now in the ipso-odm toolkit. Unfortunately updating the web tool takes a bit more effort and will have to wait for later.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the web tool today, so it should work now.

"ExtDevInfo": {
"label": "ExtDevInfo",
"description": "Reference to external \"Device\" object instance containing information. For example, such an external device can be a Host Device, which is a device into which the Device containing the LwM2M client is embedded. This Resource may be used to retrieve information about the Host Device.",
"sdfRef": ""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, here "sdfType" : "link" is probably the best option, but probably needs some thinking.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"ExtDevInfo": {
"label": "ExtDevInfo",
"description": "Reference to external \"Device\" object instance containing information. For example, such an external device can be a Host Device, which is a device into which the Device containing the LwM2M client is embedded. This Resource may be used to retrieve information about the Host Device.",
"sdfType": "link",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! To enable using properties quality, just add also quality
"type" : "object"
(Yes, we need to update the schema to catch that. Thanks!)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Signed-off-by: David Navarro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants