net: openthread: Check if ed_scan API is implemented before use

Verify that `ed_scan` is implemented by the radio driver before use. In
case it's not, return appropriate error code to OpenThread.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
Robert Lubos 2020-04-01 11:50:08 +02:00 committed by Jukka Rissanen
commit 94490d3f19

View file

@ -417,6 +417,10 @@ otError otPlatRadioEnergyScan(otInstance *aInstance, u8_t aScanChannel,
energy_detection_time = aScanDuration;
energy_detection_channel = aScanChannel;
if (radio_api->ed_scan == NULL) {
return OT_ERROR_NOT_IMPLEMENTED;
}
clear_pending_events();
radio_api->set_channel(radio_dev, aScanChannel);