OLE Developer Guide  Latest Git
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
rdm_handler.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_handler.h
17  * Copyright (C) 2015 Simon Newton
18  */
19 
39 #ifndef FIRMWARE_SRC_RDM_HANDLER_H_
40 #define FIRMWARE_SRC_RDM_HANDLER_H_
41 
42 #include <stdbool.h>
43 #include <stdint.h>
44 #include "iovec.h"
45 #include "rdm_frame.h"
46 #include "rdm_model.h"
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
58 typedef void (*RDMHandlerSendCallback)(bool include_break,
59  const IOVec* data,
60  unsigned int iov_count);
61 
65 typedef struct {
66  uint16_t default_model;
67 
76 
81 void RDMHandler_Initialize(const RDMHandlerSettings *settings);
82 
91 bool RDMHandler_AddModel(const ModelEntry *entry);
92 
98 bool RDMHandler_SetActiveModel(uint16_t model_id);
99 
104 uint16_t RDMHandler_ActiveModel();
105 
114 void RDMHandler_HandleRequest(const RDMHeader *header,
115  const uint8_t *param_data);
116 
123 void RDMHandler_GetUID(uint8_t *uid);
124 
131 void RDMHandler_Tasks();
132 
133 #ifdef __cplusplus
134 }
135 #endif
136 
141 #endif // FIRMWARE_SRC_RDM_HANDLER_H_
uint16_t RDMHandler_ActiveModel()
Get the active model id.
bool RDMHandler_AddModel(const ModelEntry *entry)
Add a model to the list of available models.
RDMHandlerSendCallback send_callback
The callback to use for sending.
Definition: rdm_handler.h:74
void RDMHandler_HandleRequest(const RDMHeader *header, const uint8_t *param_data)
Handle a RDM Request.
void(* RDMHandlerSendCallback)(bool include_break, const IOVec *data, unsigned int iov_count)
The callback used to send RDM responses.
Definition: rdm_handler.h:58
An IOVector, with a pointer to memory and a length attribute.
Definition: iovec.h:35
void RDMHandler_Initialize(const RDMHandlerSettings *settings)
Initialize the RDM Handler sub-system.
uint16_t default_model
The default model to use.
Definition: rdm_handler.h:66
The settings to use for the RDM Handler.
Definition: rdm_handler.h:65
Remote Device Management.
void RDMHandler_Tasks()
Perform the periodic RDM Handler tasks.
The function table entry for a particular responder model.
Definition: rdm_model.h:116
bool RDMHandler_SetActiveModel(uint16_t model_id)
Change the active model of responder.
Vector I/O.
The API for an RDM Model implementation.
void RDMHandler_GetUID(uint8_t *uid)
Get the UID of the responder.