Tange Cloud for Device
 Rev.352
载入中...
搜索中...
未找到
TgCloudCmd_sp.h
浏览该文件的文档.
1/** \file TgCloudCmd_sp.h
2 *
3 * 本文件包含特殊类型设备的命令和数据结构
4 */
5#pragma once
6
7#include "TgCloudCmd.h"
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12
13/** @addtogroup p2pcmds
14 * @{*/
15
16/** @anchor pet_feeder */
17/** @name 喂食器
18 - DeviceType = PetFeeder
19 @{*/
20#define TCMD_FEEDER_GET_CONFIG 0x0500 ///< 查询配置. req: none; resp: Tcis_FeederConfig
21#define TCMD_FEEDER_SET_TIMERS 0x0502 ///< 设置喂食定时. req: Tcis_FeederTimers; resp: generic
22#define TCMD_FEEDER_GET_TIMERS 0x0504 ///< 获取喂食定时器设置. req: none; resp: Tcis_FeederTimers
23#define TCMD_FEEDER_FEED_FOOD 0x0506 ///< 手工喂食. req: Tcis_Feed; resp: generic
24
25/** 喂食器配置.
26 * TCMD_FEEDER_GET_CONFIG = 0x0500 \n
27 * 这个结构可能扩展. App 端要检查收到的数据包的长度
28 */
29typedef struct Tcis_FeederConfig {
30 int max_timers; ///< 支持的定时配置数
31 int max_servings; ///< 最大供食份数
32} __PACKED__ Tcis_FeederConfig;
33
34typedef struct FEEDERTIMER {
35 CLOCKTIME clock; ///< 喂食时间
36 uint8_t state; ///< 0:禁止(或单次定时器已执行); 1:有效(调度中)
37 uint8_t repeat; ///< weekdays mask. bit0:Sunday; bit1-Monday; ...
38 uint16_t serving; ///< 食物份数
39} __PACKED__ FEEDERTIMER;
40
41/** 喂食定时设置.
42 * TCMD_FEEDER_SET_TIMERS = 0x0500
43 * TCMD_FEEDER_GET_TIMERS = 0x0502
44 */
45typedef struct Tcis_FeederTimers {
46 int nTimers;
47 FEEDERTIMER tiems[1];
48} __PACKED__ Tcis_FeederTimers;
49
50/** 手动喂食.
51 * TCMD_FEEDER_FEED_FOOD = 0x0506
52 */
53typedef struct Tcis_Feed {
54 int nServing; ///< 投喂份数
55 int reserved; ///< 0
56} __PACKED__ Tcis_Feed;
57
58/**@}*/ //喂食器
59
60/**@}*/ //end of addtogroup p2pcmds
61#ifdef __cplusplus
62} /* extern "C" */
63#endif
P2p Commands and Structures
时钟表示.
uint16_t serving
食物份数
CLOCKTIME clock
喂食时间
uint8_t state
0:禁止(或单次定时器已执行); 1:有效(调度中)
int nServing
投喂份数
int max_timers
支持的定时配置数
int max_servings
最大供食份数
uint8_t repeat
weekdays mask. bit0:Sunday; bit1-Monday; ...
手动喂食.
喂食定时设置.