OLE Developer Guide  Latest Git
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
rdm_model.h
Go to the documentation of this file.
1 /*
2  * This library is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU Lesser General Public
4  * License as published by the Free Software Foundation; either
5  * version 2.1 of the License, or (at your option) any later version.
6  *
7  * This library is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10  * Lesser General Public License for more details.
11  *
12  * You should have received a copy of the GNU Lesser General Public
13  * License along with this library; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15  *
16  * rdm_model.h
17  * Copyright (C) 2015 Simon Newton
18  */
19 
41 #ifndef FIRMWARE_SRC_RDM_MODEL_H_
42 #define FIRMWARE_SRC_RDM_MODEL_H_
43 
44 #include <stdbool.h>
45 #include <stdint.h>
46 #include "rdm_frame.h"
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
56 typedef enum {
57  NULL_MODEL_ID = 0x0000,
58 
62  LED_MODEL_ID = 0x0100,
63 
67  PROXY_MODEL_ID = 0x0101,
68 
73 
77  SENSOR_MODEL_ID = 0x0103,
78 
82  NETWORK_MODEL_ID = 0x0104,
83 
87  DIMMER_MODEL_ID = 0x0105,
88 
94 
101 typedef enum {
109 } ModelIoctl;
110 
116 typedef struct {
117  uint16_t model_id;
118 
124  void (*activate_fn)();
125 
132  void (*deactivate_fn)();
133 
142  int (*ioctl_fn)(ModelIoctl command, uint8_t *data, unsigned int length);
143 
152  int (*request_fn)(const RDMHeader *header, const uint8_t *param_data);
153 
159  void (*tasks_fn)();
160 } ModelEntry;
161 
162 #ifdef __cplusplus
163 }
164 #endif
165 
170 #endif // FIRMWARE_SRC_RDM_MODEL_H_
ResponderModel
The Model IDs.
Definition: rdm_model.h:56
A responder that contains only sensors.
Definition: rdm_model.h:77
A responder that sits behind the PROXY_MODEL_ID device.
Definition: rdm_model.h:92
Copies the model's UID into the data pointer.
Definition: rdm_model.h:108
No model set.
Definition: rdm_model.h:57
A responder that acts as a dimmer with sub-devices.
Definition: rdm_model.h:87
A responder that acts as a proxy.
Definition: rdm_model.h:67
A responder that acts a moving light.
Definition: rdm_model.h:72
Remote Device Management.
The function table entry for a particular responder model.
Definition: rdm_model.h:116
ModelIoctl
Model ioctl enums.
Definition: rdm_model.h:101
A LED driver model.
Definition: rdm_model.h:62
uint16_t model_id
The model ID.
Definition: rdm_model.h:117
A responder that presents network interfaces.
Definition: rdm_model.h:82