send time on init

This commit is contained in:
Shuanglei Tao
2025-06-26 21:03:23 +08:00
parent 46c31ae7d7
commit 59a63de6ac
2 changed files with 9 additions and 1 deletions

View File

@@ -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:

View File

@@ -13,7 +13,7 @@
#ifndef __EPD_SERVICE_H
#define __EPD_SERVICE_H
#include <stdint.h>
#include <inttypes.h>
#include <stdbool.h>
#include "ble.h"
#include "ble_srv_common.h"