Skip to content

Commit

Permalink
Fix implementation for Azure RTOS
Browse files Browse the repository at this point in the history
  • Loading branch information
josesimoes committed Nov 15, 2022
1 parent c0f77ce commit afd617b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions targets/AzureRTOS/_common/target_network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ bool Network_Interface_Close(int index)
return false;
}

bool Network_Interface_Start_Scan(int index)
int Network_Interface_Start_Scan(int index)
{
HAL_Configuration_NetworkInterface networkConfiguration;

Expand All @@ -121,18 +121,21 @@ bool Network_Interface_Start_Scan(int index)
DeviceConfigurationOption_Network,
index))
{
// failed to load configuration
// FIXME output error?
return SOCK_SOCKET_ERROR;
// failed to get configuration
// TODO include error code enum
return 7777; // StartScanOutcome_FailedToGetConfiguration;
}

// can only do this is this is STA
if (networkConfiguration.InterfaceType == NetworkInterfaceType_Wireless80211)
if (networkConfiguration.InterfaceType != NetworkInterfaceType_Wireless80211)
{
// return (NF_ESP32_Wireless_Scan() == 0);
// TODO include error code enum
return 8888; // StartScanOutcome_WrongInterfaceType;
}

return false;
// TODO return NF_ESP32_Wireless_Scan();
// TODO include error code enum
return 9999;
}

bool GetWirelessConfig(int index, HAL_Configuration_Wireless80211 **wirelessConfig)
Expand Down

0 comments on commit afd617b

Please sign in to comment.