Feature/raspberry pi blinkt color objects (#503)
* fixed BACnetXYcolor and BACnetColorCommand encode and decoding and improved unit test coverage. Refactored BACnetXYcolor to/from ascii into lighting module. * added to the color, color temperature, and lighting output objects a fade/ramp/step engine. Added color and color command coercion into the channel object and enabled color temperature object coercion. Added CreateObject and DeleteObject service handling to the color, color temperature, lighting output, and channel objects. * added blinkt demo app for Raspberry Pi [WIP] * updated gitignore to simplify handling of apps folder contents * fixed piface demo build * added RaspiOS to pipeline for piface and blinkt! demo builds * added device object timer function for child object types into example Device object. Refactored device object to increment database revision for create or delete object services. Refactored example app/server to use mstimer library and device child object timers. --------- Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
@@ -118,7 +118,7 @@ static object_functions_t Object_Table[] = {
|
||||
NULL /* Value_Lists */, NULL /* COV */, NULL /* COV Clear */,
|
||||
NULL /* Intrinsic Reporting */,
|
||||
NULL /* Add_List_Element */, NULL /* Remove_List_Element */,
|
||||
NULL /* Create */, NULL /* Delete */ },
|
||||
NULL /* Create */, NULL /* Delete */, NULL /* Timer */ },
|
||||
#if (BACNET_PROTOCOL_REVISION >= 17)
|
||||
{ OBJECT_NETWORK_PORT, Network_Port_Init, Network_Port_Count,
|
||||
Network_Port_Index_To_Instance, Network_Port_Valid_Instance,
|
||||
@@ -127,7 +127,7 @@ static object_functions_t Object_Table[] = {
|
||||
NULL /* ReadRangeInfo */, NULL /* Iterator */, NULL /* Value_Lists */,
|
||||
NULL /* COV */, NULL /* COV Clear */, NULL /* Intrinsic Reporting */,
|
||||
NULL /* Add_List_Element */, NULL /* Remove_List_Element */,
|
||||
NULL /* Create */, NULL /* Delete */ },
|
||||
NULL /* Create */, NULL /* Delete */, NULL /* Timer */ },
|
||||
#endif
|
||||
{ MAX_BACNET_OBJECT_TYPE, NULL /* Init */, NULL /* Count */,
|
||||
NULL /* Index_To_Instance */, NULL /* Valid_Instance */,
|
||||
@@ -137,7 +137,7 @@ static object_functions_t Object_Table[] = {
|
||||
NULL /* COV */, NULL /* COV Clear */,
|
||||
NULL /* Intrinsic Reporting */,
|
||||
NULL /* Add_List_Element */, NULL /* Remove_List_Element */,
|
||||
NULL /* Create */, NULL /* Delete */ },
|
||||
NULL /* Create */, NULL /* Delete */, NULL /* Timer */ },
|
||||
};
|
||||
|
||||
/** Glue function to let the Device object, when called by a handler,
|
||||
@@ -1042,6 +1042,34 @@ int Device_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
|
||||
return apdu_len;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Updates all the object timers with elapsed milliseconds
|
||||
* @param milliseconds - number of milliseconds elapsed
|
||||
*/
|
||||
void Device_Timer(
|
||||
uint16_t milliseconds)
|
||||
{
|
||||
struct object_functions *pObject;
|
||||
unsigned count = 0;
|
||||
uint32_t instance;
|
||||
|
||||
pObject = Object_Table;
|
||||
while (pObject->Object_Type < MAX_BACNET_OBJECT_TYPE) {
|
||||
if (pObject->Object_Count) {
|
||||
count = pObject->Object_Count();
|
||||
}
|
||||
while (count) {
|
||||
count--;
|
||||
if ((pObject->Object_Timer) &&
|
||||
(pObject->Object_Index_To_Instance)) {
|
||||
instance = pObject->Object_Index_To_Instance(count);
|
||||
pObject->Object_Timer(instance, milliseconds);
|
||||
}
|
||||
}
|
||||
pObject++;
|
||||
}
|
||||
}
|
||||
|
||||
/** Initialize the Device Object.
|
||||
Initialize the group of object helper functions for any supported Object.
|
||||
Initialize each of the Device Object child Object instances.
|
||||
|
||||
Reference in New Issue
Block a user