Get data sent time in mesh model

Hello

I want the example code how to implement the time model i.e get the time, when the particular data is sent from server and received in client side along with the data(eg: temperature data : 23.5, temperature published at time : 15:30)

Hope i get the answer as soon as possible.

Thank You

Best Regards

Parents
  • Hi

    Please refer to the time_srv.h/.c files in ...\<NCS FOLDER>\v2.1.0\nrf\include\bluetooth\mesh\time_srv.h and ...\<NCS FOLDER>\v2.1.0\nrf\subsys\bluetooth\mesh\time_srv.c Here you have the functions (more descriptions are available in the time_srv.h file:

    • BT_MESH_TIME_SRV_INIT() that lets you set the initial parameters.
    • bt_mesh_time_srv_time_status_send() that publishes unsolicited time status messages.
    • bt_mesh_time_srv_mktime() and _localtime()  to get the device local time at a given uptime or local time
    • bt_mesh_time_srv_time_set() to set the TAI status parameters
    • bt_mesh_time_srv_role_set() to set role parameters for the server

    Best regards,

    Simon

Reply
  • Hi

    Please refer to the time_srv.h/.c files in ...\<NCS FOLDER>\v2.1.0\nrf\include\bluetooth\mesh\time_srv.h and ...\<NCS FOLDER>\v2.1.0\nrf\subsys\bluetooth\mesh\time_srv.c Here you have the functions (more descriptions are available in the time_srv.h file:

    • BT_MESH_TIME_SRV_INIT() that lets you set the initial parameters.
    • bt_mesh_time_srv_time_status_send() that publishes unsolicited time status messages.
    • bt_mesh_time_srv_mktime() and _localtime()  to get the device local time at a given uptime or local time
    • bt_mesh_time_srv_time_set() to set the TAI status parameters
    • bt_mesh_time_srv_role_set() to set role parameters for the server

    Best regards,

    Simon

Children
Related