sdk/modules/lte/altcom/api/socket/altcom_select.c
/****************************************************************************
 * Name: altcom_select_nonblock
 *
 * Description:
 *   altcom_select_nonblock() is the same as altcom_select(),
 *   but set command parameter to nonblock.
 *
 * Input parameters:
 *   maxfdp1 - the maximum socket file descriptor number (+1) of any
 *             descriptor in any of the three sets.
 *   readset - the set of descriptions to monitor for read-ready events
 *   writeset - the set of descriptions to monitor for write-ready events
 *   exceptset - the set of descriptions to monitor for error events
 *
 *  Return:
 *   0: All descriptors in the three sets are not ready
 *  >0: The number of bits set in the three sets of descriptors
 *  -1: An error occurred (errno will be set appropriately)
 *
 ****************************************************************************/
altcom_select_nonblock
Description:
altcom_select_nonblock() is the same as altcom_select(),
but set command parameter to nonblock.

Input parameters:
maxfdp1 - the maximum socket file descriptor number (+1) of any
descriptor in any of the three sets.

All descriptors in the three sets are not ready
>0: The number of bits set in the three sets of descriptors
-1: An error occurred (errno will be set appropriately)
altcom_select_nonblock Description : altcom_select_nonblock () is the same as altcom_select () but set command parameter to nonblock . Input parameters : maxfdp1 - the maximum socket file descriptor number ( + 1 ) of any descriptor in any of the three sets . All descriptors in the three sets are not ready > 0 : The number of bits set in the three sets of descriptors - 1 : An error occurred ( errno will be set appropriately )
int altcom_select_nonblock(int maxfdp1, altcom_fd_set *readset,
                           altcom_fd_set *writeset,
                           altcom_fd_set *exceptset)
{
  int32_t             result;
  struct select_req_s req;
  if (!altcom_isinit())
    {
      DBGIF_LOG_ERROR("Not intialized\n");
      altcom_seterrno(ALTCOM_ENETDOWN);
      return -1;
    }
  req.select_id = SELECT_ID_GEN_AUTO;
  req.maxfdp1   = maxfdp1;
  req.request   = APICMD_SELECT_REQUEST_NONBLOCK;
  req.readset   = readset;
  req.writeset  = writeset;
  req.exceptset = exceptset;
  req.timeout   = SYS_TIMEO_FEVR;
  result = select_request(&req);
  if (result == SELECT_REQ_FAILURE)
    {
      return -1;
    }
  return result;
}
int altcom_select_nonblock ( int maxfdp1 , altcom_fd_set * readset , altcom_fd_set * writeset , altcom_fd_set * exceptset ) { int32_t result ; struct select_req_s req ; if ( ! altcom_isinit ( ) ) { DBGIF_LOG_ERROR ( " \n " ) ; altcom_seterrno ( ALTCOM_ENETDOWN ) ; return -1 ; } req . select_id = SELECT_ID_GEN_AUTO ; req . maxfdp1 = maxfdp1 ; req . request = APICMD_SELECT_REQUEST_NONBLOCK ; req . readset = readset ; req . writeset = writeset ; req . exceptset = exceptset ; req . timeout = SYS_TIMEO_FEVR ; result = select_request ( & req ) ; if ( result == SELECT_REQ_FAILURE ) { return -1 ; } return result ; }
Name: altcom_select_nonblock
 Description:
   altcom_select_nonblock() is the same as altcom_select(),
   but set command parameter to nonblock.
Name : altcom_select_nonblock Description : altcom_select_nonblock () is the same as altcom_select () but set command parameter to nonblock .