Added some debug print to demo COV handler.
This commit is contained in:
@@ -40,6 +40,9 @@
|
|||||||
#include "cov.h"
|
#include "cov.h"
|
||||||
#include "tsm.h"
|
#include "tsm.h"
|
||||||
#include "dcc.h"
|
#include "dcc.h"
|
||||||
|
#if PRINT_ENABLED
|
||||||
|
#include "bactext.h"
|
||||||
|
#endif
|
||||||
/* demo objects */
|
/* demo objects */
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
#include "handlers.h"
|
#include "handlers.h"
|
||||||
@@ -390,7 +393,7 @@ static void cov_lifetime_expiration_handler(
|
|||||||
if (lifetime_seconds >= elapsed_seconds) {
|
if (lifetime_seconds >= elapsed_seconds) {
|
||||||
COV_Subscriptions[index].lifetime -= elapsed_seconds;
|
COV_Subscriptions[index].lifetime -= elapsed_seconds;
|
||||||
#if 0
|
#if 0
|
||||||
fprintf(stderr, "COVtask: subscription[%d].lifetime=%lu\n", index,
|
fprintf(stderr, "COVtimer: subscription[%d].lifetime=%lu\n", index,
|
||||||
(unsigned long) COV_Subscriptions[index].lifetime);
|
(unsigned long) COV_Subscriptions[index].lifetime);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
@@ -398,6 +401,17 @@ static void cov_lifetime_expiration_handler(
|
|||||||
}
|
}
|
||||||
if (COV_Subscriptions[index].lifetime == 0) {
|
if (COV_Subscriptions[index].lifetime == 0) {
|
||||||
/* expire the subscription */
|
/* expire the subscription */
|
||||||
|
#if PRINT_ENABLED
|
||||||
|
fprintf(stderr, "COVtimer: PID=%u ",
|
||||||
|
COV_Subscriptions[index].subscriberProcessIdentifier);
|
||||||
|
fprintf(stderr, "%s %u ",
|
||||||
|
bactext_object_type_name(
|
||||||
|
COV_Subscriptions[index].monitoredObjectIdentifier.type),
|
||||||
|
COV_Subscriptions[index].monitoredObjectIdentifier.instance);
|
||||||
|
fprintf(stderr, "time remaining=%u seconds ",
|
||||||
|
COV_Subscriptions[index].lifetime);
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
#endif
|
||||||
COV_Subscriptions[index].flag.valid = false;
|
COV_Subscriptions[index].flag.valid = false;
|
||||||
if (COV_Subscriptions[index].flag.issueConfirmedNotifications) {
|
if (COV_Subscriptions[index].flag.issueConfirmedNotifications) {
|
||||||
if (COV_Subscriptions[index].invokeID) {
|
if (COV_Subscriptions[index].invokeID) {
|
||||||
@@ -485,6 +499,9 @@ void handler_cov_task(
|
|||||||
status = Device_COV(object_type, object_instance);
|
status = Device_COV(object_type, object_instance);
|
||||||
if (status) {
|
if (status) {
|
||||||
COV_Subscriptions[index].flag.send_requested = true;
|
COV_Subscriptions[index].flag.send_requested = true;
|
||||||
|
#if PRINT_ENABLED
|
||||||
|
fprintf(stderr,"COVtask: Marking...\n");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
@@ -551,6 +568,9 @@ void handler_cov_task(
|
|||||||
object_instance =
|
object_instance =
|
||||||
COV_Subscriptions[index].monitoredObjectIdentifier.
|
COV_Subscriptions[index].monitoredObjectIdentifier.
|
||||||
instance;
|
instance;
|
||||||
|
#if PRINT_ENABLED
|
||||||
|
fprintf(stderr,"COVtask: Sending...\n");
|
||||||
|
#endif
|
||||||
/* configure the linked list for the two properties */
|
/* configure the linked list for the two properties */
|
||||||
value_list[0].next = &value_list[1];
|
value_list[0].next = &value_list[1];
|
||||||
value_list[1].next = NULL;
|
value_list[1].next = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user