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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
202 changes: 202 additions & 0 deletions sdfObject/sdfthing-oma-device.sdf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
{
"info": {
"title": "OMA LwM2M Device (Object ID 3)",
"version": "2020-11-10",
"copyright": "Copyright 2020 Open Mobile Alliance",
"license": "BSD-3-Clause"
},
"namespace": {
"oma": "https://onedm.org/ecosystem/oma"
},
"defaultNamespace": "oma",
"sdfThing": {
"Device": {
"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 nction.",
"sdfRequired": [
"#/sdfObject/Device/sdfAction/Reboot",
"#/sdfObject/Device/sdfProperty/Error_Code",
"#/sdfObject/Device/sdfProperty/Supported_Binding_and_Modes"
],
"sdfProperty": {
"Manufacturer": {
"label": "Manufacturer",
"description": "Human readable manufacturer name",
"writable": false,
"type": "string"
},
"Model_Number": {
"label": "Model Number",
"description": "A model identifier (manufacturer specified string)",
"writable": false,
"type": "string"
},
"Serial_Number": {
"label": "Serial Number",
"description": "Serial Number",
"writable": false,
"type": "string"
},
"Firmware_Version": {
"label": "Firmware Version",
"description": "Current firmware version of the Device. The Firmware Management function could rely on this resource.",
"writable": false,
"type": "string"
},
"Battery_Level": {
"label": "Battery Level",
"description": "Contains the current battery level as a percentage (with a range from 0 to 100). This value is only valid for the Device internal Battery if esent (one Available Power Sources Resource Instance is 1).",
"writable": false,
"type": "integer",
"unit": "/100",
"minimum": 0,
"maximum": 100
},
"Memory_Free": {
"label": "Memory Free",
"description": "Estimated current available amount of storage space which can store data and software in the LwM2M Device (expressed in kilobytes). Note: 1 lobyte corresponds to 1000 bytes.",
"writable": false,
"type": "integer"
},
"Error_Code": {
"label": "Error Code",
"description": "When the single Device Object Instance is initiated, there is only one error code Resource Instance whose value is equal to 0 that means no ror. When the first error happens, the LwM2M Client changes error code Resource Instance to any non-zero value to indicate the error type. When any other ror happens, a new error code Resource Instance is created. When an error associated with a Resource Instance is no longer present, that Resource Instance deleted. When the single existing error is no longer present, the LwM2M Client returns to the original no error state where Instance 0 has value 0. This ror code Resource MAY be observed by the LwM2M Server. How to deal with LwM2M Client's error report depends on the policy of the LwM2M Server. Error codes between 16 and 32 are specific to the Device and may have different meanings among implementations.",
"writable": false,
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 32,
"sdfChoice": {
"No error": { "const": 0 },
"Low battery power": { "const": 1 },
"External power supply off": { "const": 2 },
"GPS module failure": { "const": 3 },
"Low received signal strength": { "const": 4 },
"Out of memory": { "const": 5 },
"SMS failure": { "const": 6 },
"IP connectivity failure": { "const": 7 },
"Peripheral malfunction": { "const": 8},
"Reserved for future use": {"type": "integer", "minimum": 9, "maximum": 15},
"Device specific error codes": {"type": "integer", "minimum": 16, "maximum": 32}
}
}
},
"Current_Time": {
"label": "Current Time",
"description": "Current UNIX time of the LwM2M Client. The LwM2M Client should be responsible to increase this time value as every second elapses. The LwM2M rver is able to write this Resource to make the LwM2M Client synchronized with the LwM2M Server.",
"type": "number",
"sdfType": "unix-time"
},
"UTC_Offset": {
"label": "UTC Offset",
"description": "Indicates the UTC offset currently in effect for this LwM2M Device. UTC+X [ISO 8601].",
"type": "string"
},
"Timezone": {
"label": "Timezone",
"description": "Indicates in which time zone the LwM2M Device is located, in IANA Timezone (TZ) database format.",
"type": "string"
},
"Supported_Binding_and_Modes": {
"label": "Supported Binding and Modes",
"description": "Indicates which bindings and modes are supported in the LwM2M Client. The possible values are those listed in the LwM2M Core Specification.",
"writable": false,
"type": "string"
},
"Device_Type": {
"label": "Device Type",
"description": "Type of the device (manufacturer specified string: e.g. smart meters / dev Class / ...)",
"writable": false,
"type": "string"
},
"Hardware_Version": {
"label": "Hardware Version",
"description": "Current hardware version of the device",
"writable": false,
"type": "string"
},
"Software_Version": {
"label": "Software Version",
"description": "Current software version of the device (manufacturer specified string). On elaborated LwM2M device, SW could be split in 2 parts: a firmware e and a higher level software on top. Both pieces of Software are together managed by LwM2M Firmware Update Object (Object ID 5)",
"writable": false,
"type": "string"
},
"Battery_Status": {
"label": "Battery Status",
"description": "This value is only valid for the Device Internal Battery if present (one Available Power Sources Resource Instance value is 1). Battery atus\tMeaning\tDescription 0\tNormal\tThe battery is operating normally and not on power. 1\tCharging\tThe battery is currently charging. 2\tCharge mplete\tThe battery is fully charged and still on power. 3\tDamaged\tThe battery has some problem. 4\tLow Battery\tThe battery is low on charge. 5\tNot stalled\tThe battery is not installed. 6\tUnknown\tThe battery information is not available.",
"writable": false,
"type": "integer",
"minimum": 0,
"maximum": 6
},
"Memory_Total": {
"label": "Memory Total",
"description": "Total amount of storage space which can store data and software in the LwM2M Device (expressed in kilobytes). Note: 1 kilobyte corresponds to 00 bytes.",
"writable": false,
"type": "integer"
},
"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 vice into which the Device containing the LwM2M client is embedded. This Resource may be used to retrieve information about the Host Device.",
"type" : "object",
"sdfType": "link",
"properties": {
"href": { "type": "string" }
}
}
},
"sdfAction": {
"Reboot": {
"label": "Reboot",
"description": "Reboot the LwM2M Device to restore the Device from unexpected firmware failure."
},
"Factory_Reset": {
"label": "Factory Reset",
"description": "Perform factory reset of the LwM2M Device to make the LwM2M Device to go through initial deployment sequence where provisioning and bootstrap quence is performed. This requires client ensuring post factory reset to have minimal information to allow it to carry out one of the bootstrap methods ecified in section 5.2.3. When this Resource is executed, \"De-register\" operation MAY be sent to the LwM2M Server(s) before factory reset of the LwM2M vice."
},
"Reset_Error_Code": {
"label": "Reset Error Code",
"description": "Delete all error code Resource Instances and create only one zero-value error code that implies no error, then re-evaluate all error nditions and update and create Resources Instances to capture all current error conditions."
}
},
"sdfThing": {
"Power_Source": {
"minItems": 0,
"sdfProperty": {
"Type": {
"label": "Type",
"description": "Type of the Available Power Source.0: DC power 1: Internal Battery 2: External Battery 3: Fuel Cell 4: Power over Ethernet 5: USB 6: AC ains) power 7: Solar The same Resource Instance ID MUST be used to associate a given Power Source (Resource ID:6) with its Present Voltage (Resource :7) and its Present Current (Resource ID:8)",
"writable": false,
"type": "integer",
"sdfChoice": {
"DC power": { "const": 0 },
"Internal Battery": { "const": 1 },
"External Battery": { "const": 2 },
"Fuel Cell": { "const": 3 },
"Power over Ethernet": { "const": 4 },
"USB": { "const": 5 },
"AC (Mains) power": { "const": 6 },
"Solar": { "const": 7 }
}
},
"Voltage": {
"label": "Voltage",
"description": "Present voltage for the Available Power Source.",
"writable": false,
"type": "integer",
"unit": "mV"
},
"Current": {
"label": "Current",
"description": "Present current for the Power Source.",
"writable": false,
"type": "integer",
"unit": "mA"
}
}
}
}
}
}
}