Home | History | Annotate | Download | only in libloc_api
      1 /******************************************************************************
      2   @file:  loc_eng_ioctl.h
      3   @brief:
      4 
      5   DESCRIPTION
      6     This file defines the data structure used by any location client that
      7     waits for the ioctl particular event to occur. Any one IOCTL can be pending
      8     at any time.
      9 
     10   INITIALIZATION AND SEQUENCING REQUIREMENTS
     11 
     12   -----------------------------------------------------------------------------
     13 Copyright (c) 2009, QUALCOMM USA, INC.
     14 
     15 All rights reserved.
     16 
     17 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
     18 
     19          Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
     20 
     21          Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
     22 
     23          Neither the name of the QUALCOMM USA, INC.  nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
     24 
     25 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     26   -----------------------------------------------------------------------------
     27 
     28 ******************************************************************************/
     29 
     30 /*=====================================================================
     31 $Header: $
     32 $DateTime: $
     33 $Author: $
     34 ======================================================================*/
     35 
     36 #ifndef LOC_ENG_IOCTL_H
     37 #define LOC_ENG_IOCTL_H
     38 
     39 // Module data
     40 typedef struct loc_eng_ioctl_data_s_type
     41 {
     42     // We are waiting for an ioctl callback
     43     boolean                       cb_is_selected;
     44     // The thread has been put in a wait state for an ioctl callback
     45     boolean                       cb_is_waiting;
     46     // Loc client handle that is waiting for the callback
     47     rpc_loc_client_handle_type    client_handle;
     48     // IOCTL type that the loc client is waiting for
     49     rpc_loc_ioctl_e_type          ioctl_type;
     50     // The IOCLT report has arrived for the waiting client
     51     boolean                       cb_has_arrived;
     52     // The payload for the RPC_LOC_EVENT_IOCTL_REPORT
     53     rpc_loc_ioctl_callback_s_type cb_payload;
     54     // Mutex to access this data structure
     55     pthread_mutex_t               cb_data_mutex;
     56     // LOC ioctl callback arrived mutex
     57     pthread_cond_t                cb_arrived_cond;
     58 } loc_eng_ioctl_data_s_type;
     59 
     60 
     61 extern boolean loc_eng_ioctl
     62 (
     63     rpc_loc_client_handle_type           handle,
     64     rpc_loc_ioctl_e_type                 ioctl_type,
     65     rpc_loc_ioctl_data_u_type*           ioctl_data_ptr,
     66     uint32                               timeout_msec,
     67     rpc_loc_ioctl_callback_s_type       *cb_data_ptr
     68 );
     69 
     70 extern boolean loc_eng_ioctl_process_cb
     71 (
     72     rpc_loc_client_handle_type           client_handle,
     73     const rpc_loc_ioctl_callback_s_type *cb_data_ptr
     74 );
     75 #endif // LOC_ENG_IOCTL_H
     76