StdPJ/Core/Src/Common/Shared/iot_flash_config.c
/**
  * @brief  Check whether the Wifi parameters are present in Flash memory.
  *         Returns the parameters if present.
  * @param  Out:  ssid              Wifi SSID.
  * @param  Out:  psk               Wifi security password.
  * @param  Out:  security_mode     See @ref wifi_network_security_t definition.
  * @retval   0 if the parameters are present in Flash.
  *          -1 if the parameters are not present in Flash.
  */
@brief  Check whether the Wifi parameters are present in Flash memory.
Returns the parameters if present.
@param  Out:  ssid              Wifi SSID.
@param  Out:  psk               Wifi security password.
@param  Out:  security_mode     See @ref wifi_network_security_t definition.
@retval   0 if the parameters are present in Flash.
-1 if the parameters are not present in Flash.
@brief Check whether the Wifi parameters are present in Flash memory . Returns the parameters if present . @param Out : ssid Wifi SSID . @param Out : psk Wifi security password . @param Out : security_mode See @ref wifi_network_security_t definition . @retval 0 if the parameters are present in Flash . - 1 if the parameters are not present in Flash .
int checkWiFiCredentials(const char ** const ssid, const char ** const psk, uint8_t * const security_mode)
{
  bool is_ssid_present = 0;
  if (lUserConfigPtr->wifi_config.magic == USER_CONF_MAGIC)
  {
    is_ssid_present = true;
    if ((ssid == NULL) ||(psk == NULL) || (security_mode == NULL))
    {
      return -2;
    }
    *ssid = lUserConfigPtr->wifi_config.ssid;
    *psk = lUserConfigPtr->wifi_config.psk;
    *security_mode = lUserConfigPtr->wifi_config.security_mode;
  }
  return (is_ssid_present) ? 0 : -1;
}
int checkWiFiCredentials ( const char * * const ssid , const char * * const psk , uint8_t * const security_mode ) { bool is_ssid_present = 0 ; if ( lUserConfigPtr -> wifi_config . magic == USER_CONF_MAGIC ) { is_ssid_present = true ; if ( ( ssid == NULL ) || ( psk == NULL ) || ( security_mode == NULL ) ) { return -2 ; } * ssid = lUserConfigPtr -> wifi_config . ssid ; * psk = lUserConfigPtr -> wifi_config . psk ; * security_mode = lUserConfigPtr -> wifi_config . security_mode ; } return ( is_ssid_present ) ? 0 : -1 ; }
@brief  Check whether the Wifi parameters are present in Flash memory.
@brief Check whether the Wifi parameters are present in Flash memory .