Added more objects to BDK port, and connected AI to ADC7, and BI0..BI4 to PINB0..PINB4. Fixed up some other objects and object API (header files).

This commit is contained in:
skarg
2009-06-18 03:58:54 +00:00
parent 6e6cdf2bc0
commit e70dd3c7ba
18 changed files with 814 additions and 29 deletions
@@ -39,6 +39,7 @@
/* objects */
#include "device.h"
#include "ai.h"
#include "av.h"
#include "bi.h"
#include "bo.h"
@@ -229,6 +230,7 @@ unsigned Device_Object_List_Count(
count += Binary_Input_Count();
count += Binary_Output_Count();
count += Analog_Input_Count();
count += Analog_Value_Count();
return count;
}
@@ -290,6 +292,17 @@ bool Device_Object_List_Identifier(
status = true;
}
}
/* analog value objects */
if (!status) {
/* array index starts at 1, and 1 for the device object */
object_index -= object_count;
object_count = Analog_Value_Count();
if (object_index < object_count) {
*object_type = OBJECT_ANALOG_VALUE;
*instance = Analog_Value_Index_To_Instance(object_index);
status = true;
}
}
return status;
}
@@ -398,6 +411,7 @@ int Device_Encode_Property_APDU(
/* FIXME: indicate the objects that YOU support */
bitstring_set_bit(&bit_string, OBJECT_DEVICE, true);
bitstring_set_bit(&bit_string, OBJECT_ANALOG_INPUT, true);
bitstring_set_bit(&bit_string, OBJECT_ANALOG_VALUE, true);
bitstring_set_bit(&bit_string, OBJECT_BINARY_INPUT, true);
bitstring_set_bit(&bit_string, OBJECT_BINARY_OUTPUT, true);
apdu_len = encode_application_bitstring(&apdu[0], &bit_string);