location/loc_api/loc_api_v02/LocApiV02.cpp
int LocApiV02 :: getGpsLock(uint8_t subType)
{
    qmiLocGetEngineLockReqMsgT_v02 getEngineLockReq;
    qmiLocGetEngineLockIndMsgT_v02 getEngineLockInd;
    locClientStatusEnumType status;
    locClientReqUnionType req_union;
    int ret=0;
    memset(&getEngineLockInd, 0, sizeof(getEngineLockInd));

    //Passing req_union as a parameter even though this request has no payload
    //since NULL or 0 gives an error during compilation
    getEngineLockReq.subType_valid = true;
    getEngineLockReq.subType = (qmiLocLockSubInfoEnumT_v02)subType;
    req_union.pGetEngineLockReq = &getEngineLockReq;
    status = locSyncSendReq(QMI_LOC_GET_ENGINE_LOCK_REQ_V02,
                            req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT,
                            QMI_LOC_GET_ENGINE_LOCK_IND_V02,
                            &getEngineLockInd);
    if(status != eLOC_CLIENT_SUCCESS || getEngineLockInd.status != eQMI_LOC_SUCCESS_V02) {
        LOC_LOGE("%s:%d]: Set engine lock failed. status: %s, ind status:%s\n",
                 __func__, __LINE__,
                 loc_get_v02_client_status_name(status),
                 loc_get_v02_qmi_status_name(getEngineLockInd.status));
        ret = -1;
    }
    else {
        if(getEngineLockInd.lockType_valid) {
            ret = (int)convertGpsLockFromQMItoAPI(getEngineLockInd.lockType);
        }
        else {
            LOC_LOGE("%s:%d]: Lock Type not valid\n", __func__, __LINE__);
            ret = -1;
        }
    }
    return ret;
}
/*
  Returns
  Current value of GPS Lock on success
  -1 on failure
*/
Returns
Current value of GPS Lock on success
1 on failure
Returns Current value of GPS Lock on success 1 on failure
int LocApiV02 :: getGpsLock(uint8_t subType)
{
    qmiLocGetEngineLockReqMsgT_v02 getEngineLockReq;
    qmiLocGetEngineLockIndMsgT_v02 getEngineLockInd;
    locClientStatusEnumType status;
    locClientReqUnionType req_union;
    int ret=0;
    memset(&getEngineLockInd, 0, sizeof(getEngineLockInd));
    getEngineLockReq.subType_valid = true;
    getEngineLockReq.subType = (qmiLocLockSubInfoEnumT_v02)subType;
    req_union.pGetEngineLockReq = &getEngineLockReq;
    status = locSyncSendReq(QMI_LOC_GET_ENGINE_LOCK_REQ_V02,
                            req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT,
                            QMI_LOC_GET_ENGINE_LOCK_IND_V02,
                            &getEngineLockInd);
    if(status != eLOC_CLIENT_SUCCESS || getEngineLockInd.status != eQMI_LOC_SUCCESS_V02) {
        LOC_LOGE("%s:%d]: Set engine lock failed. status: %s, ind status:%s\n",
                 __func__, __LINE__,
                 loc_get_v02_client_status_name(status),
                 loc_get_v02_qmi_status_name(getEngineLockInd.status));
        ret = -1;
    }
    else {
        if(getEngineLockInd.lockType_valid) {
            ret = (int)convertGpsLockFromQMItoAPI(getEngineLockInd.lockType);
        }
        else {
            LOC_LOGE("%s:%d]: Lock Type not valid\n", __func__, __LINE__);
            ret = -1;
        }
    }
    return ret;
}
int LocApiV02 :: getGpsLock ( uint8_t subType ) { qmiLocGetEngineLockReqMsgT_v02 getEngineLockReq ; qmiLocGetEngineLockIndMsgT_v02 getEngineLockInd ; locClientStatusEnumType status ; locClientReqUnionType req_union ; int ret = 0 ; memset ( & getEngineLockInd , 0 , sizeof ( getEngineLockInd ) ) ; getEngineLockReq . subType_valid = true ; getEngineLockReq . subType = ( qmiLocLockSubInfoEnumT_v02 ) subType ; req_union . pGetEngineLockReq = & getEngineLockReq ; status = locSyncSendReq ( QMI_LOC_GET_ENGINE_LOCK_REQ_V02 , req_union , LOC_ENGINE_SYNC_REQUEST_TIMEOUT , QMI_LOC_GET_ENGINE_LOCK_IND_V02 , & getEngineLockInd ) ; if ( status != eLOC_CLIENT_SUCCESS || getEngineLockInd . status != eQMI_LOC_SUCCESS_V02 ) { LOC_LOGE ( " \n " , __func__ , __LINE__ , loc_get_v02_client_status_name ( status ) , loc_get_v02_qmi_status_name ( getEngineLockInd . status ) ) ; ret = -1 ; } else { if ( getEngineLockInd . lockType_valid ) { ret = ( int ) convertGpsLockFromQMItoAPI ( getEngineLockInd . lockType ) ; } else { LOC_LOGE ( " \n " , __func__ , __LINE__ ) ; ret = -1 ; } } return ret ; }
Returns
Current value of GPS Lock on success
1 on failure
Returns Current value of GPS Lock on success 1 on failure
//Passing req_union as a parameter even though this request has no payload //since NULL or 0 gives an error during compilation