geofence: remove fence & fence_vertex messages

- this was never read
- it was implemented wrong, leading to memory access violations in
  publishFence (an integer was passed instead of the fence_s struct)
This commit is contained in:
Beat Küng
2017-08-04 18:08:51 +02:00
committed by Lorenz Meier
parent b82975f73d
commit 52ca49c682
6 changed files with 9 additions and 33 deletions
-12
View File
@@ -237,7 +237,6 @@ Geofence::addPoint(int argc, char *argv[])
if ((argc == 1) && (strcmp("-clear", argv[0]) == 0)) {
dm_clear(DM_KEY_FENCE_POINTS);
publishFence(0);
return;
}
@@ -265,7 +264,6 @@ Geofence::addPoint(int argc, char *argv[])
if (dm_write(DM_KEY_FENCE_POINTS, ix, DM_PERSIST_POWER_ON_RESET, &vertex, sizeof(vertex)) == sizeof(vertex)) {
if (last) {
publishFence((unsigned)ix + 1);
}
return;
@@ -274,16 +272,6 @@ Geofence::addPoint(int argc, char *argv[])
PX4_WARN("can't store fence point");
}
void
Geofence::publishFence(unsigned vertices)
{
if (_fence_pub == nullptr) {
_fence_pub = orb_advertise(ORB_ID(fence), &vertices);
} else {
orb_publish(ORB_ID(fence), _fence_pub, &vertices);
}
}
int
Geofence::loadFromFile(const char *filename)