2
* Copyright (C) 2010, 2011 Tuomo Penttinen, all rights reserved.
4
* Author: Tuomo Penttinen <tp@herqq.org>
6
* This file is part of Herqq UPnP (HUPnP) library.
8
* Herqq UPnP is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU Lesser General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
11
* (at your option) any later version.
13
* Herqq UPnP is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public License
19
* along with Herqq UPnP. If not, see <http://www.gnu.org/licenses/>.
22
#ifndef HUPNP_GLOBAL_H_
23
#define HUPNP_GLOBAL_H_
25
#include <HUpnpCore/public/hupnp_fwd.h>
26
#include <HUpnpCore/public/hupnp_defs.h>
30
* This file contains public functions and enumerations.
40
* \brief This enumeration specifies the generic error codes that UPnP action invocation
43
* These values correspond to the values defined in the UDA, excluding
44
* \c NotImplemented and \c UndefinedFailure, which are defined for the purposes
47
* \note These are only the generic error codes. Many UPnP devices define
48
* and use domain specific error codes that cannot be specified here.
53
* \brief Action invocation succeeded.
55
* Action invocation succeeded.
62
* The specified action was not found.
64
UpnpInvalidAction = 401,
67
* Action invocation failed due to:
68
* \li not enough arguments,
69
* \li arguments in wrong order,
70
* \li one or more arguments have wrong data type
72
UpnpInvalidArgs = 402,
75
* \brief The current state of the service prevents the action invocation.
77
* The current state of the service prevents the action invocation.
79
UpnpActionFailed = 501,
82
* \brief Action invocation failed due to an invalid argument value.
84
* Action invocation failed due to an invalid argument value.
86
UpnpArgumentValueInvalid = 600,
89
* Action invocation failed due to:
90
* \li an argument value is less than the minimum of the allowed value range,
91
* \li an argument value is more than the maximum of the allowed value range,
92
* \li an argument value is not in the allowed value list
94
UpnpArgumentValueOutOfRange = 601,
97
* Action invocation failed due to the requested action being optional
98
* and not implemented by the device.
100
UpnpOptionalActionNotImplemented = 602,
103
* Action invocation failed due to insufficient memory.
105
* The device does not have sufficient memory available to complete the action.
106
* This MAY be a temporary condition; the control point MAY choose to retry the
107
* unmodified request again later and it MAY succeed if memory is available.
109
UpnpOutOfMemory = 603,
112
* The device has encountered an error condition which it cannot resolve itself
113
* and required human intervention such as a reset or power cycle. See the device
114
* display or documentation for further guidance.
116
UpnpHumanInterventionRequired = 604,
119
* Action invocation failed due to a string argument being
120
* too long for the device to handle properly.
122
UpnpStringArgumentTooLong = 605,
125
* The action invocation is in progress.
128
* This value is defined and used by HUPnP in-process only.
130
UpnpInvocationInProgress = 0x00f00000,
133
* \brief Action invocation failed, but the exact cause could not be determined.
135
* Action invocation failed, but the exact cause could not be determined.
138
* This value is defined and used by HUPnP in-process only.
140
UpnpUndefinedFailure = 0x0ff00000,
143
* The action invocation was aborted by user.
146
* This value is defined and used by HUPnP in-process only.
148
UpnpInvocationAborted = 0x00f00001
152
* \brief Returns a string representation of the specified error code.
154
* \param errCode specififes the error code.
156
* \return a string representation of the specified error code.
158
QString H_UPNP_CORE_EXPORT upnpErrorCodeToString(qint32 errCode);
161
* \brief This enumeration specifies how a device tree should be traversed given a
164
* HUPnP \ref hupnp_devicemodel is organized into a tree that has a root
165
* device, which may contain embedded devices as its children and they may contain
166
* embedded devices as their children recursively.
168
* \brief This enumeration is used to specify how a device and its children are traversed.
173
* This value is used to indicate that only the device in question is visited.
178
* This value is used to indicate that this device and its embedded devices
181
VisitThisAndDirectChildren,
184
* This value is used to indicate that this device and all of its child
185
* devices are visited recursively.
191
* \brief This enumeration specifies the device types that are considered as
192
* \e targets of an operation.
194
enum TargetDeviceType
197
* This value is used to indicate that \b all devices, both root and
198
* embedded are the targets of an operation.
203
* This value is used to indicate that \b only embedded devices are the
204
* targets of an operation.
209
* This value is used to indicate that \b only root devices are the
210
* targets of an operation.
216
* \brief This enumeration specifies the type of a device location URL.
221
* The absolute URL for the device description.
226
* The base URL of the device. This is the URL with which the various
227
* other URLs found in a device description are resolved.
233
* \brief This enumeration is used to specify the strictness of argument validation.
235
* \ingroup hupnp_common
237
enum HValidityCheckLevel
240
* The arguments are validated strictly according to the UDA
241
* v1.0 and v1.1 specifications.
246
* The validation allows slight deviations from the UDA specifications
247
* in an attempt to improve interoperability. The accepted exceptions
248
* have been encountered in other UPnP software that are popular enough
249
* to warrant the exceptional behavior.
255
* \brief This enumeration specifies whether a component of the \ref hupnp_devicemodel is
256
* mandatory within a specific UPnP device.
258
* In more detail, any component of the device model
259
* (a device, a service, a state variable or an action) may be specified as
260
* a mandatory or an optional part of a UPnP device; for example,
261
* a UPnP device may have two mandatory embedded devices and one
262
* optional embedded device. The same applies to the other components as well.
264
* When HUPnP builds an object model of a UPnP device, this information can be
265
* used in validating a description document, or verifying that the provided
266
* device tree accurately depicts a description document.
268
* For instance, if the author of a subclass of a HServerService has
269
* specified that a particular action is mandatory, the user of the class,
270
* who is the one that provides the description document, has to make sure that
271
* the description document also contains the definition of the action.
273
* These types of mappings are optional, but they are highly useful in case
274
* the component is to be used as a public part of a library.
275
* They help to ensure that the implementation back-end reflects the used
276
* description documents appropriately. This is important, as it is the
277
* description documents that are transferred from servers to clients and it is
278
* these documents that advertise what a particular UPnP device supports and
279
* is capable of doing.
281
* From the client's perspective they are also useful in defining requirements
282
* for device and service types. For instance, if you have a component that
283
* expects a discovered UPnP device to contain certain services, state variables
284
* and actions, HUPnP can use these requirements to filter devices that are
285
* suitable in terms of advertised capabilities.
287
* \ingroup hupnp_common
289
enum HInclusionRequirement
292
* This value indicates that the inclusion requirement for the component
295
* This value is used only in error situations.
297
InclusionRequirementUnknown = 0,
300
* This value indicates that the component has to be appropriately specified.
301
* It is a critical error if the component is missing.
306
* This value indicates that the component is optional and may or may not be
313
* \brief This enumeration specifies the logging levels that can be used with the device host.
315
* \ingroup hupnp_common
320
* No logs are generated.
322
* \remark by default, HUPnP uses this logging level.
327
* Only fatal messages are logged. Most often a fatal message is
328
* followed by termination of the application.
333
* Only critical and fatal messages are logged. Most often a critical message
334
* signals a severe runtime error.
339
* Messages with level set to warning, critical and fatal are logged.
340
* A warning message usually signifies an error or exceptional situation
341
* that should be noted. Most often the system stability is not at stake
342
* when warning messages appear, but they may still indicate that some
343
* component, internal or external, is not functioning correctly.
344
* Usually the source of warnings should be investigated.
349
* All but debug level messages are logged. An informational message is used
350
* to log status information of control flow. A good example of an informational
351
* message is when a sizable component logs the start of an initialization procedure.
356
* All up to the debug messages are output. This excludes only the function
357
* enter and exit messages.
359
* \remark Enabling this level of logging has notable effect on performance.
360
* This generally should be used only for debugging purposes.
365
* Every log message is output. This includes even the function enters
368
* \remark Enabling this level of logging has severe effect on performance.
369
* This is very rarely needed and usually the debug level is far more helpful.
375
* \brief Sets the logging level the HUPnP should use.
377
* \param level specifies the desired logging level.
380
* \li The new logging level will take effect immediately.
381
* \li The function is thread-safe.
383
* \ingroup hupnp_common
385
void H_UPNP_CORE_EXPORT SetLoggingLevel(HLogLevel level);
388
* Enables / disables warnings that relate to non-standard behavior discovered
389
* in other UPnP software.
391
* Most often if non-standard behavior in other UPnP software is discovered, it
392
* isn't fatal or critical and it may be possible to inter-operate with the software.
393
* However, deviations from the specifications and standards are unfortunate and such
394
* \b errors should be fixed.
396
* Regardless, you may not want to be notified about these warnings in which
397
* case you can specifically disable all the warnings that relate to non-standard
400
* \param arg specifies whether to output warnings that are about non-standard
401
* behavior in other UPnP software.
403
* \remark by default, the non standard behavior warnings are on.
405
* \ingroup hupnp_common
407
void H_UPNP_CORE_EXPORT EnableNonStdBehaviourWarnings(bool arg);
412
#endif /* HUPNP_GLOBAL_H_ */