StdPJ/Core/Src/APP/BSP/ug96/ug96.c
/**
  * @brief  Configure a PDP Access point.
  * @param  Obj: pointer to module handle
  * @param  ContextID : range is 1-20
  * @param  Apn : access point name
  * @param  Username : Got IP Address
  * @param  Password : Network IP mask
  * @param  AuthenticationMode : 0: none, 1: PAP
  * @retval Operation Status.
  */
@brief  Configure a PDP Access point.
@brief Configure a PDP Access point .
UG96_Return_t  UG96_ConfigureAP(Ug96Object_t *Obj,
                                UG96_APConfig_t *ApConfig)
{
  UG96_Return_t ret = UG96_RETURN_ERROR;
  snprintf(CmdString,UG96_CMD_SIZE,"AT+QICSGP=%d,1,\"%s\",\"%s\",\"%s\",%d\r\n", ApConfig->ContextID, ApConfig->ApnString, ApConfig->Username, ApConfig->Password, ApConfig->Authentication);
  ret = (UG96_Return_t) AT_ExecuteCommand(Obj, UG96_TOUT_SHORT, (uint8_t *)CmdString, RET_OK | RET_ERROR);
  if(ret == UG96_RETURN_OK)
  {
     Obj->APContextState[ApConfig->ContextID-1] = UG96_AP_CONFIGURED;
  }
  return ret;
}
UG96_Return_t UG96_ConfigureAP ( Ug96Object_t * Obj , UG96_APConfig_t * ApConfig ) { UG96_Return_t ret = UG96_RETURN_ERROR ; snprintf ( CmdString , UG96_CMD_SIZE , " \" \" \" \" \" \" \r \n " , ApConfig -> ContextID , ApConfig -> ApnString , ApConfig -> Username , ApConfig -> Password , ApConfig -> Authentication ) ; ret = ( UG96_Return_t ) AT_ExecuteCommand ( Obj , UG96_TOUT_SHORT , ( uint8_t * ) CmdString , RET_OK | RET_ERROR ) ; if ( ret == UG96_RETURN_OK ) { Obj -> APContextState [ ApConfig -> ContextID - 1 ] = UG96_AP_CONFIGURED ; } return ret ; }
@brief  Configure a PDP Access point.
@brief Configure a PDP Access point .