ProviewR Programmer's Reference Manual
V6.1.4
|
Functions | |
pwr_tStatus | gdh_ArefANameToAref (pwr_sAttrRef *arp, const char *aname, pwr_sAttrRef *oarp) |
Get the attribute reference for an attribute in an object attribute reference, where the attribute is specified by an string. More... | |
pwr_tStatus | gdh_ArefDisabled (pwr_sAttrRef *arp, pwr_tDisableAttr *disabled) |
Check if an attribute is disabled. More... | |
pwr_tStatus | gdh_AttrArefToObjectAref (pwr_sAttrRef *arp, pwr_sAttrRef *oarp) |
Get the attribute reference to an object or attribute object, from the attribute reference to an attribute in the object. More... | |
pwr_tStatus | gdh_AttrrefToName (pwr_sAttrRef *attributeReference, char *nameBuffer, unsigned int sizeOfNameBuffer, pwr_tBitMask nameType) |
Translate an attribute referece to a name. More... | |
pwr_tStatus | gdh_AttrRefToPointer (pwr_sAttrRef *arp, void **p) |
Gets the address of the data of an attribute reference. More... | |
pwr_tStatus | gdh_AttrStringToValue (int type_id, char *value_str, void *buffer_ptr, int buff_size, int attr_size) |
Convert an attribute string to value. More... | |
pwr_tStatus | gdh_AttrValueToString (pwr_eType type_id, pwr_tTid tid, void *value_ptr, char *str, int size, int *len, char *format) |
Convert a string to attribute value. More... | |
pwr_tStatus | gdh_ClassAttrrefToAttr (pwr_tClassId classid, pwr_sAttrRef *attributeReference, char *nameBuffer, int sizeOfNameBuffer) |
Get the attribute name from a class and attrref. More... | |
pwr_tStatus | gdh_ClassAttrToAttrref (pwr_tClassId classid, const char *attributeName, pwr_sAttrRef *attributeReference) |
Converts a class and attribute string to attrref format. More... | |
pwr_tStatus | gdh_ClassNameToId (const char *className, pwr_tClassId *classid) |
Get the class identity corresponding to a class specified by name. More... | |
pwr_tStatus | gdh_CreateObject (char *objectName, pwr_tClassId classid, unsigned int sizeOfObjectData, pwr_tObjid *objectId, pwr_tObjid internal1, pwr_tBitMask internal2, pwr_tObjid internal3) |
Create an object in a dynamic volume. More... | |
pwr_tStatus | gdh_DeleteObject (pwr_tObjid objectId) |
Remove a local object. More... | |
pwr_tStatus | gdh_DeleteObjectTree (pwr_tObjid objectId) |
Remove a local object tree. More... | |
pwr_tStatus | gdh_DLRefObjectInfoAttrref (pwr_sAttrRef *addressOfAttributeReference, void **objectData, pwr_tDlid *directLinkId) |
Request a direct link to the data denoted by an attribute reference. More... | |
pwr_tStatus | gdh_DLUnrefObjectInfo (pwr_tDlid directLinkId) |
Terminate direct linking of an object or an object attribute. More... | |
void | gdh_DLUnrefObjectInfoAll (void) |
Removes all direct links set up by this process. | |
pwr_tStatus | gdh_FReadObject (char *filename, pwr_tAttrRef *arp) |
Read a textfile into an object. More... | |
pwr_tStatus | gdh_FWriteObject (char *filename, pwr_tAttrRef *arp) |
Write the content of an object to textfile. More... | |
pwr_tStatus | gdh_GetAlarmInfo (pwr_tObjid object, pwr_tUInt32 *alarmLevel, pwr_tUInt32 *maxAlarmLevel, pwr_tUInt32 *alarmBlockLevel, pwr_tUInt32 *maxAlarmBlockLevel, pwr_tUInt32 *alarmVisibility) |
Get the alarm status for a certain object. More... | |
pwr_tStatus | gdh_GetAttributeCharAttrref (pwr_sAttrRef *attributeReference, pwr_tTypeId *attributeType, unsigned int *attributeSize, unsigned int *attributeOffset, unsigned int *attributeDimension) |
Get the characteristics of an attribute. More... | |
pwr_tStatus | gdh_GetAttributeFlags (pwr_sAttrRef *arp, unsigned int *flags) |
Get the flags of an attribute. More... | |
pwr_tStatus | gdh_GetAttributeCharacteristics (char *name, pwr_tTypeId *tid, pwr_tUInt32 *size, pwr_tUInt32 *offs, pwr_tUInt32 *elem) |
Get the characteristics of an attribute, given its name and the class it belongs to. More... | |
pwr_tStatus | gdh_GetAttrRefTid (pwr_sAttrRef *arp, pwr_tTid *tid) |
Get the type or class identifier of an attribute reference. More... | |
pwr_tStatus | gdh_GetChild (pwr_tObjid object, pwr_tObjid *firstChild) |
Get the object identity of the first child of an object. More... | |
pwr_tStatus | gdh_GetClassList (pwr_tClassId classid, pwr_tObjid *object) |
Get the object identity of the first object in the list of objects of a specified class. More... | |
pwr_tStatus | gdh_GetClassListAttrRef (pwr_tClassId cid, pwr_sAttrRef *arp) |
Get the attribute reference of the first object in the list of objects of a specified class. The object can be a solitary object or an attribute object. More... | |
pwr_tStatus | gdh_GetDynamicAttrSize (pwr_tObjid oid, char *name, pwr_tUInt32 *size) |
Get the size of a dynamic attribute. More... | |
pwr_tStatus | gdh_GetEnumValueDef (pwr_tTid tid, gdh_sValueDef **vd, int *rows) |
Get definition information for an enumeration type. More... | |
pwr_tStatus | gdh_GetLocalParent (pwr_tObjid object, pwr_tObjid *parent) |
Get the object identity of the local parent of an object. More... | |
pwr_tStatus | gdh_GetMaskBitDef (pwr_tTid tid, gdh_sBitDef **bd, int *rows) |
Get definition information for a mask type. More... | |
pwr_tStatus | gdh_GetNextAttrRef (pwr_tClassId cid, pwr_sAttrRef *arp, pwr_sAttrRef *new_arp) |
Get the attrref of the next object in the list of objects of a certain class. The object can be a solitary object or an attribute object. More... | |
pwr_tStatus | gdh_GetNextObject (pwr_tObjid object, pwr_tObjid *nextObject) |
Get the object identity of the next object in the list of objects of a certain class. More... | |
pwr_tStatus | gdh_GetNextObjectAttrRef (pwr_tClassId cid, pwr_sAttrRef *arp, pwr_sAttrRef *new_arp) |
Get the attrref of the next attribute object of a specified class in a specified object. More... | |
pwr_tStatus | gdh_GetNextSibling (pwr_tObjid object, pwr_tObjid *nextSibling) |
Get the object identity of the next sibling (i.e. the next object with the same parent). More... | |
pwr_tStatus | gdh_GetNextVolume (pwr_tVid pvid, pwr_tVid *vid) |
Get the next volume in the volume list. More... | |
pwr_tStatus | gdh_GetNodeIndex (pwr_tNodeId *nodeIndex) |
Get the node identity of the local node. More... | |
pwr_tStatus | gdh_GetNodeInfo (pwr_tNodeId nodidx, gdh_sNodeInfo *ip) |
Return info for a node identified by a node identifier (of type pwr_tNodeId). More... | |
pwr_tStatus | gdh_GetNodeObject (pwr_tNodeId nodeIndex, pwr_tObjid *object) |
Return the objid of the node object for a node identified by a node identifier (of type pwr_tNodeId). More... | |
pwr_tStatus | gdh_GetClassInfo (pwr_tCid cid, gdh_sClassInfo *info) |
Get class info. Returns information from $ClassDef object. More... | |
pwr_tStatus | gdh_GetObjectClass (pwr_tObjid object, pwr_tClassId *classid) |
Get the class identifier of an object. More... | |
pwr_tStatus | gdh_GetObjectClassList (pwr_tCid cid, pwr_tOid oid, pwr_sAttrRef *arp) |
Get the attribute reference of the first attribute object of a specified class in the specified object. More... | |
pwr_tStatus | gdh_GetObjectDLCount (pwr_tObjid object, pwr_tUInt32 *count) |
Gets the direct link count of an object. More... | |
pwr_tStatus | gdh_GetObjectInfo (const char *name, pwr_tAddress bufp, pwr_tUInt32 bufsize) |
Fetch data from an object or an attribute. More... | |
pwr_tStatus | gdh_GetObjectInfoAttrref (pwr_sAttrRef *attributeReference, void *buffer, unsigned int sizeOfBuffer) |
Fetch the data of an attribute or a whole object body. More... | |
pwr_tStatus | gdh_GetObjectLocation (pwr_tObjid object, pwr_tBoolean *isLocal) |
Return the location of an object. More... | |
pwr_tStatus | gdh_GetObjectNodeIndex (pwr_tObjid object, pwr_tNodeId *nodeIndex) |
Get the node identity of the owner node of an object. More... | |
pwr_tStatus | gdh_GetObjectSize (pwr_tObjid oid, pwr_tUInt32 *size) |
Get the size of the body of an object. More... | |
pwr_tStatus | gdh_GetParent (pwr_tObjid object, pwr_tObjid *parent) |
Get the object identity of the parent of an object. More... | |
pwr_tStatus | gdh_GetPreviousObject (pwr_tObjid object, pwr_tObjid *previousObject) |
Get the object identity of the previous object in the list of objects of a certain class. More... | |
pwr_tStatus | gdh_GetPreviousSibling (pwr_tObjid object, pwr_tObjid *previousSibling) |
Get the object identity of the previous sibling (i.e. the previous object with the same parent). More... | |
pwr_tStatus | gdh_GetRootList (pwr_tObjid *object) |
Get the first root object in the object tree. More... | |
pwr_tStatus | gdh_GetSecurityInfo (pwr_sSecurity *security) |
Get security information. More... | |
pwr_tStatus | gdh_GetVolumeInfo (pwr_tVid vid, gdh_sVolumeInfo *info) |
Get info for a volume. More... | |
pwr_tStatus | gdh_GetVolumeList (pwr_tVid *vid) |
Get the first volume. More... | |
pwr_tStatus | gdh_GetRootVolume (pwr_tVid *vid) |
Get info for a volume. More... | |
pwr_tStatus | gdh_GetSubscriptionOldness (pwr_tSubid subid, pwr_tBoolean *isOld, pwr_tTime *lastUpdate, pwr_tStatus *lastStatus) |
Checks the oldness of a certain subscription. More... | |
pwr_tStatus | gdh_GetSuperClass (pwr_tCid cid, pwr_tCid *supercid, pwr_tObjid oid) |
Get the superclass for a class. More... | |
pwr_tStatus | gdh_Init (const char *name) |
Initialize the process to the Proview runtime environment. More... | |
pwr_tBoolean | gdh_IsInitialized () |
Check if gdh is initialized. Returns TRUE if gdh is initialized, else FALSE. More... | |
pwr_tStatus | gdh_MountObjidToPointer (pwr_tObjid object, void **objectData) |
Get a pointer to a mount object. More... | |
pwr_tStatus | gdh_MoveObject (pwr_tObjid objectId, pwr_tObjid newParentId) |
Move a local object. More... | |
pwr_tStatus | gdh_NameToAttrref (pwr_tObjid parent, const char *attributeName, pwr_sAttrRef *attributeReference) |
Converts from name string to attribute reference. More... | |
pwr_tStatus | gdh_NameToObjid (const char *objectName, pwr_tObjid *objid) |
Get the object identity of an object with name 'name'. More... | |
pwr_tStatus | gdh_NameToPointer (const char *objectName, void **objectData) |
Get the address of the data of an object, given its name. More... | |
pwr_tStatus | gdh_NethandlerRunning (void) |
Check if the Nethandler has started. More... | |
pwr_tStatus | gdh_ObjidToName (pwr_tObjid oid, char *namebuf, pwr_tUInt32 size, pwr_tBitMask nametype) |
Get the name of an object identified by its object identity. More... | |
pwr_tStatus | gdh_ObjidToPointer (pwr_tObjid object, void **objectData) |
Gets the address of the data of an object, given its object identity. More... | |
pwr_tStatus | gdh_RefObjectInfo (char *attributeName, void **objectData, pwr_tSubid *subid, unsigned int sizeOfObjectData) |
The routine returns an address to the data that is denoted by Name. The name can be either an object or an object attribute. More... | |
pwr_tStatus | gdh_RefObjectInfoList (unsigned int nEntry, gdh_sObjRef *objectReference, pwr_tSubid *subid) |
This routine returns addresses to the information that is denoted by "objref[].fullname". More... | |
pwr_tStatus | gdh_RenameObject (pwr_tObjid objectId, char *newObjectName) |
Rename a local object. More... | |
pwr_tStatus | gdh_SetAlarmBlockLevel (pwr_tObjid object, pwr_tUInt32 alarmBlockLevel) |
Sets the alarm block level for a certain object. More... | |
pwr_tStatus | gdh_SetAlarmLevel (pwr_tObjid object, pwr_tUInt32 alarmLevel) |
This routine sets the alarm level for a certain object. More... | |
pwr_tStatus | gdh_SetObjectInfo (const char *attributeName, void *buffer, unsigned int sizeOfBuffer) |
Change the value of an attribute or the whole body of an object. More... | |
pwr_tStatus | gdh_SetObjectInfoAttrref (pwr_sAttrRef *attributeReference, void *buffer, unsigned int sizeOfBuffer) |
Change the data of an object or an attribute. More... | |
pwr_tStatus | gdh_SubAssociateBuffer (pwr_tSubid subid, void **buffer, unsigned int sizeOfBuffer) |
Associate a buffer with the subscription. More... | |
pwr_tStatus | gdh_SubData (pwr_tSubid subid, void *buffer, unsigned int sizeOfBuffer) |
Fetch the data associated with a subscription. More... | |
pwr_tStatus | gdh_SubRefObjectInfoAttrref (pwr_sAttrRef *attributeReference, pwr_tSubid *subid) |
This routine returns a subid to the information that is denoted by 'aref'. The name can be either an object or an object attribute. More... | |
pwr_tStatus | gdh_SubRefObjectInfoList (unsigned int entryCount, void *object[], pwr_tBoolean isAttrref[], pwr_tSubid subid[]) |
Sets up a list of subscriptions to an object/attribute. More... | |
pwr_tStatus | gdh_SubRefObjectInfoName (char *attributeName, pwr_tSubid *subid) |
Get the address of the data that is denoted by 'name'. More... | |
pwr_tStatus | gdh_SubSize (pwr_tSubid subid, unsigned int *size) |
Fetch the data size associated with a subscription. More... | |
pwr_tStatus | gdh_SetSubscriptionDefaults (pwr_tInt32 defaultUpdateTime, pwr_tInt32 defaultTimeOut) |
Sets default subscription timers for future subscription requests. More... | |
pwr_tStatus | gdh_SubUnrefObjectInfo (pwr_tSubid subid) |
Terminates subscription of an object or an attribute. More... | |
void | gdh_SubUnrefObjectInfoAll (void) |
Terminates all subscriptions set up by this user (job/process). | |
pwr_tStatus | gdh_SubUnrefObjectInfoList (unsigned int nEntry, pwr_tSubid *subid) |
Terminates a list of subscriptions. More... | |
pwr_tStatus | gdh_UnrefObjectInfo (pwr_tSubid subid) |
Terminates the subscription defined by the subscription identity. More... | |
pwr_tStatus | gdh_UnrefObjectInfoAll (void) |
Terminates all subscriptions set up by this process. More... | |
pwr_tStatus | gdh_VolumeIdToName (pwr_tVid vid, char *name, int size) |
Get the name for a volume denoted by volume identity. More... | |
void | gdh_StoreRtdbPointer (unsigned long *rtdbReference, void *virtualAddress) |
Convert pointer to rtdb relative pointer. | |
void * | gdh_TranslateRtdbPointer (unsigned long rtdbReference) |
Convert rtdb relative pointer to absolute pointer. More... | |
void | gdh_GetTimeDL (pwr_tTime *atp, pwr_tTime *time) |
Thread save function to fetch a direct linked absolute time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More... | |
void | gdh_SetTimeDL (pwr_tTime *atp, pwr_tTime *time) |
Thread save function to store a direct linked absolute time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More... | |
void | gdh_GetDeltaTimeDL (pwr_tDeltaTime *dtp, pwr_tDeltaTime *time) |
Thread save function to fetch a direct linked delta time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More... | |
void | gdh_SetDeltaTimeDL (pwr_tDeltaTime *dtp, pwr_tDeltaTime *time) |
Thread save function to store a direct linked delta time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More... | |
void | gdh_GetStrDL (char *sp, char *str, int size) |
Thread save function to fetch a direct linked string value. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str). More... | |
void | gdh_SetStrDL (char *sp, const char *str, int size) |
Thread save function to store a direct linked string value. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str). More... | |
pwr_tStatus | gdh_GetObjectInfoTime (const char *name, pwr_tTime *time) |
Fetch an absolute time value from an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More... | |
pwr_tStatus | gdh_SetObjectInfoTime (const char *name, pwr_tTime *time) |
Store an absolute time value in an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More... | |
pwr_tStatus | gdh_GetObjectInfoDeltaTime (const char *name, pwr_tDeltaTime *time) |
Fetch an delta time value from an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More... | |
pwr_tStatus | gdh_SetObjectInfoDeltaTime (const char *name, pwr_tDeltaTime *time) |
Store a delta time value in an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More... | |
pwr_tStatus | gdh_GetObjectInfoStr (const char *name, char *str, int size) |
Fetch a string value from an attribute. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str). More... | |
pwr_tStatus | gdh_SetObjectInfoStr (const char *name, const char *str, int size) |
Store a string value in an attribute. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str). More... | |
pwr_tStatus gdh_ArefANameToAref | ( | pwr_sAttrRef * | arp, |
const char * | aname, | ||
pwr_sAttrRef * | oarp | ||
) |
Get the attribute reference for an attribute in an object attribute reference, where the attribute is specified by an string.
arp | Pointer to object attribute reference |
aname | Attribute name string |
oarp | Receives the attribute reference. |
Definition at line 192 of file rt_gdh.c.
Referenced by gdh_FReadObject().
pwr_tStatus gdh_ArefDisabled | ( | pwr_sAttrRef * | arp, |
pwr_tDisableAttr * | disabled | ||
) |
pwr_tStatus gdh_AttrArefToObjectAref | ( | pwr_sAttrRef * | arp, |
pwr_sAttrRef * | oarp | ||
) |
Get the attribute reference to an object or attribute object, from the attribute reference to an attribute in the object.
This functions cuts the last attribute segment.
arp | Attribute reference to the attribute. |
oarp | Returned attribute reference to the object or attribute object. |
Definition at line 257 of file rt_gdh.c.
References pwr_mAttrRef::b, and pwr_sAttrRef::Flags.
pwr_tStatus gdh_AttrrefToName | ( | pwr_sAttrRef * | arp, |
char * | name, | ||
unsigned int | size, | ||
pwr_tBitMask | nametype | ||
) |
Translate an attribute referece to a name.
arp | Pointer to the attribute reference. |
name | Name buffer supplied by the user, where name is written. |
size | Size of the name buffer |
nametype | Mask of type cdh_mName. |
Definition at line 128 of file rt_gdh.c.
References pwr_mAttrRef::b, pwr_sAttrRef::Flags, gdh_ObjidToName(), and pwr_sAttrRef::Objid.
pwr_tStatus gdh_AttrRefToPointer | ( | pwr_sAttrRef * | arp, |
void ** | p | ||
) |
Gets the address of the data of an attribute reference.
Nota bene ! Only local objects can be referenced.
arp | Attribute reference. |
p | Reveives a pointer to the object. |
Definition at line 2493 of file rt_gdh.c.
Referenced by gdh_FReadObject().
pwr_tStatus gdh_AttrStringToValue | ( | int | type_id, |
char * | value_str, | ||
void * | buffer_ptr, | ||
int | buff_size, | ||
int | attr_size | ||
) |
Convert an attribute string to value.
type_id | Attribute type |
value_str | String value |
buffer_ptr | Value buffer |
buff_size | Size of value buffer |
attr_size | Attribute size, used for String and Text attributes |
Definition at line 4879 of file rt_gdh.c.
Referenced by gdh_FReadObject().
pwr_tStatus gdh_AttrValueToString | ( | pwr_eType | type_id, |
pwr_tTid | tid, | ||
void * | value_ptr, | ||
char * | str, | ||
int | size, | ||
int * | len, | ||
char * | format | ||
) |
pwr_tStatus gdh_ClassAttrrefToAttr | ( | pwr_tClassId | cid, |
pwr_sAttrRef * | arp, | ||
char * | name, | ||
int | size | ||
) |
Get the attribute name from a class and attrref.
The objid of the attrref is not used.
cid | The class identity whose attribute we want to examin |
arp | Attribute description. |
name | The returned name of the attribute |
size | Max size of the returned name |
pwr_tStatus gdh_ClassAttrToAttrref | ( | pwr_tClassId | cid, |
const char * | name, | ||
pwr_sAttrRef * | arp | ||
) |
Converts a class and attribute string to attrref format.
The Objid of the attrref is left untouched.
cid | The class identity whose attribute we want to examin |
name | The name of the attribute we want |
arp | Receives the attribute description. |
pwr_tStatus gdh_ClassNameToId | ( | const char * | name, |
pwr_tClassId * | cid | ||
) |
pwr_tStatus gdh_CreateObject | ( | char * | name, |
pwr_tClassId | cid, | ||
unsigned int | size, | ||
pwr_tObjid * | oid, | ||
pwr_tObjid | req_oid, | ||
pwr_tBitMask | flags, | ||
pwr_tObjid | soid | ||
) |
Create an object in a dynamic volume.
Objects can only be created in local dynamic volumes, or in the local system volume.
Space is allocated for the object which must not exist. This call is possible only if the object is created in a local volume, i.e a volume owned by the local node.
All reachable nodes, who have mounted the volume in question, are notified about this new object. It is possible to require a certain objid, but the the objid must not exist in the requested volume.
If the volume identity part of the required objid (objid.vid) is zero the the volume id indicated by the given name is used. If the objid.vid != zero, then it must match the volume id indicated by the name.
name | Object name string with path. |
cid | Class id for object. |
size | Size of object body. Only needed for objects with dynamic size, else 0. |
oid | Returned objid. |
req_oid | Requested objid. Only if any special objid is prefered, else pwr_cNOid. |
flags | Alias client or mount client. |
soid | Server objid. Used for ExternVolumes. Normally pwr_cNOid |
pwr_tStatus gdh_DeleteObject | ( | pwr_tObjid | oid | ) |
Remove a local object.
Object header and the associated body are removed. This call is possible only if the object is in a local volume, i.e a volume owned by the local node. The volume must be of class $DynamicVolume or $SystemVolume. The object must not be parent to any other object.
All reachable nodes, who have mounted the volume in question, are notified about the removal of this object.
The object is not completly removed until all directlink and subscriptions to the object are removed.
oid | The identity of the object to delete. |
Definition at line 513 of file rt_gdh.c.
References cdh_ObjidIsNull().
Referenced by nmpsappl_RemoveAndDeleteData().
pwr_tStatus gdh_DeleteObjectTree | ( | pwr_tObjid | oid | ) |
Remove a local object tree.
Object header and the associated body are removed. This call is possible only if the object is in a local volume, i.e a volume owned by the local node. The volume must be of class $DynamicVolume or $SystemVolume. The object must not be parent to any other object.
All reachable nodes, who have mounted the volume in question, are notified about the removal of this object.
The objects is not completly removed until all directlink and subscriptions to the object are removed.
oid | The identity of the root object of the tree. |
Definition at line 548 of file rt_gdh.c.
References cdh_ObjidIsNull().
pwr_tStatus gdh_DLRefObjectInfoAttrref | ( | pwr_sAttrRef * | arp, |
void ** | infop, | ||
pwr_tDlid * | dlid | ||
) |
Request a direct link to the data denoted by an attribute reference.
The object owning the data must be owned by the local node. The caller receives a pointer to data in the object body in the realtime database. The data can be changed by the user without restriction.
The data should be unlinked with a gdh_DLUnrefObjectInfo() call.
arp | Pointer to attribute reference for object or attribute to link to. |
infop | Returnd pointer to the data. |
dlid | Id for the direct link. Used to unlink the data. |
pwr_tStatus gdh_DLUnrefObjectInfo | ( | pwr_tDlid | dlid | ) |
Terminate direct linking of an object or an object attribute.
The pointer returned by DLRefObjectInfo can become invalid after this call.
dlid | <The id of the direct link we want to remove |
pwr_tStatus gdh_FReadObject | ( | char * | filename, |
pwr_tAttrRef * | arp | ||
) |
Read a textfile into an object.
Reads a textfile, created by gdh_FWriteObject, and inserts the values into the specified object.
The file has to be generated from the same object or from an object of the same class.
filename | File specification |
arp | Attribute reference for object |
Definition at line 4459 of file rt_gdh.c.
References cdh_tidIsCid, EVEN, gdh_ArefANameToAref(), gdh_AttrRefToPointer(), gdh_AttrStringToValue(), gdh_GetAttributeCharAttrref(), gdh_GetAttrRefTid(), and gdh_SetObjectInfoAttrref().
pwr_tStatus gdh_FWriteObject | ( | char * | filename, |
pwr_tAttrRef * | arp | ||
) |
Write the content of an object to textfile.
The file can later be read and the attribute values inserted in the object or in another object of the same class with the function gdh_FReadObject.
filename | File specification |
arp | Attribute reference to object |
Definition at line 4404 of file rt_gdh.c.
References pwr_mAttrRef::b, cdh_tidIsCid, EVEN, pwr_sAttrRef::Flags, gdh_GetAttrRefTid(), gdh_GetObjectInfoAttrref(), gdh_GetObjectSize(), pwr_sAttrRef::Objid, and pwr_sAttrRef::Size.
pwr_tStatus gdh_GetAlarmInfo | ( | pwr_tObjid | oid, |
pwr_tUInt32 * | a, | ||
pwr_tUInt32 * | maxa, | ||
pwr_tUInt32 * | b, | ||
pwr_tUInt32 * | maxb, | ||
pwr_tUInt32 * | alarmvisibility | ||
) |
Get the alarm status for a certain object.
oid | Object identity |
a | Receives the alarm status. Can be NULL |
maxa | Receives the highest alarm level of the object. Can be NULL |
b | Receives the blocking level of the object. CAn be NULL |
maxb | Receives the highest existing blocking level of the object. Can be NULL |
alarmvisibility | Receives the alarm block level. |
pwr_tStatus gdh_GetAttributeCharacteristics | ( | char * | name, |
pwr_tTypeId * | tid, | ||
pwr_tUInt32 * | size, | ||
pwr_tUInt32 * | offs, | ||
pwr_tUInt32 * | elem | ||
) |
Get the characteristics of an attribute, given its name and the class it belongs to.
The output arguments can have an actual value of NULL if they are not wanted.
name | String containing attribute name; object.attribute or object.attribute[index]. |
tid | Address to an integer where the type is stored. |
size | Address to an integer where the size is stored. |
offs | Address to an integer where the offset is stored. |
elem | Address to an integer where the # of elements is stored. |
pwr_tStatus gdh_GetAttributeCharAttrref | ( | pwr_sAttrRef * | arp, |
pwr_tTypeId * | tid, | ||
unsigned int * | size, | ||
unsigned int * | offs, | ||
unsigned int * | elem | ||
) |
Get the characteristics of an attribute.
The output arguments can be NULL if they are not wanted.
arp | The attribute of which to fetch the charactertistics. |
tid | Receives the attribute type. |
size | Receives the size in bytes |
offs | Receives the offset of the attribute from the beginning of the object . |
elem | Receives the number of elements. |
Definition at line 1949 of file rt_gdh.c.
Referenced by gdh_FReadObject().
pwr_tStatus gdh_GetAttributeFlags | ( | pwr_sAttrRef * | arp, |
unsigned int * | flags | ||
) |
pwr_tStatus gdh_GetAttrRefTid | ( | pwr_sAttrRef * | arp, |
pwr_tTid * | tid | ||
) |
Get the type or class identifier of an attribute reference.
arp | The attribute reference. |
tid | Receives the aref type or class identity. |
Definition at line 1145 of file rt_gdh.c.
References pwr_mAttrRef::b, pwr_sAttrRef::Body, pwr_sAttrRef::Flags, gdh_GetObjectClass(), pwr_sAttrRef::Objid, pwr_sAttrRef::Offset, and pwr_sAttrRef::Size.
Referenced by gdh_FReadObject(), and gdh_FWriteObject().
pwr_tStatus gdh_GetChild | ( | pwr_tObjid | oid, |
pwr_tObjid * | new_oid | ||
) |
Get the object identity of the first child of an object.
Other children are fetched with gdh_GetNextSibling.
Example
oid | The object identity. |
new_oid | Recevies the object identity of the first child. |
pwr_tStatus gdh_GetClassInfo | ( | pwr_tCid | cid, |
gdh_sClassInfo * | info | ||
) |
pwr_tStatus gdh_GetClassList | ( | pwr_tClassId | cid, |
pwr_tObjid * | oid | ||
) |
Get the object identity of the first object in the list of objects of a specified class.
The call shows only private volumes (of class $RootVolume, $SubVolume, $DynamicVolume, $ClassVolume and $SystemVolume), and shared volumes.
Example
cid | The class identity. |
oid | Receives the object identity. |
pwr_tStatus gdh_GetClassListAttrRef | ( | pwr_tClassId | cid, |
pwr_sAttrRef * | arp | ||
) |
Get the attribute reference of the first object in the list of objects of a specified class. The object can be a solitary object or an attribute object.
The call shows only private volumes (of class $RootVolume, $SubVolume, $DynamicVolume, $ClassVolume and $SystemVolume), and shared volumes.
Example
cid | The class identity. |
arp | Receives the attribute reference. |
void gdh_GetDeltaTimeDL | ( | pwr_tDeltaTime * | dtp, |
pwr_tDeltaTime * | time | ||
) |
Thread save function to fetch a direct linked delta time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time).
dtp | Direct link to time attribute |
time | Receives the requested time |
pwr_tStatus gdh_GetDynamicAttrSize | ( | pwr_tObjid | oid, |
char * | name, | ||
pwr_tUInt32 * | size | ||
) |
pwr_tStatus gdh_GetEnumValueDef | ( | pwr_tTid | tid, |
gdh_sValueDef ** | vd, | ||
int * | rows | ||
) |
Get definition information for an enumeration type.
Returns a data stucture with the defined enumeration values and corresponding texts for an enumeration type. The datastructure is of type gdh_sValueDef, with an array of pointers to the values definition objects of the enumeration values.
The data structure should be freed with a free() call.
tid | Enumeration type id |
vd | Recieves a pointer to the data structure. |
rows | Number defined enum values |
pwr_tStatus gdh_GetLocalParent | ( | pwr_tObjid | oid, |
pwr_tObjid * | new_oid | ||
) |
Get the object identity of the local parent of an object.
If the parent is a MountObject, the objid for the MountObject will be returned, not the mounted object, as in gdh_GetParent:
oid | The identity of the object. |
new_oid | Receives the object identity of local parent. |
pwr_tStatus gdh_GetMaskBitDef | ( | pwr_tTid | tid, |
gdh_sBitDef ** | bd, | ||
int * | rows | ||
) |
Get definition information for a mask type.
Returns a data stucture with the defined bit values and corresponding texts for a mask type. The datastructure is of type gdh_sBitDef, which contains an array with ponters to the but definition objects for the bits.
The data structure should be freed with a free() call.
tid | Type identity for mask. |
bd | Receives a pointer to the data structure. |
rows | Number of defined bit values. |
pwr_tStatus gdh_GetNextAttrRef | ( | pwr_tClassId | cid, |
pwr_sAttrRef * | arp, | ||
pwr_sAttrRef * | new_arp | ||
) |
Get the attrref of the next object in the list of objects of a certain class. The object can be a solitary object or an attribute object.
The visibility of objects in the class list are restricted to objects in private volumes, (of class $RootVolume, $SubVolume, $DynamicVolume, $ClassVolume and $SystemVolume), and in shared volumes.
cid | The class identity. |
arp | The attribute reference. |
new_arp | Receives the attribute reference |
pwr_tStatus gdh_GetNextObject | ( | pwr_tObjid | oid, |
pwr_tObjid * | new_oid | ||
) |
Get the object identity of the next object in the list of objects of a certain class.
The visibility of objects in the class list are restricted to objects in private volumes, (of class $RootVolume, $SubVolume, $DynamicVolume, $ClassVolume and $SystemVolume), and in shared volumes.
oid | The object identity. |
new_oid | Receives the object identity |
pwr_tStatus gdh_GetNextObjectAttrRef | ( | pwr_tClassId | cid, |
pwr_sAttrRef * | arp, | ||
pwr_sAttrRef * | new_arp | ||
) |
pwr_tStatus gdh_GetNextSibling | ( | pwr_tObjid | oid, |
pwr_tObjid * | new_oid | ||
) |
Get the object identity of the next sibling (i.e. the next object with the same parent).
oid | The object identity. |
new_oid | Receives the object identity of the next sibling. |
pwr_tStatus gdh_GetNextVolume | ( | pwr_tVid | pvid, |
pwr_tVid * | vid | ||
) |
Get the next volume in the volume list.
The first volume can be fetched with gdh_GetVolumeList.
pwr_tStatus gdh_GetNodeIndex | ( | pwr_tNodeId * | nid | ) |
pwr_tStatus gdh_GetNodeInfo | ( | pwr_tNodeId | nid, |
gdh_sNodeInfo * | ip | ||
) |
pwr_tStatus gdh_GetNodeObject | ( | pwr_tNodeId | nid, |
pwr_tObjid * | oid | ||
) |
Return the objid of the node object for a node identified by a node identifier (of type pwr_tNodeId).
If the node identity is specified as zero, the node object for the local node is returned.
nid | The node index. |
oid | Receive the object identity. |
pwr_tStatus gdh_GetObjectClass | ( | pwr_tObjid | oid, |
pwr_tClassId * | cid | ||
) |
Get the class identifier of an object.
This information can be retrieved both for local and remote objects.
oid | The identity of the object. |
cid | Receives the object class identity. |
Definition at line 1107 of file rt_gdh.c.
Referenced by gdh_GetAttrRefTid().
pwr_tStatus gdh_GetObjectClassList | ( | pwr_tCid | cid, |
pwr_tOid | oid, | ||
pwr_sAttrRef * | arp | ||
) |
pwr_tStatus gdh_GetObjectDLCount | ( | pwr_tObjid | oid, |
pwr_tUInt32 * | count | ||
) |
pwr_tStatus gdh_GetObjectInfo | ( | const char * | name, |
pwr_tAddress | bufp, | ||
pwr_tUInt32 | bufsize | ||
) |
Fetch data from an object or an attribute.
The caller gets blocked until the information is available. The caller is responsible for allocating a buffer where the information can be stored. If that buffer is to small, the information will be truncated.
name | Name of object or object.parameter. |
bufp | Pointer to a buffer of 'bufsize' bytes to be filled with requested information. |
bufsize | Size of the 'bufp' buffer. |
Definition at line 789 of file rt_gdh.c.
Referenced by gdh_GetObjectInfoDeltaTime(), gdh_GetObjectInfoStr(), and gdh_GetObjectInfoTime().
pwr_tStatus gdh_GetObjectInfoAttrref | ( | pwr_sAttrRef * | arp, |
void * | bufp, | ||
unsigned int | bufsize | ||
) |
Fetch the data of an attribute or a whole object body.
The function blocks until the information is available. The caller is responsible for allocating a buffer where the information can be stored. If that buffer is to small the information is truncated.
arp | Attribute reference descriptor that defines an object or an object reference |
bufp | Receives the requested information |
bufsize | The size in bytes of the data buffer |
Definition at line 916 of file rt_gdh.c.
Referenced by gdh_FWriteObject().
pwr_tStatus gdh_GetObjectInfoDeltaTime | ( | const char * | name, |
pwr_tDeltaTime * | time | ||
) |
Fetch an delta time value from an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time).
name | Attribute name |
time | Receives the requested time |
Definition at line 5548 of file rt_gdh.c.
References gdh_GetObjectInfo().
pwr_tStatus gdh_GetObjectInfoStr | ( | const char * | name, |
char * | str, | ||
int | size | ||
) |
Fetch a string value from an attribute. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str).
name | Attribute name |
str | Receives the requested string |
size | String size |
Definition at line 5590 of file rt_gdh.c.
References gdh_GetObjectInfo().
pwr_tStatus gdh_GetObjectInfoTime | ( | const char * | name, |
pwr_tTime * | time | ||
) |
Fetch an absolute time value from an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time).
name | Attribute name |
time | Receives the requested time |
Definition at line 5506 of file rt_gdh.c.
References gdh_GetObjectInfo().
pwr_tStatus gdh_GetObjectLocation | ( | pwr_tObjid | oid, |
pwr_tBoolean * | location | ||
) |
Return the location of an object.
The argument 'location' will get the value TRUE if the object is local, i.e. the object is in a volume owned by the local node, else the value FALSE.
oid | The identity of the object. |
location | Receives the location. TRUE means local and FALSE remote. |
pwr_tStatus gdh_GetObjectNodeIndex | ( | pwr_tObjid | oid, |
pwr_tNodeId * | nid | ||
) |
pwr_tStatus gdh_GetObjectSize | ( | pwr_tObjid | oid, |
pwr_tUInt32 * | size | ||
) |
Get the size of the body of an object.
This information can be retrieved both for local and remote objects.
oid | The object identity. |
size | Receives the size in bytes of the object. |
Definition at line 1025 of file rt_gdh.c.
Referenced by gdh_FWriteObject().
pwr_tStatus gdh_GetParent | ( | pwr_tObjid | oid, |
pwr_tObjid * | new_oid | ||
) |
Get the object identity of the parent of an object.
oid | The identity of the object. |
new_oid | Receives the object identity of the parent. |
pwr_tStatus gdh_GetPreviousObject | ( | pwr_tObjid | oid, |
pwr_tObjid * | new_oid | ||
) |
Get the object identity of the previous object in the list of objects of a certain class.
The visibility of objects in the class list are restricted to objects in private volumes, (of class $RootVolume, $SubVolume, $DynamicVolume, $ClassVolume and $SystemVolume), and in shared volumes.
oid | The object identity. |
new_oid | Receives the identity of the previos object. |
pwr_tStatus gdh_GetPreviousSibling | ( | pwr_tObjid | oid, |
pwr_tObjid * | new_oid | ||
) |
Get the object identity of the previous sibling (i.e. the previous object with the same parent).
oid | The object identity. |
new_oid | Receievs the object identity for the previous sibling. |
pwr_tStatus gdh_GetRootList | ( | pwr_tObjid * | oid | ) |
Get the first root object in the object tree.
Returns the object identity for the first root object.
Other root objects are fetched with gdh_GetNextSibling.
Example
oid | Receives the object identity of the first root object. |
pwr_tStatus gdh_GetRootVolume | ( | pwr_tVid * | vid | ) |
pwr_tStatus gdh_GetSecurityInfo | ( | pwr_sSecurity * | security | ) |
Get security information.
Returns the content of the $Securiy object of the current node.
security | Pointer to buffer supplied by the user |
Definition at line 5165 of file rt_gdh.c.
References gdh_ObjidToName().
void gdh_GetStrDL | ( | char * | sp, |
char * | str, | ||
int | size | ||
) |
Thread save function to fetch a direct linked string value. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str).
sp | Direct link to string attribute |
str | Receives the requested string |
size | Size of string |
pwr_tStatus gdh_GetSubscriptionOldness | ( | pwr_tSubid | sid, |
pwr_tBoolean * | old, | ||
pwr_tTime * | lastupdate, | ||
pwr_tStatus * | status | ||
) |
Checks the oldness of a certain subscription.
Data gets ‘old’ after a certain timeout-time, when no updates are refreshing the data.
sid | Subscription to examine. |
old | Pointer to where the oldness flag is stored or NULL. |
lastupdate | Pointer to where the 64-bit time value of last update is stored or NULL. |
status | Status of last data transfer. |
Definition at line 1358 of file rt_gdh.c.
References cdh_uRid::pwr.
pwr_tStatus gdh_GetSuperClass | ( | pwr_tCid | cid, |
pwr_tCid * | supercid, | ||
pwr_tObjid | oid | ||
) |
Get the superclass for a class.
If the class for a remote object is examined, the class might not be loded on the local, and in this case the object itself has to supplied in the oid argument. For local classes, this argument can be set to pwr_cNOid.
Example
cid | Class identity. |
supercid | Received class identity for the super class. |
oid | Object id for remote object, normally pwr_cNOid |
void gdh_GetTimeDL | ( | pwr_tTime * | atp, |
pwr_tTime * | time | ||
) |
Thread save function to fetch a direct linked absolute time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time).
atp | Direct link to time attribute |
time | Receives the requested time |
pwr_tStatus gdh_GetVolumeInfo | ( | pwr_tVid | vid, |
gdh_sVolumeInfo * | info | ||
) |
pwr_tStatus gdh_GetVolumeList | ( | pwr_tVid * | vid | ) |
Get the first volume.
Other volumes can be fetched with gdh_GetNextVolume.
Example
vid | Recieves the volume identity for the first volume. |
pwr_tStatus gdh_Init | ( | const char * | name | ) |
Initialize the process to the Proview runtime environment.
Example
name | Process name |
pwr_tBoolean gdh_IsInitialized | ( | ) |
pwr_tStatus gdh_MountObjidToPointer | ( | pwr_tObjid | oid, |
void ** | p | ||
) |
pwr_tStatus gdh_MoveObject | ( | pwr_tObjid | oid, |
pwr_tObjid | poid | ||
) |
Move a local object.
This call is possible only if the object is in a local volume, i.e a volume owned by the local node. The volume must be of class $DynamicVolume or $SystemVolume. All reachable nodes, who have mounted the volume in question, are notified about the move of this object.
oid | The object that should be moved. |
poid | The object that should become the new parent. |
Definition at line 2162 of file rt_gdh.c.
References cdh_ObjidIsNull().
pwr_tStatus gdh_NameToAttrref | ( | pwr_tObjid | poid, |
const char * | name, | ||
pwr_sAttrRef * | arp | ||
) |
Converts from name string to attribute reference.
Example
poid | This object is added to the Name argument to form the complete name of the object/attribute. It should be specified as pwr_cNobjid if it is not used. |
name | The argument is added to the parent to form the complete item name. If the parent argument is supplied as pwr_cNobjid, this argument is considered to describe the full name. |
arp | The resulting attribute reference descriptor. |
Definition at line 2314 of file rt_gdh.c.
Referenced by gdh_RefObjectInfoList().
pwr_tStatus gdh_NameToObjid | ( | const char * | name, |
pwr_tObjid * | oid | ||
) |
Get the object identity of an object with name 'name'.
Example
name | The object name. |
oid | receives the identity of the object. |
pwr_tStatus gdh_NameToPointer | ( | const char * | name, |
void ** | p | ||
) |
pwr_tStatus gdh_NethandlerRunning | ( | void | ) |
Check if the Nethandler has started.
Returns GDH__SUCCESS if the nethandler is running, else GDH__NONETHANDLER.
Example
pwr_tStatus gdh_ObjidToName | ( | pwr_tObjid | oid, |
char * | namebuf, | ||
pwr_tUInt32 | size, | ||
pwr_tBitMask | nametype | ||
) |
Get the name of an object identified by its object identity.
Example
The caller is responsible for supplying a sufficient buffer.
oid | Object id of an object. |
namebuf | A buffer where the name can be put. |
size | Size of namebuf. |
nametype | Mask of type cdh_mName. |
Definition at line 2371 of file rt_gdh.c.
Referenced by gdh_AttrrefToName(), and gdh_GetSecurityInfo().
pwr_tStatus gdh_ObjidToPointer | ( | pwr_tObjid | oid, |
void ** | p | ||
) |
pwr_tStatus gdh_RefObjectInfo | ( | char * | name, |
void ** | infop, | ||
pwr_tSubid * | sid, | ||
unsigned int | size | ||
) |
The routine returns an address to the data that is denoted by Name. The name can be either an object or an object attribute.
If the object is known and is local, this call will result in a gdh_DLRefObjectInfo, otherwise it will result in a gdh_SubRefObjectInfo.
Some important considerations:
This call is preferable to gdh_NameToPointer or gdh_ObjidToPointer since it prevents the data from being removed until you dereference it. If you need data repeatedly use the gdh_RefObject routines, for a single request use gdh_GetObjectInfo. You may read and write data on the local node. But if the data exists on another node writing will have no effect, since the data will be overwritten by the next subscription update. If you need to write data on another node use gdh_SetObjectInfo. If you want to issue several requests at the same time use gdh_RefObjectInfoList, this is much more efficient than repeated calls to gdh_RefObjectInfo.
Example
name | Supplies the name of an object or object and attribute. |
infop | Receives a pointer to the requested information. |
sid | Receives the subscription identity. |
size | Size of the subscribed data. |
Definition at line 3426 of file rt_gdh.c.
References gdh_sObjRef::adrs, gdh_sObjRef::bufsize, gdh_sObjRef::fullname, gdh_RefObjectInfoList(), and ODD.
Referenced by ra_appl::open().
pwr_tStatus gdh_RefObjectInfoList | ( | unsigned int | n, |
gdh_sObjRef * | objref, | ||
pwr_tSubid * | sid | ||
) |
This routine returns addresses to the information that is denoted by "objref[].fullname".
The name can be either an object or an object parameter. Optionally, the subid array can be supplied. If there is such an argument, it is assumed to have n elements. This can be used to retrieve further info about a particular subscription. If a NULL address is received in an objref[].adrs, that particular subscription never was requested due to some error.
This routine remains only because of compatibility with applications that uses the GDH V1 interface. The logic is emulated using the new, GDH V2 interface. The only internal knowledge is about Subids, if the high byte is 0 then it is a Dlid, otherwise a Subid!
n | # of entries in objref and subid. |
objref | Input: Name list: objects or object.attributes Output: Address list. |
sid | Subids corresponding to objrefs. If supplied as NULL, it is ignored. |
Definition at line 3265 of file rt_gdh.c.
References gdh_NameToAttrref().
Referenced by gdh_RefObjectInfo().
pwr_tStatus gdh_RenameObject | ( | pwr_tObjid | oid, |
char * | name | ||
) |
Rename a local object.
This call is possible only if the object is in a local volume, i.e a volume owned by the local node. The volume must be of class $DynamicVolume or $SystemVolume. All reachable nodes, who have mounted the volume in question, are notified about the renaming of this object.
oid | The object identity that should be renamed. |
name | The new name. |
pwr_tStatus gdh_SetAlarmBlockLevel | ( | pwr_tObjid | oid, |
pwr_tUInt32 | blocklevel | ||
) |
pwr_tStatus gdh_SetAlarmLevel | ( | pwr_tObjid | oid, |
pwr_tUInt32 | alarmlevel | ||
) |
void gdh_SetDeltaTimeDL | ( | pwr_tDeltaTime * | dtp, |
pwr_tDeltaTime * | time | ||
) |
Thread save function to store a direct linked delta time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time).
dtp | Direct link to time attribute |
time | Time value to set |
pwr_tStatus gdh_SetObjectInfo | ( | const char * | name, |
void * | bufp, | ||
unsigned int | bufsize | ||
) |
Change the value of an attribute or the whole body of an object.
The routine stalls until the operation is performed. The caller is responsible for the information in the buffer. If the buffer is shorter then what is required, then a partial update takes place.
Example
name | The name of the object or object attribute. |
bufp | Pointer to the data. |
bufsize | The size in bytes of the data buffer. |
Definition at line 2579 of file rt_gdh.c.
Referenced by gdh_SetObjectInfoDeltaTime(), gdh_SetObjectInfoStr(), and gdh_SetObjectInfoTime().
pwr_tStatus gdh_SetObjectInfoAttrref | ( | pwr_sAttrRef * | arp, |
void * | bufp, | ||
unsigned int | bufsize | ||
) |
Change the data of an object or an attribute.
The routine stalls until the operation is performed. The caller is responsible for the information in the buffer. If the buffer is shorter then what is required, then a partial update takes place.
Example
arp | Supplies the attribute reference decriptor that defines an object or an object and attribute. |
bufp | Pointer to the data. |
bufsize | The size in bytes of the data buffer. |
Definition at line 2722 of file rt_gdh.c.
Referenced by gdh_FReadObject().
pwr_tStatus gdh_SetObjectInfoDeltaTime | ( | const char * | name, |
pwr_tDeltaTime * | time | ||
) |
Store a delta time value in an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time).
name | Attribute name |
time | Time to set |
Definition at line 5569 of file rt_gdh.c.
References gdh_SetObjectInfo().
pwr_tStatus gdh_SetObjectInfoStr | ( | const char * | name, |
const char * | str, | ||
int | size | ||
) |
Store a string value in an attribute. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str).
name | Attribute name |
str | String to set |
size | String size |
Definition at line 5612 of file rt_gdh.c.
References gdh_SetObjectInfo().
pwr_tStatus gdh_SetObjectInfoTime | ( | const char * | name, |
pwr_tTime * | time | ||
) |
Store an absolute time value in an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time).
name | Attribute name |
time | Time to set |
Definition at line 5527 of file rt_gdh.c.
References gdh_SetObjectInfo().
void gdh_SetStrDL | ( | char * | sp, |
const char * | str, | ||
int | size | ||
) |
Thread save function to store a direct linked string value. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str).
sp | Direct link to string attribute |
str | String value to set |
size | Size of string |
pwr_tStatus gdh_SetSubscriptionDefaults | ( | pwr_tInt32 | dt, |
pwr_tInt32 | tmo | ||
) |
Sets default subscription timers for future subscription requests.
Supply negative values for no change. A value of zero resets the default values.
dt | Default update time for subscription requests to come, in ms. |
tmo | Default timeout (i.e. time until data gets flagged as old), in ms. |
void gdh_SetTimeDL | ( | pwr_tTime * | atp, |
pwr_tTime * | time | ||
) |
Thread save function to store a direct linked absolute time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time).
atp | Direct link to time attribute |
time | Time value to set |
Definition at line 5413 of file rt_gdh.c.
References time_GetTime().
pwr_tStatus gdh_SubAssociateBuffer | ( | pwr_tSubid | sid, |
void ** | buffer, | ||
unsigned int | buffersize | ||
) |
Associate a buffer with the subscription.
If a buffer already is associated, that buffer will be returned, if compatible in size. Otherwise an error will be returned.
todo !!! Try to understand this code!, LW? I think it shall be usersize instead of userdata, ML. Please verify.
sid | Subscription referenced. |
buffer | Address of buffer that gets allocated for the caller. |
buffersize | Requested size in bytes of user buffer. |
pwr_tStatus gdh_SubData | ( | pwr_tSubid | subid, |
void * | buffer, | ||
unsigned int | sizeOfBuffer | ||
) |
pwr_tStatus gdh_SubRefObjectInfoAttrref | ( | pwr_sAttrRef * | aref, |
pwr_tSubid * | sid | ||
) |
This routine returns a subid to the information that is denoted by 'aref'. The name can be either an object or an object attribute.
Since this routine operates on a single data item, it is pretty slow. For faster setup of many subscriptions in one call, use gdh_SubRefObjectInfoList.
aref | Reference to an object.attribute. |
sid | Returned handle. |
pwr_tStatus gdh_SubRefObjectInfoList | ( | unsigned int | nentries, |
void * | object[], | ||
pwr_tBoolean | is_aref[], | ||
pwr_tSubid | subid[] | ||
) |
Sets up a list of subscriptions to an object/attribute.
Much more efficient way to establish a number of subscriptions than calling gdh_SubRefObjectInfoAttrref or gdh_SubRefObjectInfoName
nentries | Number of entries in the object[], attrref[] and subid[] arrays. |
object | The address of an array with either the address of a name string or the address of an pwr_sAttrRef identifying the objects or parameters to establish subscriptions for. |
is_aref | True if the corresponding object[] entry is an attrref. Otherwise it is regarded as a name string. |
subid | Returned handles with index matching the object argument. The array must be declared by the caller. |
pwr_tStatus gdh_SubRefObjectInfoName | ( | char * | name, |
pwr_tSubid * | sid | ||
) |
Get the address of the data that is denoted by 'name'.
The name can be either a whole object or an object attribute.
Since this routine operates on a single data item, it is pretty slow. For faster setup of many subscriptions in one call, use gdh_SubRefObjectInfoList.
name | Name of an object or object.attribute. |
sid | Returned handle. |
pwr_tStatus gdh_SubSize | ( | pwr_tSubid | subid, |
unsigned int * | size | ||
) |
pwr_tStatus gdh_SubUnrefObjectInfo | ( | pwr_tSubid | sid | ) |
Terminates subscription of an object or an attribute.
< ERROR
sid | Subscription to terminate. |
Definition at line 3033 of file rt_gdh.c.
References gdh_SubUnrefObjectInfoList().
pwr_tStatus gdh_SubUnrefObjectInfoList | ( | unsigned int | nentries, |
pwr_tSubid * | sid | ||
) |
Terminates a list of subscriptions.
All invalid pwr_tSubids remain in the list. The valid pwr_tSubids are zeroed out!
< INFORMATION
nentries | # of pwr_tSubids in the array. |
sid | Array of subscriptions to terminate. |
Definition at line 2970 of file rt_gdh.c.
Referenced by gdh_SubUnrefObjectInfo().
void* gdh_TranslateRtdbPointer | ( | unsigned long | r | ) |
pwr_tStatus gdh_UnrefObjectInfo | ( | pwr_tSubid | sid | ) |
Terminates the subscription defined by the subscription identity.
The pointer returned by for example gdh_RefObjectInfo is invalid after this call.
N.B.! The user is responsible for removing all subscriptions before terminating a process, the system will not do it for you. This call will result in either a gdh_DLUnrefObjectInfo or a gdh_SubUnrefObjectInfo.
sid | The subscription to terminate. |
Definition at line 3470 of file rt_gdh.c.
References cdh_uRid::pwr, and cdh_uRid::r.
Referenced by ra_appl::close().
pwr_tStatus gdh_UnrefObjectInfoAll | ( | void | ) |
Terminates all subscriptions set up by this process.
This call will result in either a gdh_DLUnrefObjectInfoAll or a gdh_SubUnrefObjectInfoAll.
Definition at line 3498 of file rt_gdh.c.
References gdh_DLUnrefObjectInfoAll(), and gdh_SubUnrefObjectInfoAll().
pwr_tStatus gdh_VolumeIdToName | ( | pwr_tVid | vid, |
char * | name, | ||
int | size | ||
) |
Get the name for a volume denoted by volume identity.
vid | Volume identity |
name | Name buffer, allocated by the user |
size | Size of name buffer |