diff --git a/EPD/EPD_service.c b/EPD/EPD_service.c index 80fb9cd..2d89c5e 100644 --- a/EPD/EPD_service.c +++ b/EPD/EPD_service.c @@ -87,6 +87,13 @@ static void epd_update_display_mode(ble_epd_t * p_epd, display_mode_t mode) } } +static void epd_send_time(ble_epd_t * p_epd) +{ + char buf[20] = {0}; + snprintf(buf, 20, "t=%"PRIu32, timestamp()); + ble_epd_string_send(p_epd, (uint8_t *)buf, strlen(buf)); +} + static void epd_service_on_write(ble_epd_t * p_epd, uint8_t * p_data, uint16_t length) { NRF_LOG_DEBUG("[EPD]: on_write LEN=%d\n", length); @@ -121,6 +128,7 @@ static void epd_service_on_write(ble_epd_t * p_epd, uint8_t * p_data, uint16_t l epd_config_write(&p_epd->config); } p_epd->epd = epd_init((epd_model_id_t)id); + epd_send_time(p_epd); } break; case EPD_CMD_CLEAR: diff --git a/EPD/EPD_service.h b/EPD/EPD_service.h index 5ed4ac5..2afcf77 100644 --- a/EPD/EPD_service.h +++ b/EPD/EPD_service.h @@ -13,7 +13,7 @@ #ifndef __EPD_SERVICE_H #define __EPD_SERVICE_H -#include +#include #include #include "ble.h" #include "ble_srv_common.h"