1 /* |
1 /* |
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
1737 TFLOGSTRING2("TSY: CMmStaticUtility::UiccCSCauseToEpocError, UICC Error value: %d", aIsiCauseValue ); |
1737 TFLOGSTRING2("TSY: CMmStaticUtility::UiccCSCauseToEpocError, UICC Error value: %d", aIsiCauseValue ); |
1738 OstTraceExt1( TRACE_NORMAL, DUP12_CMMSTATICUTILITY_UICCCSCAUSETOEPOCERROR, "CMmStaticUtility::UiccCSCauseToEpocError;UICC Error value:aIsiCauseValue=%hhu", aIsiCauseValue ); |
1738 OstTraceExt1( TRACE_NORMAL, DUP12_CMMSTATICUTILITY_UICCCSCAUSETOEPOCERROR, "CMmStaticUtility::UiccCSCauseToEpocError;UICC Error value:aIsiCauseValue=%hhu", aIsiCauseValue ); |
1739 |
1739 |
1740 return epocError; |
1740 return epocError; |
1741 } |
1741 } |
|
1742 |
1742 // ----------------------------------------------------------------------------- |
1743 // ----------------------------------------------------------------------------- |
1743 // CMmStaticUtility::PacketDataCSCauseToEpocError |
1744 // CMmStaticUtility::PacketDataCSCauseToEpocError |
1744 // Converts Packet Data CS cause to EPOC error value |
1745 // Converts Packet Data CS cause to EPOC error value |
1745 // (other items were commented in a header). |
1746 // (other items were commented in a header). |
1746 // ----------------------------------------------------------------------------- |
1747 // ----------------------------------------------------------------------------- |
2169 EHex ); |
2170 EHex ); |
2170 } |
2171 } |
2171 // no else |
2172 // no else |
2172 } |
2173 } |
2173 |
2174 |
|
2175 // ----------------------------------------------------------------------------- |
|
2176 // CMmStaticUtility::ConvertIPAddressFromClient |
|
2177 // Converts IP address string from client into GPDS suitable format |
|
2178 // (other items were commented in a header). |
|
2179 // ----------------------------------------------------------------------------- |
|
2180 // |
|
2181 TInt CMmStaticUtility::ConvertIPAddressFromClient |
|
2182 ( |
|
2183 const TDesC8& aClientAddr, |
|
2184 TDes8& aGpdsAddr |
|
2185 ) |
|
2186 { |
|
2187 TFLOGSTRING("TSY: CMmStaticUtility::ConvertIPAddressFromClient"); |
|
2188 OstTrace0( TRACE_NORMAL, CMMSTATICUTILITY_CONVERTIPADDRESSFROMCLIENT, "CMmStaticUtility::ConvertIPAddressFromClient" ); |
|
2189 TInt ret(KErrNone); |
|
2190 |
|
2191 TBuf<RPacketContext::KMaxPDPAddressLength> tmpClientAddress; |
|
2192 tmpClientAddress.Copy(aClientAddr); |
|
2193 TInetAddr inetAddr; |
|
2194 ret = inetAddr.Input(tmpClientAddress); |
|
2195 |
|
2196 if ( KErrNone == ret ) |
|
2197 { |
|
2198 if ( KAfInet == inetAddr.Family() ) |
|
2199 { |
|
2200 TUint32 ipV4Address = inetAddr.Address(); |
|
2201 TPtrC8 ptrIpV4Address( (TUint8*)&ipV4Address, KIpv4AddressLen ); |
|
2202 aGpdsAddr.SetLength( KIpv4AddressLen ); |
|
2203 // reverse copy IP address bytes to get correct endianness |
|
2204 for ( TInt i=0; i<KIpv4AddressLen; i++) |
|
2205 { |
|
2206 aGpdsAddr[i] = ptrIpV4Address[KIpv4AddressLen - i - 1]; |
|
2207 } |
|
2208 } |
|
2209 else if ( KAfInet6 == inetAddr.Family() ) |
|
2210 { |
|
2211 TPtrC8 ptrIpV6Address( |
|
2212 inetAddr.Ip6Address().u.iAddr8, |
|
2213 KIpv6AddressLen ); |
|
2214 aGpdsAddr.Copy( ptrIpV6Address ); |
|
2215 } |
|
2216 else |
|
2217 { |
|
2218 TFLOGSTRING2("TSY: CMmStaticUtility::ConvertIPAddressFromClient; not supported family(%d)", inetAddr.Family()); |
|
2219 OstTrace1( TRACE_NORMAL, DUP2_CMMSTATICUTILITY_CONVERTIPADDRESSFROMCLIENT, "CMmStaticUtility::ConvertIPAddressFromClient; not supported family(%d)", inetAddr.Family() ); |
|
2220 ret = KErrNotSupported; |
|
2221 } |
|
2222 } |
|
2223 else |
|
2224 { |
|
2225 TFLOGSTRING("TSY: CMmStaticUtility::ConvertIPAddressFromClient; TInetAddr::Input failed"); |
|
2226 OstTrace0( TRACE_NORMAL, DUP1_CMMSTATICUTILITY_CONVERTIPADDRESSFROMCLIENT, "CMmStaticUtility::ConvertIPAddressFromClient; TInetAddr::Input failed" ); |
|
2227 } |
|
2228 |
|
2229 return ret; |
|
2230 } |
2174 |
2231 |
2175 // ----------------------------------------------------------------------------- |
2232 // ----------------------------------------------------------------------------- |
2176 // CMmStaticUtility::GetIntFromDescriptor |
2233 // CMmStaticUtility::GetIntFromDescriptor |
2177 // Converts number string to integer |
2234 // Converts number string to integer |
2178 // (other items were commented in a header). |
2235 // (other items were commented in a header). |
3445 |
3502 |
3446 return ret; |
3503 return ret; |
3447 } |
3504 } |
3448 |
3505 |
3449 |
3506 |
|
3507 // ----------------------------------------------------------------------------- |
|
3508 // CMmStaticUtility::ConvertUcs2To7BitCodedData |
|
3509 // Convert data to 7 bit GSM format. |
|
3510 // ----------------------------------------------------------------------------- |
|
3511 // |
|
3512 void CMmStaticUtility::ConvertUcs2To7BitCodedData( |
|
3513 TDesC16& aInputString, |
|
3514 TDes8& aGsmDataString ) |
|
3515 { |
|
3516 TFLOGSTRING("TSY: CMmStaticUtility::ConvertUcs2To7BitCodedData"); |
|
3517 OstTrace0( TRACE_NORMAL, CMMSTATICUTILITY_CONVERTUCS2TO7BITCODEDDATA, "CMmStaticUtility::ConvertUcs2To7BitCodedData" ); |
|
3518 |
|
3519 if ( 0 < aInputString.Length() ) |
|
3520 { |
|
3521 // Store string in GSM default coding scheme |
|
3522 for( TInt count = 0; count < aInputString.Length(); count++) |
|
3523 { |
|
3524 // get the GSM defalut Character for UCS character |
|
3525 TUint8 gsmChar = GetGsmForUnicode( aInputString[count] ); |
|
3526 if( gsmChar > 0x7F ) |
|
3527 { |
|
3528 aGsmDataString.Append( 0x1B ); |
|
3529 } |
|
3530 aGsmDataString.Append(gsmChar & 0x7F); |
|
3531 } |
|
3532 // Append 0xFF for End of the String |
|
3533 aGsmDataString.Append( 0xFF ); |
|
3534 } // End of if there is no Input String |
|
3535 } // End of function |
|
3536 |
|
3537 |
3450 |
3538 |
3451 // ----------------------------------------------------------------------------- |
3539 // ----------------------------------------------------------------------------- |
3452 // CMmStaticUtility::ConvertUcs2ToGsmUcs2Data |
3540 // CMmStaticUtility::ConvertUcs2ToGsmUcs2Data |
3453 // Convert data to UCS2 format. See ETSI TS 102.221 Annex A |
3541 // Convert data to UCS2 format. See ETSI TS 102.221 Annex A |
3454 // ----------------------------------------------------------------------------- |
3542 // ----------------------------------------------------------------------------- |