Re: [Bacnet-developers] request
Brought to you by:
skarg
From: Steve K. <st...@ka...> - 2006-08-17 01:08:26
|
Hi Percy, Sorry I didn't write sooner. I got swamped at work today, and your question requires a longer answer. I had to research it a bit since I have not worked with calendar and schedule objects. > 1. How do we write to the calendar object on the date_list object type? > What is the type of data like whether its bit string, character string or > What is the type of data like whether its bit string, character string or > octet string? The date_list property is a List of BACnetCalendarEntry. It is defined as: BACnetCalendarEntry ::= CHOICE { date [0] Date, dateRange [1] BACnetDateRange, weekNDay [2] BACnetWeekNDay } The brackets [] in the choice indicate that it is CONTEXT TAG instead of an APPLICATION TAG. tag 0 date is a primitive datatype. tag 1 dateRange and tag 2 weekNDay are complex datatypes that will need to be encoded between an opening and closing tag using their tag number. The data inside the opening/closing tag will be: BACnetDateRange ::= SEQUENCE { StartDate Date, endDate Date } StartDate and endDate will be encoded using APPLICATION TAG. BACnetWeekNDay ::= OCTET STRING (SIZE (3)) -- first octet month (1..14) 1 =January -- 13 = odd months -- 14 = even months -- X'FF' = any month -- second octet weekOfMonth where: 1 = days numbered 1-7 -- 2 = days numbered 8-14 -- 3 = days numbered 15-21 -- 4 = days numbered 22-28 -- 5 = days numbered 29-31 -- 6 = last 7 days of this month -- X'FF' = any week of this month -- third octet dayOfWeek (1..7) where 1 = Monday -- 7 = Sunday -- X'FF' = any day of week The octets will be encoded as specified. Hmmm. I coded the BACnet stack to only handle APPLICATION tags for WriteProperty. It doesn't do context data, complex data types, or multiple elements (values). It will be necessary to extend the bacapp.c/h or wp.h/c or both to handle these. In the case of context tags, the Object and Property will dictate the type. We would need to indicate that it is context tagged, and the value of the context tag, and be able to store the value of the datatype in a way that we can retrieve it. The bacapp_encode_application_data() call in wp.c will either need to be enhanced to handle the context data, or a new set of wp_encode_apdu/wp_decode_service_request for context and complex values will need to be created. I don't have the time to implement that tonight, but I can look into it when I get the chance. You could also try to implement it. > 2. How do we write to a schedule object ? what is the type of data? I am out of time for tonight... Best Regards, Steve -- http://kargs.net/ |