Hi,
Is there anyway of retrieving the pathname space from within resource manager functions like io_read/io_write/io_devctl() ?
I want to register 2 pathname space in the resource manager and it will have the same handler function. But in the handler function, I want to know the client request that is destined to (whether the request is destined to /dev1 or /dev2) and then call appropriate driver function from within the handler.
If I am right, I need to use the ID I get from resmgr_attach(). But how do I retrieve it from within io_devctl() ?
Also is it possible to retrieve the pathname space in string format from any of the resource mgr attributes ?
======================
int io_devctl(resmgr_context_t *ctp, io_devctl_t *msg, RESMGR_OCB_T *ocb)
{
int nbytes, status, previous;
void *rx_Data;
if ((status = iofunc_devctl_default(ctp, msg, ocb)) != _RESMGR_DEFAULT) {
return(status);
}
status = nbytes = 0;
printf("\r\n%s Entered Recv. ID %d...", __FUNCTION__, ctp->rcvid);
//if the request is destined to dev1
if(dev1)
driver1 -> doJobA(paramA)
else if(dev2)
driver1 -> doJobA(paramB)
…
}
Thanks in advance.