location/loc_api/loc_api_v02/LocApiV02.cpp
void LocApiV02 ::
    setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty)
{
  sendMsg(new LocApiMsg([this, time, timeReference, uncertainty] () {

  locClientReqUnionType req_union;
  locClientStatusEnumType status;
  qmiLocInjectUtcTimeReqMsgT_v02  inject_time_msg;
  qmiLocInjectUtcTimeIndMsgT_v02 inject_time_ind;

  memset(&inject_time_msg, 0, sizeof(inject_time_msg));

  inject_time_ind.status = eQMI_LOC_GENERAL_FAILURE_V02;

  inject_time_msg.timeUtc = time;

  inject_time_msg.timeUtc += (int64_t)(elapsedRealtime() - timeReference);

  inject_time_msg.timeUnc = uncertainty;

  req_union.pInjectUtcTimeReq = &inject_time_msg;

  LOC_LOGV ("%s:%d]: uncertainty = %d\n", __func__, __LINE__,
                 uncertainty);

  status = locSyncSendReq(QMI_LOC_INJECT_UTC_TIME_REQ_V02,
                          req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT,
                          QMI_LOC_INJECT_UTC_TIME_IND_V02,
                          &inject_time_ind);

  if (status != eLOC_CLIENT_SUCCESS ||
      eQMI_LOC_SUCCESS_V02 != inject_time_ind.status)
  {
    LOC_LOGE ("%s:%d] status = %s, ind..status = %s\n", __func__,  __LINE__,
              loc_get_v02_client_status_name(status),
              loc_get_v02_qmi_status_name(inject_time_ind.status));
  }

  }));
}
/* inject time into the position engine */
inject time into the position engine
inject time into the position engine
void LocApiV02 ::
    setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty)
{
  sendMsg(new LocApiMsg([this, time, timeReference, uncertainty] () {
  locClientReqUnionType req_union;
  locClientStatusEnumType status;
  qmiLocInjectUtcTimeReqMsgT_v02  inject_time_msg;
  qmiLocInjectUtcTimeIndMsgT_v02 inject_time_ind;
  memset(&inject_time_msg, 0, sizeof(inject_time_msg));
  inject_time_ind.status = eQMI_LOC_GENERAL_FAILURE_V02;
  inject_time_msg.timeUtc = time;
  inject_time_msg.timeUtc += (int64_t)(elapsedRealtime() - timeReference);
  inject_time_msg.timeUnc = uncertainty;
  req_union.pInjectUtcTimeReq = &inject_time_msg;
  LOC_LOGV ("%s:%d]: uncertainty = %d\n", __func__, __LINE__,
                 uncertainty);
  status = locSyncSendReq(QMI_LOC_INJECT_UTC_TIME_REQ_V02,
                          req_union, LOC_ENGINE_SYNC_REQUEST_TIMEOUT,
                          QMI_LOC_INJECT_UTC_TIME_IND_V02,
                          &inject_time_ind);
  if (status != eLOC_CLIENT_SUCCESS ||
      eQMI_LOC_SUCCESS_V02 != inject_time_ind.status)
  {
    LOC_LOGE ("%s:%d] status = %s, ind..status = %s\n", __func__,  __LINE__,
              loc_get_v02_client_status_name(status),
              loc_get_v02_qmi_status_name(inject_time_ind.status));
  }
  }));
}
void LocApiV02 :: setTime ( LocGpsUtcTime time , int64_t timeReference , int uncertainty ) { sendMsg ( new LocApiMsg ( [ this , time , timeReference , uncertainty ] ( ) { locClientReqUnionType req_union ; locClientStatusEnumType status ; qmiLocInjectUtcTimeReqMsgT_v02 inject_time_msg ; qmiLocInjectUtcTimeIndMsgT_v02 inject_time_ind ; memset ( & inject_time_msg , 0 , sizeof ( inject_time_msg ) ) ; inject_time_ind . status = eQMI_LOC_GENERAL_FAILURE_V02 ; inject_time_msg . timeUtc = time ; inject_time_msg . timeUtc += ( int64_t ) ( elapsedRealtime ( ) - timeReference ) ; inject_time_msg . timeUnc = uncertainty ; req_union . pInjectUtcTimeReq = & inject_time_msg ; LOC_LOGV ( " \n " , __func__ , __LINE__ , uncertainty ) ; status = locSyncSendReq ( QMI_LOC_INJECT_UTC_TIME_REQ_V02 , req_union , LOC_ENGINE_SYNC_REQUEST_TIMEOUT , QMI_LOC_INJECT_UTC_TIME_IND_V02 , & inject_time_ind ) ; if ( status != eLOC_CLIENT_SUCCESS || eQMI_LOC_SUCCESS_V02 != inject_time_ind . status ) { LOC_LOGE ( " \n " , __func__ , __LINE__ , loc_get_v02_client_status_name ( status ) , loc_get_v02_qmi_status_name ( inject_time_ind . status ) ) ; } } ) ) ; }
inject time into the position engine
inject time into the position engine