KCMS Application Developer's Guide


typedef struct KcsAttributeBase_s {
 	KcsAttributeType					type;
 	unsigned long					countSupplied;
 	unsigned long					countAvailable;
 	unsigned long					sizeOfType;	
 	char					strVal[KcsAttrStrLength];
 } KcsAttributeBase;

The KcsAttributeBase structure defines a common subset of information in the KcsAttributeValue structure. Nothing in KcsAttributeBase is extendable.

The type field determines the data type in which the attribute value is stored. It is the icSigxxxType as defined in the icc.h and kcstypes.h header files.

The countSupplied field specifies the number of allocated elements in the array. For example, if type is set to KcsDoubleValue and countSupplied is set to 2, the attribute value is large enough to hold two doubles, which are stored in the first two elements of the doubleVal array of KcsAttributeValue (see "KcsAttributeValue ").

When the type field is set to KcsString, KcsDateTimeStamp, or an ic type defined in the header file icc.h, the countSupplied field must be set to 1 because strings are treated as a single token.

Note -

KcsDateTimeStamp, KcsDoubleValue, and KcsString are equated to ic types in the header.

To determine how many values of a particular data type that can fit in a KcsAttributeValue structure, use the KCS_DEFAULT_ATTRIB_COUNT macro. It returns the number of values of the specified data type that will fit in the structure. Your application must set the countSupplied field of the KcsAttributeBase structure to the number of values to get or set before it calls KcsGetAttribute() or KcsSetAttribute(). Upon return of KcsGetAttribute(), the countAvailable field specifies the number of values in the profile.

The sizeOfType field is the value, array or structure indicated by type:

attrValuePtr->base.type = icSigHeaderType;

attrValuePtr->base.sizeOfType = sizeof(icHeader);


attrValuePtr->base.type = icSigMeasurementType;

attrValuePtr->base.sizeOfType = sizeof(icMeasurement);

The KcsAttrStrLength field is defined in the kcstypes.h header file as the maximum string length of 256.