Re: [Bacnet-developers] Implementing Binary Input and Output
Brought to you by:
skarg
From: Steve K. <st...@ka...> - 2006-02-24 17:45:28
|
Hi Tayler, I just did a quick grep on BACFILE since that is using the file object and saw the following: File demo\handler\h_arf_a.c: #if BACFILE File demo\handler\h_rp.c: #if BACFILE #if BACFILE File demo\handler\h_wp.c: #if BACFILE File demo\object\device.c: #if BACFILE #if BACFILE #if BACFILE #if BACFILE #if BACFILE So, based on that info, you would have to add a function for the new object at each of those places in the files. Of course, the handlers for AtomicReadFile won't need it, but the readproperty handler will need it, write property (for the output) will need it, and device needs info in several places. That said, lets see how you did: > So far I started with a > binary input and derived it from the analog input (ai.c || ai.h). Good. > I adapted the "h_rp.c" with this part of code: > > case OBJECT_BINARY_INPUT: Good. > I altered the "device.c" too: > bitstring_set_bit(&bit_string, OBJECT_BINARY_INPUT, true); Yes, that is one place. The device object also needs to know about the new object to fill and handle requests to its PROP_OBJECT_LIST: Device_Object_List_Count() needs to know how many. Device_Object_List_Identifier() needs to know the index/object id. Device_Valid_Object_Id() needs to know if the object id is valid. That should do it. Best Regards, Steve -- http://www.kargs.net/ |