void RNrhSession::TransmitPosition(const TDesC& aDestinationId, TUint aTransmitPriority, TRequestStatus& aStatus, TPositionInfo& aTransmittedPosInfo) { // iDestinationId is too big to fit in the buffer; // complete the request early with an error code if (aDestinationId.Length() > iTransmitPositionParams.iDestinationId.MaxLength()) { TRequestStatus* status = &aStatus; User::RequestComplete(status, KErrTooBig); } iTransmitPositionParams.iDestinationId = aDestinationId; iTransmitPositionParams.iPriority = aTransmitPriority; iTransmitPositionParams.iPositionInfoClassType = aTransmittedPosInfo.PositionClassType(); iTransmitPositionParams.iPositionInfoClassSize = aTransmittedPosInfo.PositionClassSize(); iTransmitPositionParamsPtr.Set(reinterpret_cast<TUint8*>(&iTransmitPositionParams), sizeof(iTransmitPositionParams), sizeof(iTransmitPositionParams)); iTransmittedPosInfoPtr.Set(reinterpret_cast<TUint8*>(&aTransmittedPosInfo), aTransmittedPosInfo.PositionClassSize(), aTransmittedPosInfo.PositionClassSize()); TIpcArgs args(&iTransmitPositionParamsPtr, &iTransmittedPosInfoPtr); SendReceive(EX3pTransmitPosition, args, aStatus); }
void RNrhSession::ReportReferenceLocation(TRequestStatus& aRefPosStatus, TPositionInfo& aReferencePosInfo) { iReferencePositionParams.iPositionInfoClassType = aReferencePosInfo.PositionClassType(); iReferencePositionParams.iPositionInfoClassSize = aReferencePosInfo.PositionClassSize(); iReferencePositionParamsPtr.Set(reinterpret_cast<TUint8*>(&iReferencePositionParams), sizeof(iReferencePositionParams), sizeof(iReferencePositionParams)); iReferencePosInfoPtr.Set(reinterpret_cast<TUint8*>(&aReferencePosInfo), aReferencePosInfo.PositionClassSize(), aReferencePosInfo.PositionClassSize()); TIpcArgs args(&iReferencePositionParamsPtr, &iReferencePosInfoPtr); SendReceive(EX3pReportReferenceLocation , args, aRefPosStatus); }
EXPORT_C void MTe_LbsPsyStaticData::PrintPosInfo(const TPositionInfo& aPosInfo) const { _LIT(KTimeFormat, "%H:%T:%S.%C"); TBuf<100> cTimeStr; INFO_PRINTF2(_L("classSize=%d"), aPosInfo.PositionClassSize()); INFO_PRINTF2(_L("classType=0x%x"), aPosInfo.PositionClassType()); INFO_PRINTF2(_L("moduleId=0x%x"), aPosInfo.ModuleId()); INFO_PRINTF2(_L("updateType=%d"), aPosInfo.UpdateType()); INFO_PRINTF2(_L("positionMode=%d"), aPosInfo.PositionMode()); INFO_PRINTF2(_L("positionModeReason=%d"), aPosInfo.PositionModeReason()); TPosition pos; aPosInfo.GetPosition(pos); INFO_PRINTF2(_L("pos altitude=%f"), pos.Altitude()); INFO_PRINTF2(_L("pos latitude=%f"), pos.Latitude()); INFO_PRINTF2(_L("pos longitude=%f"), pos.Longitude()); INFO_PRINTF2(_L("pos datum=0x%x"), pos.Datum()); INFO_PRINTF2(_L("pos horAccuracy=%f"), pos.HorizontalAccuracy()); INFO_PRINTF2(_L("pos verAccuracy=%f"), pos.VerticalAccuracy()); TRAP_IGNORE(pos.Time().FormatL(cTimeStr, KTimeFormat);)