sdk/modules/lte/altcom/api/socket/altcom_select_async.c
/****************************************************************************
 * Name: altcom_select_async
 *
 * Description:
 *   altcom_select_async() is a function that operates select asynchronously.
 *   Notified by callback when one or more of the file descriptors become
 *   "ready" for some class of I/O operation (e.g., input possible). It will
 *   be notified until callback is called once or canceled
 *   by altcom_select_async_cancel().
 *
 * 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
 *   callback - Callback function that informs that one or more file
 *              descriptors are in the "ready" state
 *   priv - For use by caller
 *
 *  Return:
 *   A non-negative id on success; -1 on error with errno set
 *   appropriately.
 *
 ****************************************************************************/
altcom_select_async
Description:
altcom_select_async() is a function that operates select asynchronously.
Notified by callback when one or more of the file descriptors become
"ready" for some class of I/O operation . It will
be notified until callback is called once or canceled
by altcom_select_async_cancel().

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

A non-negative id on success; -1 on error with errno set
appropriately.
altcom_select_async Description : altcom_select_async () is a function that operates select asynchronously . Notified by callback when one or more of the file descriptors become " ready " for some class of I / O operation . It will be notified until callback is called once or canceled by altcom_select_async_cancel () . Input parameters : maxfdp1 - the maximum socket file descriptor number ( + 1 ) of any descriptor in any of the three sets . A non - negative id on success ; - 1 on error with errno set appropriately .
int altcom_select_async(int maxfdp1, altcom_fd_set *readset,
                        altcom_fd_set *writeset, altcom_fd_set *exceptset,
                        altcom_select_async_cb_t callback, void* priv)
{
  int32_t id;
  if (!callback)
    {
      altcom_seterrno(ALTCOM_EINVAL);
      return -1;
    }
  id = altcom_select_request_asyncsend(maxfdp1, readset, writeset, exceptset);
  if (id < 0)
    {
      return -1;
    }
  setup_callback(id, callback, priv);
  return id;
}
int altcom_select_async ( int maxfdp1 , altcom_fd_set * readset , altcom_fd_set * writeset , altcom_fd_set * exceptset , altcom_select_async_cb_t callback , void * priv ) { int32_t id ; if ( ! callback ) { altcom_seterrno ( ALTCOM_EINVAL ) ; return -1 ; } id = altcom_select_request_asyncsend ( maxfdp1 , readset , writeset , exceptset ) ; if ( id < 0 ) { return -1 ; } setup_callback ( id , callback , priv ) ; return id ; }
Name: altcom_select_async
 Description:
   altcom_select_async() is a function that operates select asynchronously.
Name : altcom_select_async Description : altcom_select_async () is a function that operates select asynchronously .