Subject: [core] date and time format in CoAP optional header

From: Indtiny S <[email-masked]>
Date: Wed, 16 Jul 2014 11:02:32 +0530

Hi,

I have a requirment where I need to send a time of the data generated as
part of header in CoAP optional field . But none of the current defined
coap optional header supports a provision to fill the time ..

Can some body suggest proper way to provide the time information ..?

or is it possible to add a new header field ..?

Due to some restrictions I can not add in the payload ..

the features like observe also would need time during re-orderig ..

Rgds
Indra

---

From: Carsten Bormann <[email-masked]>
Date: Wed, 16 Jul 2014 08:11:37 +0200

On 16 Jul 2014, at 07:32, Indtiny S <[email-masked]> wrote:

> Hi,
> 
> I have a requirment where I need to send a time of the data generated as part of header in CoAP optional field . But none of the current defined coap optional header supports a provision to fill the time ..

What kind of time do you need?
Absolute time?  Monotonic vs. UTC?
What resolution?

What is the semantics that the time has?
(E.g., time of measurement, expiry time, …)?
How does it relate to the request/response?

> Can some body suggest proper way to provide the time information ..? 

CBOR (RFC 7049) has a number of time formats you could use.

> or is it possible to add a new header field ..?

CoAP allows defining new options (what would be called header fields in HTTP).  See section 12.2.

> Due to some restrictions I can not add in the payload .. 

Please explain some more.  This is the place where I would expect to carry time information.
You could use a container such as CBOR to package the time together with some existing format.

> the features like observe also would need time during re-orderig ..

Observe has a specialized 24-bit “timestamp” (in some virtual time).
Is that what you need?

Grüße, Carsten

---

From: Indtiny S <[email-masked]>
Date: Wed, 16 Jul 2014 16:01:31 +0530

I have to use UTC format

its realted to the time of data generated ( like similar to httpdate and
time )

> or is it possible to add a new header field ..?

CoAP allows defining new options (what would be called header fields in
HTTP).  See section 12.2.
Currently I am adding my option field 256 ..

> Due to some restrictions I can not add in the payload ..

Please explain some more.  This is the place where I would expect to carry
time information.
You could use a container such as CBOR to package the time together with
some existing format.
 payload is in compeltly binary format , at the client side whenever it
gets any data it checkw timestamp before converting from binary to standard
format.

This is used to provide sequence number rite ..?

Rgds
Indra