Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
dcdb
dcdb
Commits
7cc73e39
Commit
7cc73e39
authored
Feb 08, 2019
by
Micha Mueller
Browse files
Implement printConfig for BACnet plugin
parent
0b5b37cc
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/sensors/bacnet/BACnetClient.cpp
View file @
7cc73e39
...
...
@@ -288,3 +288,8 @@ void BACnetClient::rejectHandler(BACNET_ADDRESS * src, uint8_t invokeId, uint8_t
throw
std
::
runtime_error
(
str
+
errorMsg
);
}
void
BACnetClient
::
printConfig
(
LOG_LEVEL
ll
)
{
LOG_VAR
(
ll
)
<<
" BACnetClient here"
;
LOG_VAR
(
ll
)
<<
" Timeout: "
<<
_timeout
;
}
src/sensors/bacnet/BACnetClient.h
View file @
7cc73e39
...
...
@@ -60,6 +60,13 @@ public:
*/
double
readProperty
(
uint32_t
deviceObjInstance
,
uint32_t
objInstance
=
0
,
BACNET_OBJECT_TYPE
objType
=
OBJECT_DEVICE
,
BACNET_PROPERTY_ID
objProperty
=
PROP_PRESENT_VALUE
,
int32_t
objIndex
=
BACNET_ARRAY_ALL
);
/**
* Print information about configured attributes
*
* @param ll Severity level of the log messages.
*/
void
printConfig
(
LOG_LEVEL
ll
);
private:
/* Handler to process incoming BACnet data */
...
...
@@ -88,7 +95,7 @@ private:
boost
::
asio
::
io_service
::
strand
*
_strand
;
boost
::
log
::
sources
::
severity_logger
<
boost
::
log
::
trivial
::
severity_level
>
lg
;
LOGGER
lg
;
};
#endif
/* BACNETCLIENT_H_ */
src/sensors/bacnet/BACnetConfigurator.cpp
View file @
7cc73e39
...
...
@@ -71,3 +71,13 @@ void BACnetConfigurator::global(CFG_VAL config) {
return
;
}
}
void
BACnetConfigurator
::
printConfiguratorConfig
(
LOG_LEVEL
ll
)
{
LOG_VAR
(
ll
)
<<
" Not other plugin specific general attributes"
;
if
(
_bacClient
)
{
_bacClient
->
printConfig
(
ll
);
}
else
{
LOG_VAR
(
ll
)
<<
" No BACClient present!"
;
}
}
src/sensors/bacnet/BACnetConfigurator.h
View file @
7cc73e39
...
...
@@ -26,6 +26,8 @@ protected:
void
global
(
CFG_VAL
config
)
override
;
void
printConfiguratorConfig
(
LOG_LEVEL
ll
)
override
;
private:
BACnetClientPtr
_bacClient
;
};
...
...
src/sensors/bacnet/BACnetSensorBase.h
View file @
7cc73e39
...
...
@@ -57,6 +57,14 @@ public:
void
setPropertyId
(
const
std
::
string
&
property
)
{
_propertyId
=
static_cast
<
BACNET_PROPERTY_ID
>
(
stoul
(
property
));
}
void
setObjectIndex
(
int32_t
objectIndex
)
{
_objectIndex
=
objectIndex
;
}
void
printConfig
(
LOG_LEVEL
ll
,
LOGGER
&
lg
)
override
{
LOG_VAR
(
ll
)
<<
" Factor: "
<<
_factor
;
LOG_VAR
(
ll
)
<<
" objectInstance: "
<<
_objectInstance
;
LOG_VAR
(
ll
)
<<
" objectType: "
<<
_objectType
;
LOG_VAR
(
ll
)
<<
" propertyId: "
<<
_propertyId
;
LOG_VAR
(
ll
)
<<
" objectIndex: "
<<
_objectIndex
;
}
protected:
double
_factor
;
uint32_t
_objectInstance
;
...
...
src/sensors/bacnet/BACnetSensorGroup.cpp
View file @
7cc73e39
...
...
@@ -99,3 +99,12 @@ void BACnetSensorGroup::readAsync() {
}
_pendingTasks
--
;
}
void
BACnetSensorGroup
::
printConfig
(
LOG_LEVEL
ll
)
{
LOG_VAR
(
ll
)
<<
" deviceInstance: "
<<
_deviceInstance
;
if
(
_bacClient
)
{
LOG_VAR
(
ll
)
<<
" BACClient set"
;
}
else
{
LOG_VAR
(
ll
)
<<
" No BACClient set!"
;
}
}
src/sensors/bacnet/BACnetSensorGroup.h
View file @
7cc73e39
...
...
@@ -30,6 +30,7 @@ public:
void
setDeviceInstance
(
const
std
::
string
&
deviceInstance
)
{
_deviceInstance
=
stoul
(
deviceInstance
);
}
uint32_t
getDeviceInstance
()
const
{
return
_deviceInstance
;
}
void
printConfig
(
LOG_LEVEL
ll
);
private:
void
read
()
override
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment