mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-28 17:00:35 +08:00
Experimental virtual file support
QuRT does not have a filesystem, so creating a virtual filesystem that could be implemented as an in-memory file or a remote file over fastRPC. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -64,7 +64,7 @@ private:
|
||||
px4_dev_t() {}
|
||||
};
|
||||
|
||||
#define PX4_MAX_DEV 100
|
||||
#define PX4_MAX_DEV 30
|
||||
static px4_dev_t *devmap[PX4_MAX_DEV];
|
||||
|
||||
/*
|
||||
@@ -448,8 +448,12 @@ VDev::remove_poll_waiter(px4_pollfd_struct_t *fds)
|
||||
|
||||
VDev *VDev::getDev(const char *path)
|
||||
{
|
||||
printf("VDev::getDev\n");
|
||||
int i=0;
|
||||
for (; i<PX4_MAX_DEV; ++i) {
|
||||
if (devmap[i]) {
|
||||
printf("%s %s\n", devmap[i]->name, path);
|
||||
}
|
||||
if (devmap[i] && (strcmp(devmap[i]->name, path) == 0)) {
|
||||
return (VDev *)(devmap[i]->cdev);
|
||||
}
|
||||
@@ -479,6 +483,18 @@ void VDev::showTopics()
|
||||
}
|
||||
}
|
||||
|
||||
void VDev::showFiles()
|
||||
{
|
||||
int i=0;
|
||||
printf("Files:\n");
|
||||
for (; i<PX4_MAX_DEV; ++i) {
|
||||
if (devmap[i] && strncmp(devmap[i]->name, "/obj/", 5) != 0 &&
|
||||
strncmp(devmap[i]->name, "/dev/", 5) != 0) {
|
||||
printf(" %s\n", devmap[i]->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const char *VDev::topicList(unsigned int *next)
|
||||
{
|
||||
for (;*next<PX4_MAX_DEV; (*next)++)
|
||||
|
||||
Reference in New Issue
Block a user