Ensure that the state monitor reports the full node path when a device is started via hipadaba.

Added a "path" field to the hdb node structure
GetHipadabaPath now sets node->path to the full hdb node path when called.
sicshipadaba.c: Devices are now started with the node->path instead of the node->name.

r2156 | ffr | 2007-09-26 14:17:19 +1000 (Wed, 26 Sep 2007) | 6 lines
This commit is contained in:
Ferdi Franceschini
2007-09-26 14:17:19 +10:00
committed by Douglas Clowes
parent efb0b117f6
commit 0b583db52f
3 changed files with 10 additions and 1 deletions

View File

@@ -46,6 +46,9 @@ static void DeleteNodeData(pHdb node){
if(node->name != NULL){ if(node->name != NULL){
free(node->name); free(node->name);
} }
if(node->path != NULL){
free(node->path);
}
ReleaseHdbValue(&node->value); ReleaseHdbValue(&node->value);
node->magic = 000000; node->magic = 000000;
@@ -697,6 +700,7 @@ char *GetHipadabaPath(pHdb node){
strcat(pPtr,"/"); strcat(pPtr,"/");
strcat(pPtr,nodeStack[i]->name); strcat(pPtr,nodeStack[i]->name);
} }
node->path = pPtr;
return pPtr; return pPtr;
} }
/*==================== Callback Functions ==================================*/ /*==================== Callback Functions ==================================*/

View File

@@ -71,6 +71,7 @@ typedef struct __hipadaba {
struct __hdbcallback *readCallbacks; struct __hdbcallback *readCallbacks;
struct __hdbcallback *treeChangeCallbacks; struct __hdbcallback *treeChangeCallbacks;
char *name; char *name;
char *path;
hdbValue value; hdbValue value;
int protected; int protected;
pStringDict properties; pStringDict properties;

View File

@@ -112,7 +112,8 @@ static int SICSDriveCallback(void *userData, void *callData, pHdb node,
pCon = (SConnection *)callData; pCon = (SConnection *)callData;
dum = (pDummy)userData; dum = (pDummy)userData;
assert(pCon != NULL && dum != NULL); assert(pCon != NULL && dum != NULL);
return StartDevice(pServ->pExecutor,node->name,dum->pDescriptor, GetHipadabaPath(node);
return StartDevice(pServ->pExecutor,node->path,dum->pDescriptor,
userData, pCon, (float)v.v.doubleValue); userData, pCon, (float)v.v.doubleValue);
} }
/*---------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------*/
@@ -870,6 +871,9 @@ static void SICSDeleteNodeData(pHdb node){
if(node->name != NULL){ if(node->name != NULL){
free(node->name); free(node->name);
} }
if(node->path != NULL){
free(node->path);
}
ReleaseHdbValue(&node->value); ReleaseHdbValue(&node->value);
node->magic = 000000; node->magic = 000000;