Files
domo-iot/src/devices/devices_manager_internal.h
NADAL Jean-Baptiste 9ffd1a4e55 Fix indents troubles
2020-01-13 11:35:25 +01:00

70 lines
3.3 KiB
C

/*!
* devices_manager_internal.h
*
* Copyright (c) 2015-2020, NADAL Jean-Baptiste. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*
* @Author: NADAL Jean-Baptiste
* @Date: 07/01/2020
*
*/
#ifndef _DEVICES_MANAGER_INTERNAL_H
#define _DEVICES_MANAGER_INTERNAL_H
/*------------------------------- INCLUDES ----------------------------------*/
#include <stdint.h>
#include "devices_manager.h"
struct json_object;
/*--------------------------- PUBLIC FUNCTIONS -------------------------------*/
/*-------------------------------- OUTLETS -----------------------------------*/
extern int load_outlets(devices_manager_t *dm, struct json_object *node);
extern struct json_object *save_outlets(devices_manager_t *dm);
extern int create_outlet(devices_manager_t *dm, struct json_object *node);
extern int remove_outlet(devices_manager_t *dm, uint16_t id);
extern int update_outlet(devices_manager_t *dm, uint16_t id, struct json_object *node);
extern int set_outlet_state(devices_manager_t *dm, uint16_t id, bool state);
extern outlet_dio_t *get_outlet_by_id(devices_manager_t *dm, uint16_t id);
extern struct json_object *devices_manager_outlets_to_json_object(devices_manager_t *dm);
/*-------------------------------- SHUTTERS -----------------------------------*/
extern int load_shutters(devices_manager_t *dm, struct json_object *node);
extern struct json_object *save_shutters(devices_manager_t *dm);
extern int create_shutter(devices_manager_t *dm, struct json_object *node);
extern int remove_shutter(devices_manager_t *dm, uint16_t id);
extern int update_shutter(devices_manager_t *dm, uint16_t id, struct json_object *node);
extern int set_shutter_state(devices_manager_t *dm, uint16_t id, bool state);
extern shutter_t *get_shutter_by_id(devices_manager_t *dm, uint16_t id);
extern struct json_object *devices_manager_shutters_to_json_object(devices_manager_t *dm);
/*------------------------------- SPRINKLERS ----------------------------------*/
extern int load_sprinklers(devices_manager_t *dm, struct json_object *node);
extern struct json_object *save_sprinklers(devices_manager_t *dm);
extern int create_sprinkler(devices_manager_t *dm, struct json_object *node);
extern int remove_sprinkler(devices_manager_t *dm, uint16_t id);
extern int update_sprinkler(devices_manager_t *dm, uint16_t id, struct json_object *node);
extern int set_sprinkler_state(devices_manager_t *dm, uint16_t id, bool state);
extern sprinkler_t *get_sprinkler_by_id(devices_manager_t *dm, uint16_t id);
extern struct json_object *devices_manager_sprinklers_to_json_object(devices_manager_t *dm);
#endif /* _DEVICES_MANAGER_INTERNAL_H */