3 * - By John Hodge (thePowersGang)
6 * - Instance Attribute Management
10 #include <udi_internal.h>
14 // > '%': Private persistent
15 // > '$': Private Volatile
17 // > '^': Sibling group
18 // > '@': parent-visible (persistent)
21 udi_instance_attr_type_t udi_instance_attr_get_internal(udi_cb_t *gcb, const char *attr_name, udi_ubit32_t child_ID, void *attr_value, udi_size_t attr_length, udi_size_t *actual_length)
24 tUDI_DriverInstance *inst = UDI_int_ChannelGetInstance(gcb, false, NULL);
26 const tUDI_ChildBinding *bind = inst->ParentChildBinding;
33 // Read cached from tUDI_DriverModule
34 // Write to permanent storage?
38 // Read from tUDI_DriverInstance
42 // Read from parent's tUDI_DriverInstance
46 // Read from tUDI_ChildBinding
50 // Check associated tUDI_ChildBinding
51 if( !inst->ParentChildBinding ) {
55 for( int i = 0; i < bind->nAttribs; i ++ )
57 const udi_instance_attr_list_t *at = &bind->Attribs[i];
58 if( strcmp(at->attr_name, attr_name) == 0 )
61 *actual_length = at->attr_length;
62 udi_size_t len = (at->attr_length < attr_length) ? at->attr_length : attr_length;
63 memcpy(attr_value, at->attr_value, len);
70 // - enumeration attributes