GCS_MAVLink: send KDECAN ESC telemetry

This commit is contained in:
Francisco Ferreira 2018-08-13 17:02:02 +01:00
parent f68f83505c
commit ee13110ad0
No known key found for this signature in database
GPG Key ID: F63C20A6773E787E
1 changed files with 22 additions and 0 deletions

View File

@ -3949,6 +3949,28 @@ bool GCS_MAVLINK::try_send_message(const enum ap_message id)
if (blheli) {
blheli->send_esc_telemetry_mavlink(uint8_t(chan));
}
#endif
#if HAL_WITH_UAVCAN
uint8_t num_drivers = AP::can().get_num_drivers();
for (uint8_t i = 0; i < num_drivers; i++) {
switch (AP::can().get_protocol_type(i)) {
case AP_BoardConfig_CAN::Protocol_Type_KDECAN: {
// To be replaced with macro saying if KDECAN library is included
#if APM_BUILD_TYPE(APM_BUILD_ArduCopter) || APM_BUILD_TYPE(APM_BUILD_ArduPlane) || APM_BUILD_TYPE(APM_BUILD_ArduSub)
AP_KDECAN *ap_kdecan = AP_KDECAN::get_kdecan(i);
if (ap_kdecan != nullptr) {
ap_kdecan->send_mavlink(uint8_t(chan));
}
break;
#endif
}
case AP_BoardConfig_CAN::Protocol_Type_UAVCAN:
case AP_BoardConfig_CAN::Protocol_Type_None:
default:
break;
}
}
#endif
break;
}