mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
AP_GPS: allow external libraries to detect CAN instance
This commit is contained in:
parent
7e214b2695
commit
fe37282f77
@ -889,4 +889,16 @@ void AP_GPS_UAVCAN::handle_param_save_response(AP_UAVCAN* ap_uavcan, const uint8
|
|||||||
ap_uavcan->send_reboot_request(node_id);
|
ap_uavcan->send_reboot_request(node_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if AP_DRONECAN_SEND_GPS
|
||||||
|
bool AP_GPS_UAVCAN::instance_exists(const AP_UAVCAN* ap_uavcan)
|
||||||
|
{
|
||||||
|
for (uint8_t i=0; i<ARRAY_SIZE(_detected_modules); i++) {
|
||||||
|
if (ap_uavcan == _detected_modules[i].ap_uavcan) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif // AP_DRONECAN_SEND_GPS
|
||||||
|
|
||||||
#endif // HAL_ENABLE_LIBUAVCAN_DRIVERS
|
#endif // HAL_ENABLE_LIBUAVCAN_DRIVERS
|
||||||
|
@ -71,6 +71,10 @@ public:
|
|||||||
void clear_RTCMV3() override;
|
void clear_RTCMV3() override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if AP_DRONECAN_SEND_GPS
|
||||||
|
static bool instance_exists(const AP_UAVCAN* ap_uavcan);
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool param_configured = true;
|
bool param_configured = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user