net: lwm2m: LwM2M engine time API update
Updated lwm2m_enigen_set/get_time API for support time_t. Updated LwM2M engine set/get resource time to time resource support time_t and uint32_t input. LwM2M engine put and get time API update to use time_t. Time series data cache entry have own type for time resource. Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
This commit is contained in:
parent
e1e2228e9c
commit
4bcc880670
12 changed files with 244 additions and 38 deletions
|
@ -457,7 +457,7 @@ ZTEST(net_content_raw_cbor_nomem, test_put_string_nomem)
|
|||
ZTEST(net_content_raw_cbor, test_put_time)
|
||||
{
|
||||
int ret;
|
||||
int64_t timestamp = 1;
|
||||
time_t timestamp = 1;
|
||||
struct test_payload_buffer expected_payload = {
|
||||
.data = {
|
||||
(0x06 << 5) | 0x00,
|
||||
|
@ -480,9 +480,11 @@ ZTEST(net_content_raw_cbor, test_put_time)
|
|||
|
||||
ZTEST(net_content_raw_cbor_nomem, test_put_time_nomem)
|
||||
{
|
||||
int ret;
|
||||
int ret = 0;
|
||||
time_t value = -1;
|
||||
|
||||
ret = cbor_writer.put_time(&test_out, &test_path, value);
|
||||
|
||||
ret = cbor_writer.put_time(&test_out, &test_path, UINT64_MAX);
|
||||
zassert_equal(ret, -ENOMEM, "Invalid error code returned");
|
||||
}
|
||||
|
||||
|
|
|
@ -907,7 +907,7 @@ ZTEST(net_content_senml_cbor_nomem, test_put_opaque_nomem)
|
|||
ZTEST(net_content_senml_cbor, test_put_time)
|
||||
{
|
||||
int ret;
|
||||
int64_t value = 1170111600;
|
||||
time_t value = 1170111600;
|
||||
struct test_payload_buffer expected_payload = {
|
||||
.data = {
|
||||
(0x04 << 5) | 1,
|
||||
|
@ -1480,7 +1480,7 @@ ZTEST(net_content_senml_cbor_nodata, test_get_opaque_nodata)
|
|||
ZTEST(net_content_senml_cbor, test_get_time)
|
||||
{
|
||||
int ret;
|
||||
int64_t expected_value = 1170111600;
|
||||
time_t expected_value = 1170111600;
|
||||
struct test_payload_buffer payload = {
|
||||
.data = {
|
||||
(0x04 << 5) | 1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue