/** * @file device_ctrl_service.h * @author zhaohe (h_zhaohe@domain.com) * @brief 设备控制服务 * @version 0.1 * @date 2024-02-01 * * @copyright Copyright (c) 2024 * */ #pragma once #include "znordic.h" typedef enum { // 待机 kdevice_state_standby = 0, // Ready kdevice_state_ready = 1, // sample kdevice_state_sampling = 2, } device_state_t; static const char* ds2str(device_state_t ds) { switch (ds) { case kdevice_state_standby: return "standby"; case kdevice_state_ready: return "ready"; case kdevice_state_sampling: return "sampling"; default: return "unknown"; } } void DeviceCtrl_change_to_state(device_state_t state); uint32_t DeviceCtrl_cur_state_haspassed_ms(); device_state_t DeviceCtrl_now_state(); void DeviceCtrl_startSample(int duration_ms); void DeviceCtrl_stopSample(); void DeviceCtrl_schdeule(); void DeviceCtrl_init();