1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
//! A NULL written to a property that isn't commandable and whose datatype
//! has no NULL in it (Clauses 15.9.2, 15.10.2 and 19.2.1).
//!
//! The standard treats such a write as a relinquish there is nothing to
//! relinquish from: if the request is otherwise sound, the property keeps
//! its value and the write counts as a success. WriteProperty,
//! WritePropertyMultiple, the server's local write path (`write_local`,
//! `write_local_encoded` and a Command's writes), CreateObject's initial
//! values and a Schedule's writes to its targets settle it here, for every
//! object, rather than each object deciding for itself. Clause 19.2.1 holds
//! local actions to the same prioritization rules as service requests, so
//! the local paths follow the services.
//!
//! The write still goes to the object first, so every check the object
//! makes before it looks at the value keeps its answer: an unknown property,
//! a property that isn't writable or isn't writable in the object's state,
//! an array index out of range or an array whose size is fixed. Only a
//! refusal of the NULL as a value of the wrong datatype, PROPERTY /
//! INVALID_DATA_TYPE, becomes a success, and then only when
//!
//! - the property isn't commandable on this object (where a NULL takes a
//! command out of the Priority_Array), and
//! - no member of its datatype is an application NULL ([`null_in_datatype`]).
//!
//! A property the object takes a NULL for never reaches this rule: a
//! commandable Present_Value relinquishing, a Schedule_Default storing NULL.
//! A reference property is no exception: an unset one reads, and is cleared
//! by writing, a reference to the reserved instance 4194303 (#1417), so a
//! NULL there comes here like on any other property.
//!
//! The value counts as a NULL when its whole encoding is one application
//! NULL. That covers a raw-octet property such as Recipient_List or an
//! Access Rights rule array, which reaches the object as those octets, and a
//! BACnetLIST written whole, which reaches it as a list of one NULL.
//!
//! An array element written with a NULL is judged the same way, against the
//! element's datatype, once the object has checked the index; index 0, the
//! array's size, is an Unsigned.
//!
//! Nothing changed, so nothing follows the write as a change: no COV report,
//! event pass, Schedule re-evaluation, Command run or save. An Audit
//! Reporter records it as the successful write the requester was told it is
//! (Clause 19.6.1). A CreateObject goes on to its next initial value, and a
//! Schedule counts the target as one that took its write.
use BACnetObject;
use ;
use ;
use PropertyValue;
/// The one encoding the rule applies to: an application-tagged NULL.
const NULL_OCTETS: = ;
/// Whether a write's encoded value is one application NULL and nothing else.
pub
/// Whether `value` encodes as one application NULL: `Null` itself, the raw
/// octets a raw-octet property receives for one, or a list of one NULL.
pub
/// Whether `error`, the object's refusal of a NULL written to `property` (at
/// `array_index`), makes the write a success that leaves the property as it
/// is. The caller has checked that the written value is a NULL.
pub
/// PROPERTY / INVALID_DATA_TYPE, plain or naming the list element refused.
/// Present_Value is the standard commandable property (Clause 19.2.1.1): on
/// an object that keeps a Priority_Array for it, and on a Channel, which
/// passes its commands on without one (Clause 19.2.1.6).
/// Whether an application NULL is a value of `property` on an object of
/// `object_type`, or of one element of it when it is an array or list.
///
/// These are the standard properties whose Clause 21 datatype is a CHOICE
/// with an untagged NULL member (BACnetPriorityValue, BACnetChannelValue,
/// BACnetClientCOV, BACnetProcessIdSelection, BACnetTimerStateChangeValue,
/// BACnetObjectSelector and the BACnetOptional types), and the Schedule's
/// Present_Value and Schedule_Default, which take a value of any datatype
/// (Clause 12.24). A CHOICE whose NULL member is context-tagged, such as
/// BACnetValueSource or BACnetFaultParameter, has no application NULL.
/// Index 0 of an array is its size, an Unsigned.
///
/// Most entries match on the property alone, whatever the object type, on
/// purpose: a property this names keeps its NULL away from the rule, so the
/// object's own answer stands. Naming too many is the safe direction; naming
/// too few would turn a refusal of a NULL the datatype allows into a
/// success that discards it.
pub