location/loc_api/loc_api_v02/LocApiV02.cpp
LocationError
LocApiV02::setAGLONASSProtocolSync(GnssConfigAGlonassPositionProtocolMask aGlonassProtocol)
{
  LocationError err = LOCATION_ERROR_SUCCESS;
  locClientStatusEnumType result = eLOC_CLIENT_SUCCESS;
  locClientReqUnionType req_union;
  qmiLocSetProtocolConfigParametersReqMsgT_v02 aGlonassProtocol_req;
  qmiLocSetProtocolConfigParametersIndMsgT_v02 aGlonassProtocol_ind;

  memset(&aGlonassProtocol_req, 0, sizeof(aGlonassProtocol_req));
  memset(&aGlonassProtocol_ind, 0, sizeof(aGlonassProtocol_ind));

  aGlonassProtocol_req.assistedGlonassProtocolMask_valid = 1;
  if (GNSS_CONFIG_RRC_CONTROL_PLANE_BIT & aGlonassProtocol) {
      aGlonassProtocol_req.assistedGlonassProtocolMask |=
          QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP_V02 ;
  }
  if (GNSS_CONFIG_RRLP_USER_PLANE_BIT & aGlonassProtocol) {
      aGlonassProtocol_req.assistedGlonassProtocolMask |=
          QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP_V02;
  }
  if (GNSS_CONFIG_LLP_USER_PLANE_BIT & aGlonassProtocol) {
      aGlonassProtocol_req.assistedGlonassProtocolMask |=
          QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP_V02;
  }
  if (GNSS_CONFIG_LLP_CONTROL_PLANE_BIT & aGlonassProtocol) {
      aGlonassProtocol_req.assistedGlonassProtocolMask |=
          QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_CP_V02;
  }

  req_union.pSetProtocolConfigParametersReq = &aGlonassProtocol_req;

  LOC_LOGD("%s:%d]: aGlonassProtocolMask = 0x%x",  __func__, __LINE__,
                             aGlonassProtocol_req.assistedGlonassProtocolMask);

  result = locSyncSendReq(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02,
                          req_union, LOC_ENGINE_SYNC_REQUEST_LONG_TIMEOUT,
                          QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02,
                          &aGlonassProtocol_ind);

  if(result != eLOC_CLIENT_SUCCESS ||
     eQMI_LOC_SUCCESS_V02 != aGlonassProtocol_ind.status)
  {
    LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ",
              __func__, __LINE__,
              loc_get_v02_client_status_name(result),
              loc_get_v02_qmi_status_name(aGlonassProtocol_ind.status));
    err = LOCATION_ERROR_GENERAL_FAILURE;
  }

  return err;
}
/* set the Positioning Protocol on A-GLONASS system */
set the Positioning Protocol on A-GLONASS system
set the Positioning Protocol on A - GLONASS system
LocationError
LocApiV02::setAGLONASSProtocolSync(GnssConfigAGlonassPositionProtocolMask aGlonassProtocol)
{
  LocationError err = LOCATION_ERROR_SUCCESS;
  locClientStatusEnumType result = eLOC_CLIENT_SUCCESS;
  locClientReqUnionType req_union;
  qmiLocSetProtocolConfigParametersReqMsgT_v02 aGlonassProtocol_req;
  qmiLocSetProtocolConfigParametersIndMsgT_v02 aGlonassProtocol_ind;
  memset(&aGlonassProtocol_req, 0, sizeof(aGlonassProtocol_req));
  memset(&aGlonassProtocol_ind, 0, sizeof(aGlonassProtocol_ind));
  aGlonassProtocol_req.assistedGlonassProtocolMask_valid = 1;
  if (GNSS_CONFIG_RRC_CONTROL_PLANE_BIT & aGlonassProtocol) {
      aGlonassProtocol_req.assistedGlonassProtocolMask |=
          QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP_V02 ;
  }
  if (GNSS_CONFIG_RRLP_USER_PLANE_BIT & aGlonassProtocol) {
      aGlonassProtocol_req.assistedGlonassProtocolMask |=
          QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP_V02;
  }
  if (GNSS_CONFIG_LLP_USER_PLANE_BIT & aGlonassProtocol) {
      aGlonassProtocol_req.assistedGlonassProtocolMask |=
          QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP_V02;
  }
  if (GNSS_CONFIG_LLP_CONTROL_PLANE_BIT & aGlonassProtocol) {
      aGlonassProtocol_req.assistedGlonassProtocolMask |=
          QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_CP_V02;
  }
  req_union.pSetProtocolConfigParametersReq = &aGlonassProtocol_req;
  LOC_LOGD("%s:%d]: aGlonassProtocolMask = 0x%x",  __func__, __LINE__,
                             aGlonassProtocol_req.assistedGlonassProtocolMask);
  result = locSyncSendReq(QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02,
                          req_union, LOC_ENGINE_SYNC_REQUEST_LONG_TIMEOUT,
                          QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02,
                          &aGlonassProtocol_ind);
  if(result != eLOC_CLIENT_SUCCESS ||
     eQMI_LOC_SUCCESS_V02 != aGlonassProtocol_ind.status)
  {
    LOC_LOGE ("%s:%d]: Error status = %s, ind..status = %s ",
              __func__, __LINE__,
              loc_get_v02_client_status_name(result),
              loc_get_v02_qmi_status_name(aGlonassProtocol_ind.status));
    err = LOCATION_ERROR_GENERAL_FAILURE;
  }
  return err;
}
LocationError LocApiV02 :: setAGLONASSProtocolSync ( GnssConfigAGlonassPositionProtocolMask aGlonassProtocol ) { LocationError err = LOCATION_ERROR_SUCCESS ; locClientStatusEnumType result = eLOC_CLIENT_SUCCESS ; locClientReqUnionType req_union ; qmiLocSetProtocolConfigParametersReqMsgT_v02 aGlonassProtocol_req ; qmiLocSetProtocolConfigParametersIndMsgT_v02 aGlonassProtocol_ind ; memset ( & aGlonassProtocol_req , 0 , sizeof ( aGlonassProtocol_req ) ) ; memset ( & aGlonassProtocol_ind , 0 , sizeof ( aGlonassProtocol_ind ) ) ; aGlonassProtocol_req . assistedGlonassProtocolMask_valid = 1 ; if ( GNSS_CONFIG_RRC_CONTROL_PLANE_BIT & aGlonassProtocol ) { aGlonassProtocol_req . assistedGlonassProtocolMask |= QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRC_CP_V02 ; } if ( GNSS_CONFIG_RRLP_USER_PLANE_BIT & aGlonassProtocol ) { aGlonassProtocol_req . assistedGlonassProtocolMask |= QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_RRLP_UP_V02 ; } if ( GNSS_CONFIG_LLP_USER_PLANE_BIT & aGlonassProtocol ) { aGlonassProtocol_req . assistedGlonassProtocolMask |= QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_UP_V02 ; } if ( GNSS_CONFIG_LLP_CONTROL_PLANE_BIT & aGlonassProtocol ) { aGlonassProtocol_req . assistedGlonassProtocolMask |= QMI_LOC_ASSISTED_GLONASS_PROTOCOL_MASK_LPP_CP_V02 ; } req_union . pSetProtocolConfigParametersReq = & aGlonassProtocol_req ; LOC_LOGD ( " " , __func__ , __LINE__ , aGlonassProtocol_req . assistedGlonassProtocolMask ) ; result = locSyncSendReq ( QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_REQ_V02 , req_union , LOC_ENGINE_SYNC_REQUEST_LONG_TIMEOUT , QMI_LOC_SET_PROTOCOL_CONFIG_PARAMETERS_IND_V02 , & aGlonassProtocol_ind ) ; if ( result != eLOC_CLIENT_SUCCESS || eQMI_LOC_SUCCESS_V02 != aGlonassProtocol_ind . status ) { LOC_LOGE ( " " , __func__ , __LINE__ , loc_get_v02_client_status_name ( result ) , loc_get_v02_qmi_status_name ( aGlonassProtocol_ind . status ) ) ; err = LOCATION_ERROR_GENERAL_FAILURE ; } return err ; }
set the Positioning Protocol on A-GLONASS system
set the Positioning Protocol on A - GLONASS system