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:
parent
111313581d
commit
94490d3f19
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue