Draft: draft-ietf-core-senml

Commentary: Small text changes to improve readability . RFC7159 has obsoleted RFC4627 Fixed bug in ex3 ( missing fraction of seconds in text ) Fixed inconsistent base names in ex5 and ex6 ( IPv6 vs 1 - wire ) Fixed EXI offsets Fixed " ver " in media type reg Referring to JSON registration in various IANA media type registrations
Connecting sensors to the internet is not new, and there have been
many protocols designed to facilitate it.  This specification defines
new media types for carrying simple sensor information in a protocol
such as HTTP or CoAP called the Sensor Markup Language (SenML).  This
format was designed so that processors with very limited capabilities
could easily encode a sensor measurement into the media type, while
at the same time a server parsing the data could relatively
efficiently collect a large number of sensor measurements.  The
markup language can be used for a variety of data flow models, most
notably data feeds pushed from a sensor to a collector, and the web
resource model where the sensor is requested as a resource
representation (e.g., "GET /sensor/temperature").
Connecting sensors to the internet is not new, and there have been
many protocols designed to facilitate it.  This specification defines
new media types for carrying simple sensor information in a protocol
such as HTTP or CoAP.  This format was designed so that processors
with very limited capabilities could easily encode a sensor
measurement into the media type, while at the same time a server
parsing the data could relatively efficiently collect a large number
of sensor measurements.  The markup language can be used for a
variety of data flow models, most notably data feeds pushed from a
sensor to a collector, and the web resource model where the sensor is
requested as a resource representation (e.g., "GET /sensor/
temperature").
A base unit that is assumed for all entries, unless otherwise
indicated.  This attribute is optional.  If a record does not
contain a unit value, then the base unit is used otherwise the
value of found in the Unit is used.  This applies to the entries
in all Records.  A Base Unit can only be included in the first
object of the array.
A base unit that is assumed for all entries, unless otherwise
indicated.  This attribute is optional.  If a record does not
contain a unit value, then the base unit is used.  Otherwise the
value of found in the Unit is used.  This applies to the entries
in all Records.  A Base Unit can only be included in the first
object of the array.
Units for a measurement value.  Optional.  If the Record has not
Unit, the Base Unit is used as the Unit.  Having no Unit and no
Base Unit is allowed.
Units for a measurement value.  Optional.  If the Record has no
Unit, the Base Unit is used as the Unit.  Having no Unit and no
Base Unit is allowed.
The root content consists of an array with JSON objects for each
SenML Record.  All the fields in the above table MAY occur in the
records with the type specified in the table.
Only the UTF-8 form of JSON is allowed.  Characters in the String
Value are encoded using the escape sequences defined in RFC4627.
Characters in the Data Value are base64 encoded with URL safe
alphabet as defined in Section 5 of RFC4648.
The root content consists of an array with one JSON object for each
SenML Record.  All the fields in the above table MAY occur in the
records with the type specified in the table.
Only the UTF-8 form of JSON is allowed.  Characters in the String
Value are encoded using the escape sequences defined in RFC7159.
Characters in the Data Value are base64 encoded with URL safe
alphabet as defined in Section 5 of RFC4648.
The next example is similar to the above one, but shows current at
Tue Jun 8 18:01:16 UTC 2010 and at each second for the previous 5
seconds.
The next example is similar to the above one, but shows current at
Tue Jun 8 18:01:16.001 UTC 2010 and at each second for the previous 5
seconds.
The following example shows humidity measurements from a mobile
device with an IPv6 address 2001:db8::1, starting at Mon Oct 31
13:24:24 UTC 2011.  The device also provides position data, which is
provided in the same measurement or parameter array as separate
entries.  Note time is used to for correlating data that belongs
together, e.g., a measurement and a parameter associated with it.
Finally, the device also reports extra data about its battery status
at a separate time.
The following example shows humidity measurements from a mobile
device with a 1-wire address 10e2073a01080063, starting at Mon Oct 31
13:24:24 UTC 2011.  The device also provides position data, which is
provided in the same measurement or parameter array as separate
entries.  Note time is used to for correlating data that belongs
together, e.g., a measurement and a parameter associated with it.
Finally, the device also reports extra data about its battery status
at a separate time.
Note the EXI sizes are not using the schema guidance so the EXI could
be a bit smaller.
Note the EXI sizes are not using the schema guidance so the EXI
representation could be a bit smaller.
A SenML Stream can also be represented in XML format as defined in
this section.  The following example shows an XML example for the
same sensor measurement as in co-ex.
A SenML Pack or Stream can also be represented in XML format as
defined in this section.  The following example shows an XML example
for the same sensor measurement as in co-ex.
Interoperability considerations: Applications should ignore any JSON
key value pairs that they do not understand.  This allows backwards
compatibility extensions to this specification.  The "ver" field can
be used to ensure the receiver supports a minimal level of
functionality needed by the creator of the JSON object.
Interoperability considerations: Applications should ignore any JSON
key value pairs that they do not understand.  This allows backwards
compatibility extensions to this specification.  The "bver" field can
be used to ensure the receiver supports a minimal level of
functionality needed by the creator of the JSON object.
Applications that use this media type: The type is used by systems
that report e.g., electrical power usage and environmental
information such as temperature and humidity.  It can be used for a
wide range of sensor reporting systems.