Tange Cloud for Device
 Rev.333
载入中...
搜索中...
未找到
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/** @anchor pet_feeder */
16/** @name 喂食器
17 - DeviceType = PetFeeder
18 @{*/
19#define TCMD_FEEDER_GET_CONFIG 0x0500 ///< 查询配置. req: none; resp: Tcis_FeederConfig
20#define TCMD_FEEDER_SET_TIMERS 0x0502 ///< 设置喂食定时. req: Tcis_FeederTimers; resp: generic
21#define TCMD_FEEDER_GET_TIMERS 0x0504 ///< 获取喂食定时器设置. req: none; resp: Tcis_FeederTimers
22#define TCMD_FEEDER_FEED_FOOD 0x0506 ///< 手工喂食. req: Tcis_Feed; resp: generic
23
24/** 喂食器配置.
25 * TCMD_FEEDER_GET_CONFIG = 0x0500 \n
26 * 这个结构可能扩展. App 端要检查收到的数据包的长度
27 */
28typedef struct Tcis_FeederConfig {
29 int max_timers; ///< 支持的定时配置数
30 int max_servings; ///< 最大供食份数
31} __PACKED__ Tcis_FeederConfig;
32
33typedef struct FEEDERTIMER {
34 CLOCKTIME clock; ///< 喂食时间
35 uint8_t state; ///< 0:禁止(或单次定时器已执行); 1:有效(调度中)
36 uint8_t repeat; ///< weekdays mask. bit0:Sunday; bit1-Monday; ...
37 uint16_t serving; ///< 食物份数
38} __PACKED__ FEEDERTIMER;
39
40/** 喂食定时设置.
41 * TCMD_FEEDER_SET_TIMERS = 0x0500
42 * TCMD_FEEDER_GET_TIMERS = 0x0502
43 */
44typedef struct Tcis_FeederTimers {
45 int nTimers;
46 FEEDERTIMER tiems[1];
47} __PACKED__ Tcis_FeederTimers;
48
49/** 手动喂食.
50 * TCMD_FEEDER_FEED_FOOD = 0x0506
51 */
52typedef struct Tcis_Feed {
53 int nServing; ///< 投喂份数
54 int reserved; ///< 0
55} __PACKED__ Tcis_Feed;
56
57/**@}*/ //喂食器
58
59/**@}*/ //end of addtogroup p2pcmds
60#ifdef __cplusplus
61} /* extern "C" */
62#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; ...
手动喂食.
喂食定时设置.