forked from Archive/PX4-Autopilot
More fixups for orb_advert_t changed to void *
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
parent
bd2b5e4738
commit
a452478ef9
|
@ -805,7 +805,7 @@ fake(int argc, char *argv[])
|
||||||
|
|
||||||
orb_advert_t handle = orb_advertise(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, &ac);
|
orb_advert_t handle = orb_advertise(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, &ac);
|
||||||
|
|
||||||
if (handle == 0) {
|
if (handle == nullptr) {
|
||||||
puts("advertise failed");
|
puts("advertise failed");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -238,7 +238,7 @@ TRONE::TRONE(int bus, int address) :
|
||||||
_collect_phase(false),
|
_collect_phase(false),
|
||||||
_class_instance(-1),
|
_class_instance(-1),
|
||||||
_orb_class_instance(-1),
|
_orb_class_instance(-1),
|
||||||
_distance_sensor_topic(0),
|
_distance_sensor_topic(nullptr),
|
||||||
_sample_perf(perf_alloc(PC_ELAPSED, "trone_read")),
|
_sample_perf(perf_alloc(PC_ELAPSED, "trone_read")),
|
||||||
_comms_errors(perf_alloc(PC_COUNT, "trone_comms_errors")),
|
_comms_errors(perf_alloc(PC_COUNT, "trone_comms_errors")),
|
||||||
_buffer_overflows(perf_alloc(PC_COUNT, "trone_buffer_overflows"))
|
_buffer_overflows(perf_alloc(PC_COUNT, "trone_buffer_overflows"))
|
||||||
|
|
|
@ -81,7 +81,7 @@ MavlinkMissionManager::MavlinkMissionManager(Mavlink *mavlink) : MavlinkStream(m
|
||||||
_transfer_partner_compid(0),
|
_transfer_partner_compid(0),
|
||||||
_offboard_mission_sub(-1),
|
_offboard_mission_sub(-1),
|
||||||
_mission_result_sub(-1),
|
_mission_result_sub(-1),
|
||||||
_offboard_mission_pub(0),
|
_offboard_mission_pub(nullptr),
|
||||||
_slow_rate_limiter(_interval / 10.0f),
|
_slow_rate_limiter(_interval / 10.0f),
|
||||||
_verbose(false)
|
_verbose(false)
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
|
|
||||||
MavlinkParametersManager::MavlinkParametersManager(Mavlink *mavlink) : MavlinkStream(mavlink),
|
MavlinkParametersManager::MavlinkParametersManager(Mavlink *mavlink) : MavlinkStream(mavlink),
|
||||||
_send_all_index(-1),
|
_send_all_index(-1),
|
||||||
_rc_param_map_pub(0),
|
_rc_param_map_pub(nullptr),
|
||||||
_rc_param_map()
|
_rc_param_map()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -284,7 +284,7 @@ uORB::DeviceNode::publish(const orb_metadata *meta, orb_advert_t handle, const v
|
||||||
{
|
{
|
||||||
//warnx("uORB::DeviceNode::publish meta = %p", meta);
|
//warnx("uORB::DeviceNode::publish meta = %p", meta);
|
||||||
|
|
||||||
if (handle == 0) {
|
if (handle == nullptr) {
|
||||||
warnx("uORB::DeviceNode::publish called with invalid handle");
|
warnx("uORB::DeviceNode::publish called with invalid handle");
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return ERROR;
|
return ERROR;
|
||||||
|
|
|
@ -89,18 +89,18 @@ orb_advert_t uORB::Manager::orb_advertise_multi(const struct orb_metadata *meta,
|
||||||
/* open the node as an advertiser */
|
/* open the node as an advertiser */
|
||||||
fd = node_open(PUBSUB, meta, data, true, instance, priority);
|
fd = node_open(PUBSUB, meta, data, true, instance, priority);
|
||||||
if (fd == ERROR)
|
if (fd == ERROR)
|
||||||
return 0;
|
return nullptr;
|
||||||
|
|
||||||
/* get the advertiser handle and close the node */
|
/* get the advertiser handle and close the node */
|
||||||
result = ioctl(fd, ORBIOCGADVERTISER, (unsigned long)&advertiser);
|
result = ioctl(fd, ORBIOCGADVERTISER, (unsigned long)&advertiser);
|
||||||
close(fd);
|
close(fd);
|
||||||
if (result == ERROR)
|
if (result == ERROR)
|
||||||
return 0;
|
return nullptr;
|
||||||
|
|
||||||
/* the advertiser must perform an initial publish to initialise the object */
|
/* the advertiser must perform an initial publish to initialise the object */
|
||||||
result = orb_publish(meta, advertiser, data);
|
result = orb_publish(meta, advertiser, data);
|
||||||
if (result == ERROR)
|
if (result == ERROR)
|
||||||
return 0;
|
return nullptr;
|
||||||
|
|
||||||
return advertiser;
|
return advertiser;
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ int uORBTest::UnitTest::test()
|
||||||
t.val = 0;
|
t.val = 0;
|
||||||
ptopic = orb_advertise(ORB_ID(orb_test), &t);
|
ptopic = orb_advertise(ORB_ID(orb_test), &t);
|
||||||
|
|
||||||
if (ptopic == 0)
|
if (ptopic == nullptr)
|
||||||
return test_fail("advertise failed: %d", errno);
|
return test_fail("advertise failed: %d", errno);
|
||||||
|
|
||||||
test_note("publish handle 0x%08x", ptopic);
|
test_note("publish handle 0x%08x", ptopic);
|
||||||
|
|
Loading…
Reference in New Issue