bacnet/runtime/device.h
author Edouard Tisserant <edouard.tisserant@gmail.com>
Tue, 05 Jul 2022 10:16:11 +0200
changeset 3531 2253479cf0d9
parent 2649 db68cb0e6bdc
permissions -rw-r--r--
tests: add missing pic for debug_project sikuli test and remove depricated picture in edit_project
2020
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     1
/**************************************************************************
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     2
*
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     3
* Copyright (C) 2005 Steve Karg <skarg@users.sourceforge.net>
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     4
* Copyright (C) 2017 Mario de Sousa <msousa@fe.up.pt>
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     5
*
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     6
* Permission is hereby granted, free of charge, to any person obtaining
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     7
* a copy of this software and associated documentation files (the
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     8
* "Software"), to deal in the Software without restriction, including
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
     9
* without limitation the rights to use, copy, modify, merge, publish,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    10
* distribute, sublicense, and/or sell copies of the Software, and to
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    11
* permit persons to whom the Software is furnished to do so, subject to
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    12
* the following conditions:
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    13
*
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    14
* The above copyright notice and this permission notice shall be included
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    15
* in all copies or substantial portions of the Software.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    16
*
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    17
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    18
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    19
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    20
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    21
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    22
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    23
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    24
*
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    25
*********************************************************************/
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    26
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    27
/** device.h Defines functions for handling all BACnet objects belonging
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    28
 *                 to a BACnet device, as well as Device-specific properties. */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    29
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    30
#ifndef DEVICE_H
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    31
#define DEVICE_H
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    32
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    33
#include <stdbool.h>
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    34
#include <stdint.h>
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    35
#include "bacdef.h"
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    36
#include "bacenum.h"
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    37
#include "wp.h"
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    38
#include "rd.h"
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    39
#include "rp.h"
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    40
#include "rpm.h"
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    41
#include "readrange.h"
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    42
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    43
/** Called so a BACnet object can perform any necessary initialization.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    44
 */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    45
typedef void (
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    46
    *object_init_function) (
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    47
    void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    48
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    49
/** Counts the number of objects of this type.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    50
 * return: Count of implemented objects of this type.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    51
 */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    52
typedef unsigned (
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    53
    *object_count_function) (
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    54
    void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    55
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    56
/** Maps an object index position to its corresponding BACnet object instance number.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    57
 * param: index [in] The index of the object, in the array of objects of its type.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    58
 * return: The BACnet object instance number to be used in a BACNET_OBJECT_ID.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    59
 */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    60
typedef uint32_t(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    61
    *object_index_to_instance_function)
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    62
        (
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    63
    unsigned index);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    64
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    65
/** Provides the BACnet Object_Name for a given object instance of this type.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    66
 * param: object_instance [in] The object instance number to be looked up.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    67
 * param: object_name [in,out] Pointer to a character_string structure that
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    68
 *         will hold a copy of the object name if this is a valid object_instance.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    69
 * return: True if the object_instance is valid and object_name has been
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    70
 *         filled with a copy of the Object's name.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    71
 */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    72
typedef bool(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    73
    *object_name_function)
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    74
        (
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    75
    uint32_t object_instance,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    76
    BACNET_CHARACTER_STRING * object_name);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    77
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    78
/** Look in the table of objects of this type, and see if this is a valid
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    79
 *  instance number.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    80
 * param: [in] The object instance number to be looked up.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    81
 * return: True if the object instance refers to a valid object of this type.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    82
 */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    83
typedef bool(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    84
    *object_valid_instance_function) (
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    85
    uint32_t object_instance);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    86
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    87
/** Helper function to step through an array of objects and find either the
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    88
 * first one or the next one of a given type. Used to step through an array
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    89
 * of objects which is not necessarily contiguious for each type i.e. the
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    90
 * index for the 'n'th object of a given type is not necessarily 'n'.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    91
 * param: [in] The index of the current object or a value of ~0 to indicate
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    92
 * start at the beginning.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    93
 * return: The index of the next object of the required type or ~0 (all bits
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    94
 * == 1) to indicate no more objects found.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    95
 */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    96
typedef unsigned (
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    97
    *object_iterate_function) (
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    98
    unsigned current_index);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
    99
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   100
/** Look in the table of objects of this type, and get the COV Value List.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   101
 * param: [in] The object instance number to be looked up.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   102
 * param: [out] The value list
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   103
 * return: True if the object instance supports this feature, and has changed.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   104
 */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   105
typedef bool(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   106
    *object_value_list_function) (
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   107
    uint32_t object_instance,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   108
    BACNET_PROPERTY_VALUE * value_list);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   109
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   110
/** Look in the table of objects for this instance to see if value changed.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   111
 * param: [in] The object instance number to be looked up.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   112
 * return: True if the object instance has changed.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   113
 */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   114
typedef bool(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   115
    *object_cov_function) (
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   116
    uint32_t object_instance);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   117
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   118
/** Look in the table of objects for this instance to clear the changed flag.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   119
 * param: [in] The object instance number to be looked up.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   120
 */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   121
typedef void (
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   122
    *object_cov_clear_function) (
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   123
    uint32_t object_instance);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   124
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   125
/** Intrinsic Reporting funcionality.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   126
 * param: [in] Object instance.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   127
 */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   128
typedef void (
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   129
    *object_intrinsic_reporting_function) (
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   130
    uint32_t object_instance);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   131
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   132
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   133
/** Defines the group of object helper functions for any supported Object.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   134
 * Each Object must provide some implementation of each of these helpers
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   135
 * in order to properly support the handlers.  Eg, the ReadProperty handler
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   136
 * handler_read_property() relies on the instance of Object_Read_Property
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   137
 * for each Object type, or configure the function as NULL.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   138
 * In both appearance and operation, this group of functions acts like
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   139
 * they are member functions of a C++ Object base class.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   140
 */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   141
typedef struct object_functions {
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   142
    BACNET_OBJECT_TYPE Object_Type;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   143
    object_init_function Object_Init;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   144
    object_count_function Object_Count;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   145
    object_index_to_instance_function Object_Index_To_Instance;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   146
    object_valid_instance_function Object_Valid_Instance;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   147
    object_name_function Object_Name;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   148
    read_property_function Object_Read_Property;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   149
    write_property_function Object_Write_Property;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   150
    rpm_property_lists_function Object_RPM_List;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   151
    rr_info_function Object_RR_Info;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   152
    object_iterate_function Object_Iterator;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   153
    object_value_list_function Object_Value_List;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   154
    object_cov_function Object_COV;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   155
    object_cov_clear_function Object_COV_Clear;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   156
    object_intrinsic_reporting_function Object_Intrinsic_Reporting;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   157
} object_functions_t;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   158
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   159
/* String Lengths for Device Object properties that may be changed
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   160
 * (written to) over the BACnet network.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   161
 * Maximum sizes excluding nul terminator .
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   162
 */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   163
#define STRLEN_X(minlen, str)  (((minlen)>sizeof(str))?(minlen):sizeof(str))
2649
db68cb0e6bdc BACnet plugin: Add web interface for online parameter configuration
Mario de Sousa <msousa@fe.up.pt>
parents: 2020
diff changeset
   164
#define MAX_DEV_NAME_LEN STRLEN_X(%(BACnet_Param_String_Size)d, "%(BACnet_Device_Name)s")     /* Device name         */
db68cb0e6bdc BACnet plugin: Add web interface for online parameter configuration
Mario de Sousa <msousa@fe.up.pt>
parents: 2020
diff changeset
   165
#define MAX_DEV_LOC_LEN  STRLEN_X(%(BACnet_Param_String_Size)d, BACNET_DEVICE_LOCATION)       /* Device location     */
db68cb0e6bdc BACnet plugin: Add web interface for online parameter configuration
Mario de Sousa <msousa@fe.up.pt>
parents: 2020
diff changeset
   166
#define MAX_DEV_MOD_LEN  STRLEN_X(%(BACnet_Param_String_Size)d, BACNET_DEVICE_MODEL_NAME)     /* Device model name   */
db68cb0e6bdc BACnet plugin: Add web interface for online parameter configuration
Mario de Sousa <msousa@fe.up.pt>
parents: 2020
diff changeset
   167
#define MAX_DEV_VER_LEN  STRLEN_X(%(BACnet_Param_String_Size)d, BACNET_DEVICE_APPSOFT_VER)    /* Device application software version */
db68cb0e6bdc BACnet plugin: Add web interface for online parameter configuration
Mario de Sousa <msousa@fe.up.pt>
parents: 2020
diff changeset
   168
#define MAX_DEV_DESC_LEN STRLEN_X(%(BACnet_Param_String_Size)d, BACNET_DEVICE_DESCRIPTION)    /* Device description  */
db68cb0e6bdc BACnet plugin: Add web interface for online parameter configuration
Mario de Sousa <msousa@fe.up.pt>
parents: 2020
diff changeset
   169
2020
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   170
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   171
/** Structure to define the Object Properties common to all Objects. */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   172
typedef struct commonBacObj_s {
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   173
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   174
    /** The BACnet type of this object (ie, what class is this object from?).
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   175
     * This property, of type BACnetObjectType, indicates membership in a
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   176
     * particular object type class. Each inherited class will be of one type.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   177
     */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   178
    BACNET_OBJECT_TYPE mObject_Type;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   179
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   180
    /** The instance number for this class instance. */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   181
    uint32_t Object_Instance_Number;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   182
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   183
    /** Object Name; must be unique.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   184
     * This property, of type CharacterString, shall represent a name for
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   185
     * the object that is unique within the BACnet Device that maintains it.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   186
     */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   187
    char Object_Name[MAX_DEV_NAME_LEN];
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   188
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   189
} COMMON_BAC_OBJECT;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   190
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   191
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   192
/** Structure to define the Properties of Device Objects which distinguish
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   193
 *  one instance from another.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   194
 *  This structure only defines fields for properties that are unique to
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   195
 *  a given Device object.  The rest may be fixed in device.c or hard-coded
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   196
 *  into the read-property encoding.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   197
 *  This may be useful for implementations which manage multiple Devices,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   198
 *  eg, a Gateway.
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   199
 */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   200
typedef struct devObj_s {
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   201
    /** The BACnet Device Address for this device; ->len depends on DLL type. */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   202
    BACNET_ADDRESS bacDevAddr;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   203
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   204
    /** Structure for the Object Properties common to all Objects. */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   205
    COMMON_BAC_OBJECT bacObj;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   206
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   207
    /** Device Description. */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   208
    char Description[MAX_DEV_DESC_LEN];
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   209
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   210
    /** The upcounter that shows if the Device ID or object structure has changed. */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   211
    uint32_t Database_Revision;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   212
} DEVICE_OBJECT_DATA;
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   213
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   214
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   215
#ifdef __cplusplus
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   216
extern "C" {
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   217
#endif /* __cplusplus */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   218
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   219
    void Device_Init(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   220
        const char * Device_Object_Name);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   221
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   222
    bool Device_Reinitialize(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   223
        BACNET_REINITIALIZE_DEVICE_DATA * rd_data);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   224
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   225
    BACNET_REINITIALIZED_STATE Device_Reinitialized_State(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   226
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   227
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   228
    rr_info_function Device_Objects_RR_Info(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   229
        BACNET_OBJECT_TYPE object_type);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   230
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   231
    void Device_getCurrentDateTime(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   232
        BACNET_DATE_TIME * DateTime);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   233
    int32_t Device_UTC_Offset(void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   234
    bool Device_Daylight_Savings_Status(void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   235
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   236
    void Device_Property_Lists(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   237
        const int **pRequired,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   238
        const int **pOptional,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   239
        const int **pProprietary);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   240
    void Device_Objects_Property_List(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   241
        BACNET_OBJECT_TYPE object_type,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   242
        struct special_property_list_t *pPropertyList);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   243
    /* functions to support COV */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   244
    bool Device_Encode_Value_List(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   245
        BACNET_OBJECT_TYPE object_type,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   246
        uint32_t object_instance,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   247
        BACNET_PROPERTY_VALUE * value_list);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   248
    bool Device_Value_List_Supported(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   249
        BACNET_OBJECT_TYPE object_type);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   250
    bool Device_COV(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   251
        BACNET_OBJECT_TYPE object_type,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   252
        uint32_t object_instance);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   253
    void Device_COV_Clear(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   254
        BACNET_OBJECT_TYPE object_type,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   255
        uint32_t object_instance);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   256
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   257
    uint32_t Device_Object_Instance_Number(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   258
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   259
    bool Device_Set_Object_Instance_Number(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   260
        uint32_t object_id);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   261
    bool Device_Valid_Object_Instance_Number(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   262
        uint32_t object_id);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   263
    unsigned Device_Object_List_Count(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   264
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   265
    bool Device_Object_List_Identifier(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   266
        unsigned array_index,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   267
        int *object_type,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   268
        uint32_t * instance);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   269
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   270
    unsigned Device_Count(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   271
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   272
    uint32_t Device_Index_To_Instance(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   273
        unsigned index);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   274
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   275
    bool Device_Object_Name(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   276
        uint32_t object_instance,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   277
        BACNET_CHARACTER_STRING * object_name);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   278
    bool Device_Set_Object_Name(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   279
        BACNET_CHARACTER_STRING * object_name);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   280
    /* Copy a child object name, given its ID. */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   281
    bool Device_Object_Name_Copy(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   282
        BACNET_OBJECT_TYPE object_type,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   283
        uint32_t object_instance,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   284
        BACNET_CHARACTER_STRING * object_name);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   285
    bool Device_Object_Name_ANSI_Init(const char * value);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   286
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   287
    BACNET_DEVICE_STATUS Device_System_Status(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   288
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   289
    int Device_Set_System_Status(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   290
        BACNET_DEVICE_STATUS status,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   291
        bool local);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   292
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   293
    const char *Device_Vendor_Name(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   294
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   295
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   296
    uint16_t Device_Vendor_Identifier(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   297
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   298
    void Device_Set_Vendor_Identifier(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   299
        uint16_t vendor_id);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   300
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   301
    const char *Device_Model_Name(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   302
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   303
    bool Device_Set_Model_Name(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   304
        const char *name,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   305
        size_t length);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   306
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   307
    const char *Device_Firmware_Revision(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   308
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   309
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   310
    const char *Device_Application_Software_Version(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   311
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   312
    bool Device_Set_Application_Software_Version(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   313
        const char *name,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   314
        size_t length);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   315
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   316
    const char *Device_Description(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   317
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   318
    bool Device_Set_Description(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   319
        const char *name,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   320
        size_t length);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   321
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   322
    const char *Device_Location(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   323
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   324
    bool Device_Set_Location(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   325
        const char *name,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   326
        size_t length);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   327
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   328
    /* some stack-centric constant values - no set methods */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   329
    uint8_t Device_Protocol_Version(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   330
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   331
    uint8_t Device_Protocol_Revision(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   332
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   333
    BACNET_SEGMENTATION Device_Segmentation_Supported(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   334
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   335
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   336
    uint32_t Device_Database_Revision(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   337
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   338
    void Device_Set_Database_Revision(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   339
        uint32_t revision);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   340
    void Device_Inc_Database_Revision(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   341
        void);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   342
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   343
    bool Device_Valid_Object_Name(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   344
        BACNET_CHARACTER_STRING * object_name,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   345
        int *object_type,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   346
        uint32_t * object_instance);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   347
    bool Device_Valid_Object_Id(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   348
        int object_type,
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   349
        uint32_t object_instance);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   350
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   351
    int Device_Read_Property(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   352
        BACNET_READ_PROPERTY_DATA * rpdata);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   353
    bool Device_Write_Property(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   354
        BACNET_WRITE_PROPERTY_DATA * wp_data);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   355
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   356
    bool DeviceGetRRInfo(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   357
        BACNET_READ_RANGE_DATA * pRequest,      /* Info on the request */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   358
        RR_PROP_INFO * pInfo);  /* Where to put the information */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   359
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   360
    int Device_Read_Property_Local(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   361
        BACNET_READ_PROPERTY_DATA * rpdata);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   362
    bool Device_Write_Property_Local(
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   363
        BACNET_WRITE_PROPERTY_DATA * wp_data);
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   364
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   365
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   366
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   367
#ifdef __cplusplus
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   368
}
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   369
#endif /* __cplusplus */
6dddf3070806 Add BACnet extension from Mario de Sousa <msousa@fe.up.pt>
Edouard Tisserant
parents:
diff changeset
   370
#endif