Skip to content

Commit

Permalink
Added WriteGroup service to blinkt app demo. (bacnet-stack#843)
Browse files Browse the repository at this point in the history
  • Loading branch information
skarg authored Nov 1, 2024
1 parent 97213c3 commit d47bb67
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,18 @@ apdu:
blinkt:
$(MAKE) LEGACY=true -C apps $@

.PHONY: blinkt-pipeline
blinkt-pipeline:
$(MAKE) LEGACY=true BUILD=pipeline -C apps blinkt

.PHONY: blinkt6
blinkt6:
$(MAKE) LEGACY=true BACDL=bip6 -C apps blinkt

.PHONY: blinkt6-pipeline
blinkt6-pipeline:
$(MAKE) LEGACY=true BACDL=bip6 BUILD=pipeline -C apps blinkt

.PHONY: create-object
create-object:
$(MAKE) -s -C apps $@
Expand Down
2 changes: 1 addition & 1 deletion apps/blinkt/blinkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static int Blinkt_Pi;
#define PI_OUTPUT 1
#define gpio_write(a, b, c) printf("gpio_write(%d, %d, %d)\n", a, b, c)
#define set_mode(a, b, c) printf("set_mode(%d, %d, %d)\n", a, b, c)
#define pigpio_start(a, b) printf("pigpio_start(%s, %s)\n", a, b)
#define pigpio_start(a, b) printf("pigpio_start(%p, %p)\n", a, b)
#define pigpio_stop(a) printf("pigpio_stop(%d)\n", a)
#else
#include <pigpiod_if2.h>
Expand Down
6 changes: 6 additions & 0 deletions apps/blinkt/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ static struct mstimer BACnet_TSM_Timer;
static struct mstimer BACnet_Address_Timer;
/* task timer for object functionality */
static struct mstimer BACnet_Object_Timer;
/* observer for WriteGroup notifications */
static BACNET_WRITE_GROUP_NOTIFICATION Write_Group_Notification;

/** Initialize the handlers we will utilize.
* @see Device_Init, apdu_set_unconfirmed_handler, apdu_set_confirmed_handler
Expand Down Expand Up @@ -99,6 +101,8 @@ static void Init_Service_Handlers(void)
SERVICE_CONFIRMED_SUBSCRIBE_COV, handler_cov_subscribe);
apdu_set_unconfirmed_handler(
SERVICE_UNCONFIRMED_COV_NOTIFICATION, handler_ucov_notification);
apdu_set_unconfirmed_handler(
SERVICE_UNCONFIRMED_WRITE_GROUP, handler_write_group);
/* handle communication so we can shutup when asked */
apdu_set_confirmed_handler(
SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL,
Expand Down Expand Up @@ -291,6 +295,8 @@ static void bacnet_output_init(void)
Color_Temperature_Write_Value_Handler);
Lighting_Output_Write_Present_Value_Callback_Set(
Lighting_Output_Write_Value_Handler);
Write_Group_Notification.callback = Channel_Write_Group;
handler_write_group_notification_add(&Write_Group_Notification);
}

/**
Expand Down

0 comments on commit d47bb67

Please sign in to comment.