1489 // ---------------------------------------------------------------------------- |
1486 // ---------------------------------------------------------------------------- |
1490 // CCmPluginWlan::UpdateServiceRecordL() |
1487 // CCmPluginWlan::UpdateServiceRecordL() |
1491 // ---------------------------------------------------------------------------- |
1488 // ---------------------------------------------------------------------------- |
1492 // |
1489 // |
1493 void CCmPluginWlan::UpdateServiceRecordL( |
1490 void CCmPluginWlan::UpdateServiceRecordL( |
1494 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
1491 RPointerArray<CommsDat::CCDRecordBase>& aGenRecordArray, |
1495 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) |
1492 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) |
1496 { |
1493 { |
1497 OstTraceFunctionEntry0( CCMPLUGINWLAN_UPDATESERVICERECORDL_ENTRY ); |
1494 OstTraceFunctionEntry0( CCMPLUGINWLAN_UPDATESERVICERECORDL_ENTRY ); |
1498 |
1495 |
1499 // Delete the original record and create a copy from the parameter |
1496 // Delete the original record and create a copy from the client's copy. |
1500 delete iServiceRecord; |
1497 delete iServiceRecord; |
1501 iServiceRecord = NULL; |
1498 iServiceRecord = NULL; |
1502 |
1499 |
1503 iServiceRecord = static_cast<CCDLANServiceRecord*> |
1500 iServiceRecord = static_cast<CCDLANServiceRecord *>( |
1504 (CCDRecordBase::RecordFactoryL( KCDTIdLANServiceRecord ) ); |
1501 CCDRecordBase::RecordFactoryL( KCDTIdLANServiceRecord ) ); |
1505 |
1502 |
1506 // LAN Service copy does not work so we have to copy it manually |
1503 // LAN Service copy does not work so we have to copy it manually. |
1507 |
1504 |
1508 CCDLANServiceRecord* lanServiceRecordTo = |
1505 // Plugin's commsdat copy. |
1509 static_cast<CCDLANServiceRecord *>( |
1506 CCDLANServiceRecord* origServiceRecord = static_cast<CCDLANServiceRecord*>( iServiceRecord ); |
1510 iServiceRecord ); |
1507 |
1511 |
1508 // Client's copy of lan service record. |
1512 CCDLANServiceRecord* lanServiceRecordFrom = |
1509 CCDLANServiceRecord* clientServiceRecordCopy = |
1513 static_cast<CCDLANServiceRecord *>( |
1510 static_cast<CCDLANServiceRecord*>( aGenRecordArray[KServiceRecordIndex] ); |
1514 aGenRecordArray[KServiceRecordIndex] ); |
1511 |
1515 |
1512 if ( !clientServiceRecordCopy->iRecordTag.IsNull() ) |
1516 if ( !lanServiceRecordFrom->iRecordName.IsNull() ) |
1513 { |
1517 { |
1514 origServiceRecord->iRecordTag.SetL( clientServiceRecordCopy->iRecordTag ); |
1518 lanServiceRecordTo->iRecordName.SetL( lanServiceRecordFrom->iRecordName ); |
1515 } |
1519 } |
1516 if ( !clientServiceRecordCopy->iRecordName.IsNull() ) |
1520 if ( !lanServiceRecordFrom->iIfNetworks.IsNull() ) |
1517 { |
1521 { |
1518 origServiceRecord->iRecordName.SetL( clientServiceRecordCopy->iRecordName ); |
1522 lanServiceRecordTo->iIfNetworks.SetL( lanServiceRecordFrom->iIfNetworks ); |
1519 } |
1523 } |
1520 if ( !clientServiceRecordCopy->iServiceEnableLlmnr.IsNull() ) |
1524 if ( !lanServiceRecordFrom->iIpGateway.IsNull() ) |
1521 { |
1525 { |
1522 origServiceRecord->iServiceEnableLlmnr.SetL( clientServiceRecordCopy->iServiceEnableLlmnr ); |
1526 lanServiceRecordTo->iIpGateway.SetL( lanServiceRecordFrom->iIpGateway ); |
1523 } |
1527 } |
1524 if ( !clientServiceRecordCopy->iIfNetworks.IsNull() ) |
1528 if ( !lanServiceRecordFrom->iIpAddrFromServer.IsNull() ) |
1525 { |
1529 { |
1526 origServiceRecord->iIfNetworks.SetL( clientServiceRecordCopy->iIfNetworks ); |
1530 lanServiceRecordTo->iIpAddrFromServer.SetL( lanServiceRecordFrom->iIpAddrFromServer ); |
1527 } |
1531 } |
1528 if ( !clientServiceRecordCopy->iIpNetmask.IsNull() ) |
1532 if ( !lanServiceRecordFrom->iIpAddr.IsNull() ) |
1529 { |
1533 { |
1530 origServiceRecord->iIpNetmask.SetL( clientServiceRecordCopy->iIpNetmask ); |
1534 lanServiceRecordTo->iIpAddr.SetL( lanServiceRecordFrom->iIpAddr ); |
1531 } |
1535 } |
1532 if ( !clientServiceRecordCopy->iIpGateway.IsNull() ) |
1536 if ( !lanServiceRecordFrom->iIpDnsAddrFromServer.IsNull() ) |
1533 { |
1537 { |
1534 origServiceRecord->iIpGateway.SetL( clientServiceRecordCopy->iIpGateway ); |
1538 lanServiceRecordTo->iIpDnsAddrFromServer.SetL( lanServiceRecordFrom->iIpDnsAddrFromServer ); |
1535 } |
1539 } |
1536 if ( !clientServiceRecordCopy->iIpAddrFromServer.IsNull() ) |
1540 if ( !lanServiceRecordFrom->iIpNameServer1.IsNull() ) |
1537 { |
1541 { |
1538 origServiceRecord->iIpAddrFromServer.SetL( clientServiceRecordCopy->iIpAddrFromServer ); |
1542 lanServiceRecordTo->iIpNameServer1.SetL( lanServiceRecordFrom->iIpNameServer1 ); |
1539 } |
1543 } |
1540 if ( !clientServiceRecordCopy->iIpAddr.IsNull() ) |
1544 if ( !lanServiceRecordFrom->iIpNameServer2.IsNull() ) |
1541 { |
1545 { |
1542 origServiceRecord->iIpAddr.SetL( clientServiceRecordCopy->iIpAddr ); |
1546 lanServiceRecordTo->iIpNameServer2.SetL( lanServiceRecordFrom->iIpNameServer2 ); |
1543 } |
1547 } |
1544 if ( !clientServiceRecordCopy->iIpDnsAddrFromServer.IsNull() ) |
1548 if ( !lanServiceRecordFrom->iIp6DnsAddrFromServer.IsNull() ) |
1545 { |
1549 { |
1546 origServiceRecord->iIpDnsAddrFromServer.SetL( clientServiceRecordCopy->iIpDnsAddrFromServer ); |
1550 lanServiceRecordTo->iIp6DnsAddrFromServer.SetL( lanServiceRecordFrom->iIp6DnsAddrFromServer ); |
1547 } |
1551 } |
1548 if ( !clientServiceRecordCopy->iIpNameServer1.IsNull() ) |
1552 if ( !lanServiceRecordFrom->iIp6NameServer1.IsNull() ) |
1549 { |
1553 { |
1550 origServiceRecord->iIpNameServer1.SetL( clientServiceRecordCopy->iIpNameServer1 ); |
1554 lanServiceRecordTo->iIp6NameServer1.SetL( lanServiceRecordFrom->iIp6NameServer1 ); |
1551 } |
1555 } |
1552 if ( !clientServiceRecordCopy->iIpNameServer2.IsNull() ) |
1556 if ( !lanServiceRecordFrom->iIp6NameServer2.IsNull() ) |
1553 { |
1557 { |
1554 origServiceRecord->iIpNameServer2.SetL( clientServiceRecordCopy->iIpNameServer2 ); |
1558 lanServiceRecordTo->iIp6NameServer2.SetL( lanServiceRecordFrom->iIp6NameServer2 ); |
1555 } |
1559 } |
1556 if ( !clientServiceRecordCopy->iIp6DnsAddrFromServer.IsNull() ) |
1560 if ( !lanServiceRecordFrom->iConfigDaemonManagerName.IsNull() ) |
1557 { |
1561 { |
1558 origServiceRecord->iIp6DnsAddrFromServer.SetL( clientServiceRecordCopy->iIp6DnsAddrFromServer ); |
1562 lanServiceRecordTo->iConfigDaemonManagerName.SetL( lanServiceRecordFrom->iConfigDaemonManagerName ); |
1559 } |
1563 } |
1560 if ( !clientServiceRecordCopy->iIp6NameServer1.IsNull() ) |
1564 if ( !lanServiceRecordFrom->iConfigDaemonName.IsNull() ) |
1561 { |
1565 { |
1562 origServiceRecord->iIp6NameServer1.SetL( clientServiceRecordCopy->iIp6NameServer1 ); |
1566 lanServiceRecordTo->iConfigDaemonName.SetL( lanServiceRecordFrom->iConfigDaemonName ); |
1563 } |
1567 } |
1564 if ( !clientServiceRecordCopy->iIp6NameServer2.IsNull() ) |
1568 |
1565 { |
1569 lanServiceRecordTo->SetElementId( lanServiceRecordFrom->ElementId() ); |
1566 origServiceRecord->iIp6NameServer2.SetL( clientServiceRecordCopy->iIp6NameServer2 ); |
1570 // this is shared between wlan iaps so it cannot be hidden or protected |
1567 } |
1571 lanServiceRecordTo->ClearAttributes( ECDHidden ); |
1568 if ( !clientServiceRecordCopy->iIpAddrLeaseValidFrom.IsNull() ) |
1572 lanServiceRecordTo->ClearAttributes( ECDProtectedWrite ); |
1569 { |
1573 |
1570 origServiceRecord->iIpAddrLeaseValidFrom.SetL( clientServiceRecordCopy->iIpAddrLeaseValidFrom ); |
1574 if ( !ServiceRecord().RecordId() ) |
1571 } |
1575 { |
1572 if ( !clientServiceRecordCopy->iIpAddrLeaseValidTo.IsNull() ) |
1576 ServiceRecord().SetRecordId( KCDNewRecordRequest ); |
1573 { |
1577 ServiceRecord().StoreL( iSession ); |
1574 origServiceRecord->iIpAddrLeaseValidTo.SetL( clientServiceRecordCopy->iIpAddrLeaseValidTo ); |
1578 |
1575 } |
1579 // Update needed values to record tables too( lanservice and wlanservice ) |
1576 if ( !clientServiceRecordCopy->iConfigDaemonManagerName.IsNull() ) |
1580 lanServiceRecordFrom->SetElementId( ServiceRecord().ElementId() ); |
1577 { |
1581 CCDWlanServiceRecord* wlanServiceRecord = |
1578 origServiceRecord->iConfigDaemonManagerName.SetL( clientServiceRecordCopy->iConfigDaemonManagerName ); |
1582 static_cast<CCDWlanServiceRecord *>( |
1579 } |
1583 aBearerSpecRecordArray[KWlanServiceRecordIndex] ); |
1580 if ( !clientServiceRecordCopy->iConfigDaemonName.IsNull() ) |
1584 wlanServiceRecord->iWlanServiceId.SetL( ServiceRecord().RecordId() ); |
1581 { |
|
1582 origServiceRecord->iConfigDaemonName.SetL( clientServiceRecordCopy->iConfigDaemonName ); |
|
1583 } |
|
1584 if ( !clientServiceRecordCopy->iServiceExtensionTableName.IsNull() ) |
|
1585 { |
|
1586 origServiceRecord->iServiceExtensionTableName.SetL( clientServiceRecordCopy->iServiceExtensionTableName ); |
|
1587 } |
|
1588 if ( !clientServiceRecordCopy->iServiceExtensionTableRecordId.IsNull() ) |
|
1589 { |
|
1590 origServiceRecord->iServiceExtensionTableRecordId.SetL( clientServiceRecordCopy->iServiceExtensionTableRecordId ); //TODO, check this works ok. |
|
1591 } |
|
1592 |
|
1593 origServiceRecord->SetElementId( clientServiceRecordCopy->ElementId() ); |
|
1594 |
|
1595 if ( !origServiceRecord->RecordId() ) |
|
1596 { |
|
1597 origServiceRecord->SetRecordId( KCDNewRecordRequest ); |
|
1598 origServiceRecord->StoreL( iSession ); |
|
1599 |
|
1600 // Update received element ID to client's copy too. |
|
1601 clientServiceRecordCopy->SetElementId( origServiceRecord->ElementId() ); |
|
1602 // Update needed values to other table records too (wlanservice). |
|
1603 CCDWlanServiceRecord* wlanServiceRecord = static_cast<CCDWlanServiceRecord *>( |
|
1604 aBearerSpecRecordArray[KWlanServiceRecordIndex] ); |
|
1605 wlanServiceRecord->iWlanServiceId.SetL( origServiceRecord->RecordId() ); |
1585 } |
1606 } |
1586 else |
1607 else |
1587 { |
1608 { |
1588 ServiceRecord().ModifyL( iSession ); |
1609 origServiceRecord->ModifyL( iSession ); |
1589 } |
1610 } |
1590 |
1611 |
1591 OstTraceFunctionExit0( CCMPLUGINWLAN_UPDATESERVICERECORDL_EXIT ); |
1612 OstTraceFunctionExit0( CCMPLUGINWLAN_UPDATESERVICERECORDL_EXIT ); |
1592 } |
1613 } |
1593 |
1614 |
1599 RPointerArray<CommsDat::CCDRecordBase>& /*aGenRecordArray*/, |
1620 RPointerArray<CommsDat::CCDRecordBase>& /*aGenRecordArray*/, |
1600 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) |
1621 RPointerArray<CommsDat::CCDRecordBase>& aBearerSpecRecordArray ) |
1601 { |
1622 { |
1602 OstTraceFunctionEntry0( CCMPLUGINWLAN_UPDATEBEARERRECORDSL_ENTRY ); |
1623 OstTraceFunctionEntry0( CCMPLUGINWLAN_UPDATEBEARERRECORDSL_ENTRY ); |
1603 |
1624 |
|
1625 // Delete the original record and create a copy from the client's copy. |
1604 delete iWlanServiceRecord; |
1626 delete iWlanServiceRecord; |
1605 iWlanServiceRecord = NULL; |
1627 iWlanServiceRecord = NULL; |
1606 |
1628 |
1607 CCDWlanServiceRecord* wlanServiceRecord = |
1629 iWlanServiceRecord = new( ELeave ) CCDWlanServiceRecord( iWlanTableId ); |
1608 static_cast<CCDWlanServiceRecord*>( |
1630 |
1609 aBearerSpecRecordArray[KWlanServiceRecordIndex] ); |
1631 // Client's copy of wlan service record. |
1610 |
1632 CCDWlanServiceRecord* clientWlanServiceRecord = static_cast<CCDWlanServiceRecord*>( |
1611 iWlanServiceRecord = new( ELeave ) CCDWlanServiceRecord ( iWlanTableId ); |
1633 aBearerSpecRecordArray[KWlanServiceRecordIndex] ); |
1612 |
1634 |
1613 iWlanServiceRecord->SetElementId( wlanServiceRecord->ElementId() ); |
1635 if ( !clientWlanServiceRecord->iRecordTag.IsNull() ) |
1614 iWlanServiceRecord->iRecordName.SetL( wlanServiceRecord->iRecordName ); |
1636 { |
1615 |
1637 iWlanServiceRecord->iRecordTag.SetL( |
1616 iWlanServiceRecord->iWlanServiceId.SetL( wlanServiceRecord->iWlanServiceId ); |
1638 clientWlanServiceRecord->iRecordTag ); |
1617 iWlanServiceRecord->iWlanConnMode.SetL( wlanServiceRecord->iWlanConnMode ); |
1639 } |
1618 if ( !wlanServiceRecord->iWLanSSID.IsNull() ) |
1640 if ( !clientWlanServiceRecord->iRecordName.IsNull() ) |
1619 { |
1641 { |
1620 iWlanServiceRecord->iWLanSSID.SetL( wlanServiceRecord->iWLanSSID ); |
1642 iWlanServiceRecord->iRecordName.SetL( |
1621 } |
1643 clientWlanServiceRecord->iRecordName ); |
1622 if ( !wlanServiceRecord->iWLanUsedSSID.IsNull() ) |
1644 } |
1623 { |
1645 if ( !clientWlanServiceRecord->iWlanServiceId.IsNull() ) |
1624 iWlanServiceRecord->iWLanUsedSSID.SetL( wlanServiceRecord->iWLanUsedSSID ); |
1646 { |
1625 } |
1647 iWlanServiceRecord->iWlanServiceId.SetL( |
1626 if ( !wlanServiceRecord->iWLanWepKey1.IsNull() ) |
1648 clientWlanServiceRecord->iWlanServiceId ); |
1627 { |
1649 } |
1628 iWlanServiceRecord->iWLanWepKey1.SetL( wlanServiceRecord->iWLanWepKey1 ); |
1650 if ( !clientWlanServiceRecord->iWlanConnMode.IsNull() ) |
1629 } |
1651 { |
1630 if ( !wlanServiceRecord->iWLanWepKey2.IsNull() ) |
1652 iWlanServiceRecord->iWlanConnMode.SetL( |
1631 { |
1653 clientWlanServiceRecord->iWlanConnMode ); |
1632 iWlanServiceRecord->iWLanWepKey2.SetL( wlanServiceRecord->iWLanWepKey2 ); |
1654 } |
1633 } |
1655 if ( !clientWlanServiceRecord->iWLanSSID.IsNull() ) |
1634 if ( !wlanServiceRecord->iWLanWepKey3.IsNull() ) |
1656 { |
1635 { |
1657 iWlanServiceRecord->iWLanSSID.SetL( |
1636 iWlanServiceRecord->iWLanWepKey3.SetL( wlanServiceRecord->iWLanWepKey3 ); |
1658 clientWlanServiceRecord->iWLanSSID ); |
1637 } |
1659 } |
1638 if ( !wlanServiceRecord->iWLanWepKey4.IsNull() ) |
1660 if ( !clientWlanServiceRecord->iWLanUsedSSID.IsNull() ) |
1639 { |
1661 { |
1640 iWlanServiceRecord->iWLanWepKey4.SetL( wlanServiceRecord->iWLanWepKey4 ); |
1662 iWlanServiceRecord->iWLanUsedSSID.SetL( |
1641 } |
1663 clientWlanServiceRecord->iWLanUsedSSID ); |
1642 if ( !wlanServiceRecord->iWlanWepIndex.IsNull() ) |
1664 } |
1643 { |
1665 if ( !clientWlanServiceRecord->iWLanWepKey1.IsNull() ) |
1644 iWlanServiceRecord->iWlanWepIndex.SetL( wlanServiceRecord->iWlanWepIndex ); |
1666 { |
1645 } |
1667 iWlanServiceRecord->iWLanWepKey1.SetL( |
1646 if ( !wlanServiceRecord->iWlanSecMode.IsNull() ) |
1668 clientWlanServiceRecord->iWLanWepKey1 ); |
1647 { |
1669 } |
1648 iWlanServiceRecord->iWlanSecMode.SetL( wlanServiceRecord->iWlanSecMode ); |
1670 if ( !clientWlanServiceRecord->iWLanWepKey2.IsNull() ) |
1649 } |
1671 { |
1650 if ( !wlanServiceRecord->iWlanAuthMode.IsNull() ) |
1672 iWlanServiceRecord->iWLanWepKey2.SetL( |
1651 { |
1673 clientWlanServiceRecord->iWLanWepKey2 ); |
1652 iWlanServiceRecord->iWlanAuthMode.SetL( wlanServiceRecord->iWlanAuthMode ); |
1674 } |
1653 } |
1675 if ( !clientWlanServiceRecord->iWLanWepKey3.IsNull() ) |
1654 if ( !wlanServiceRecord->iWlanEnableWpaPsk.IsNull() ) |
1676 { |
1655 { |
1677 iWlanServiceRecord->iWLanWepKey3.SetL( |
1656 iWlanServiceRecord->iWlanEnableWpaPsk.SetL( wlanServiceRecord->iWlanEnableWpaPsk ); |
1678 clientWlanServiceRecord->iWLanWepKey3 ); |
1657 } |
1679 } |
1658 if ( !wlanServiceRecord->iWLanWpaPreSharedKey.IsNull() ) |
1680 if ( !clientWlanServiceRecord->iWLanWepKey4.IsNull() ) |
1659 { |
1681 { |
1660 iWlanServiceRecord->iWLanWpaPreSharedKey.SetL( wlanServiceRecord->iWLanWpaPreSharedKey ); |
1682 iWlanServiceRecord->iWLanWepKey4.SetL( |
1661 } |
1683 clientWlanServiceRecord->iWLanWepKey4 ); |
1662 if ( !wlanServiceRecord->iWlanWpaKeyLength.IsNull() ) |
1684 } |
1663 { |
1685 if ( !clientWlanServiceRecord->iWlanWepIndex.IsNull() ) |
1664 iWlanServiceRecord->iWlanWpaKeyLength.SetL( wlanServiceRecord->iWlanWpaKeyLength ); |
1686 { |
1665 } |
1687 iWlanServiceRecord->iWlanWepIndex.SetL( |
1666 if ( !wlanServiceRecord->iWLanEaps.IsNull() ) |
1688 clientWlanServiceRecord->iWlanWepIndex ); |
1667 { |
1689 } |
1668 iWlanServiceRecord->iWLanEaps.SetL( wlanServiceRecord->iWLanEaps ); |
1690 if ( !clientWlanServiceRecord->iWlanSecMode.IsNull() ) |
1669 } |
1691 { |
1670 if ( !wlanServiceRecord->iWlanScanSSID.IsNull() ) |
1692 iWlanServiceRecord->iWlanSecMode.SetL( |
1671 { |
1693 clientWlanServiceRecord->iWlanSecMode ); |
1672 iWlanServiceRecord->iWlanScanSSID.SetL( wlanServiceRecord->iWlanScanSSID ); |
1694 } |
1673 } |
1695 if ( !clientWlanServiceRecord->iWlanAuthMode.IsNull() ) |
1674 if ( !wlanServiceRecord->iWlanChannelID.IsNull() ) |
1696 { |
1675 { |
1697 iWlanServiceRecord->iWlanAuthMode.SetL( |
1676 iWlanServiceRecord->iWlanChannelID.SetL( wlanServiceRecord->iWlanChannelID ); |
1698 clientWlanServiceRecord->iWlanAuthMode ); |
1677 } |
1699 } |
1678 if ( !wlanServiceRecord->iWlanFormatKey1.IsNull() ) |
1700 if ( !clientWlanServiceRecord->iWlanEnableWpaPsk.IsNull() ) |
1679 { |
1701 { |
1680 iWlanServiceRecord->iWlanFormatKey1.SetL( wlanServiceRecord->iWlanFormatKey1 ); |
1702 iWlanServiceRecord->iWlanEnableWpaPsk.SetL( |
1681 } |
1703 clientWlanServiceRecord->iWlanEnableWpaPsk ); |
1682 if ( !wlanServiceRecord->iWlanFormatKey2.IsNull() ) |
1704 } |
1683 { |
1705 if ( !clientWlanServiceRecord->iWLanWpaPreSharedKey.IsNull() ) |
1684 iWlanServiceRecord->iWlanFormatKey2.SetL( wlanServiceRecord->iWlanFormatKey2 ); |
1706 { |
1685 } |
1707 iWlanServiceRecord->iWLanWpaPreSharedKey.SetL( |
1686 if ( !wlanServiceRecord->iWlanFormatKey3.IsNull() ) |
1708 clientWlanServiceRecord->iWLanWpaPreSharedKey ); |
1687 { |
1709 } |
1688 iWlanServiceRecord->iWlanFormatKey3.SetL( wlanServiceRecord->iWlanFormatKey3 ); |
1710 if ( !clientWlanServiceRecord->iWlanWpaKeyLength.IsNull() ) |
1689 } |
1711 { |
1690 if ( !wlanServiceRecord->iWlanFormatKey4.IsNull() ) |
1712 iWlanServiceRecord->iWlanWpaKeyLength.SetL( |
1691 { |
1713 clientWlanServiceRecord->iWlanWpaKeyLength ); |
1692 iWlanServiceRecord->iWlanFormatKey4.SetL( wlanServiceRecord->iWlanFormatKey4 ); |
1714 } |
1693 } |
1715 if ( !clientWlanServiceRecord->iWLanEaps.IsNull() ) |
1694 if ( !wlanServiceRecord->iWlanAllowSSIDRoaming.IsNull() ) |
1716 { |
1695 { |
1717 iWlanServiceRecord->iWLanEaps.SetL( |
1696 iWlanServiceRecord->iWlanAllowSSIDRoaming.SetL( wlanServiceRecord->iWlanAllowSSIDRoaming ); |
1718 clientWlanServiceRecord->iWLanEaps ); |
1697 } |
1719 } |
1698 if ( !wlanServiceRecord->iWLanEnabledEaps.IsNull() ) |
1720 if ( !clientWlanServiceRecord->iWlanScanSSID.IsNull() ) |
1699 { |
1721 { |
1700 iWlanServiceRecord->iWLanEnabledEaps.SetL( wlanServiceRecord->iWLanEnabledEaps ); |
1722 iWlanServiceRecord->iWlanScanSSID.SetL( |
1701 } |
1723 clientWlanServiceRecord->iWlanScanSSID ); |
1702 if ( !wlanServiceRecord->iWLanDisabledEaps.IsNull() ) |
1724 } |
1703 { |
1725 if ( !clientWlanServiceRecord->iWlanChannelID.IsNull() ) |
1704 iWlanServiceRecord->iWLanDisabledEaps.SetL( wlanServiceRecord->iWLanDisabledEaps ); |
1726 { |
1705 } |
1727 iWlanServiceRecord->iWlanChannelID.SetL( |
|
1728 clientWlanServiceRecord->iWlanChannelID ); |
|
1729 } |
|
1730 if ( !clientWlanServiceRecord->iWlanFormatKey1.IsNull() ) |
|
1731 { |
|
1732 iWlanServiceRecord->iWlanFormatKey1.SetL( |
|
1733 clientWlanServiceRecord->iWlanFormatKey1 ); |
|
1734 } |
|
1735 if ( !clientWlanServiceRecord->iWlanFormatKey2.IsNull() ) |
|
1736 { |
|
1737 iWlanServiceRecord->iWlanFormatKey2.SetL( |
|
1738 clientWlanServiceRecord->iWlanFormatKey2 ); |
|
1739 } |
|
1740 if ( !clientWlanServiceRecord->iWlanFormatKey3.IsNull() ) |
|
1741 { |
|
1742 iWlanServiceRecord->iWlanFormatKey3.SetL( |
|
1743 clientWlanServiceRecord->iWlanFormatKey3 ); |
|
1744 } |
|
1745 if ( !clientWlanServiceRecord->iWlanFormatKey4.IsNull() ) |
|
1746 { |
|
1747 iWlanServiceRecord->iWlanFormatKey4.SetL( |
|
1748 clientWlanServiceRecord->iWlanFormatKey4 ); |
|
1749 } |
|
1750 if ( !clientWlanServiceRecord->iWlanAllowSSIDRoaming.IsNull() ) |
|
1751 { |
|
1752 iWlanServiceRecord->iWlanAllowSSIDRoaming.SetL( |
|
1753 clientWlanServiceRecord->iWlanAllowSSIDRoaming ); |
|
1754 } |
|
1755 if ( !clientWlanServiceRecord->iWLanEnabledEaps.IsNull() ) |
|
1756 { |
|
1757 iWlanServiceRecord->iWLanEnabledEaps.SetL( |
|
1758 clientWlanServiceRecord->iWLanEnabledEaps ); |
|
1759 } |
|
1760 if ( !clientWlanServiceRecord->iWLanDisabledEaps.IsNull() ) |
|
1761 { |
|
1762 iWlanServiceRecord->iWLanDisabledEaps.SetL( |
|
1763 clientWlanServiceRecord->iWLanDisabledEaps ); |
|
1764 } |
|
1765 |
|
1766 iWlanServiceRecord->SetElementId( clientWlanServiceRecord->ElementId() ); |
1706 |
1767 |
1707 if ( !iWlanServiceRecord->RecordId() ) |
1768 if ( !iWlanServiceRecord->RecordId() ) |
1708 { |
1769 { |
1709 iWlanServiceRecord->SetRecordId( KCDNewRecordRequest ); |
1770 iWlanServiceRecord->SetRecordId( KCDNewRecordRequest ); |
1710 iWlanServiceRecord->StoreL( iSession ); |
1771 iWlanServiceRecord->StoreL( iSession ); |
1711 wlanServiceRecord->SetElementId( iWlanServiceRecord->ElementId() ); |
1772 |
|
1773 // Update received element ID to client's copy too. |
|
1774 clientWlanServiceRecord->SetElementId( iWlanServiceRecord->ElementId() ); |
1712 } |
1775 } |
1713 else |
1776 else |
1714 { |
1777 { |
1715 iWlanServiceRecord->ModifyL( iSession ); |
1778 iWlanServiceRecord->ModifyL( iSession ); |
1716 } |
1779 } |
1752 // |
1814 // |
1753 CommsDat::CCDRecordBase* CCmPluginWlan::CopyServiceRecordL() |
1815 CommsDat::CCDRecordBase* CCmPluginWlan::CopyServiceRecordL() |
1754 { |
1816 { |
1755 OstTraceFunctionEntry0( CCMPLUGINWLAN_COPYSERVICERECORDL_ENTRY ); |
1817 OstTraceFunctionEntry0( CCMPLUGINWLAN_COPYSERVICERECORDL_ENTRY ); |
1756 |
1818 |
1757 __ASSERT_DEBUG( iServiceRecord != NULL, User::Leave( KErrNotFound )); |
1819 // New service record to be returned. |
1758 |
1820 CCDRecordBase* serviceRecord = static_cast<CCDLANServiceRecord*>( |
1759 CCDRecordBase* serviceRecord = |
1821 CCDRecordBase::RecordFactoryL( KCDTIdLANServiceRecord ) ); |
1760 static_cast<CCDLANServiceRecord*>( |
1822 CleanupStack::PushL( serviceRecord ); |
1761 CCDRecordBase::CreateCopyRecordL( *iServiceRecord ) ); |
1823 |
|
1824 CCDLANServiceRecord* tempServiceRecordPtrToNew = |
|
1825 static_cast<CCDLANServiceRecord*>( serviceRecord ); |
|
1826 |
|
1827 // CommsDat version of service record. |
|
1828 CCDLANServiceRecord* origServiceRecord = |
|
1829 static_cast<CCDLANServiceRecord*>( iServiceRecord ); |
|
1830 |
|
1831 if ( !origServiceRecord->iRecordTag.IsNull() ) |
|
1832 { |
|
1833 tempServiceRecordPtrToNew->iRecordTag.SetL( |
|
1834 origServiceRecord->iRecordTag ); |
|
1835 } |
|
1836 if ( !origServiceRecord->iRecordName.IsNull() ) |
|
1837 { |
|
1838 tempServiceRecordPtrToNew->iRecordName.SetL( |
|
1839 origServiceRecord->iRecordName ); |
|
1840 } |
|
1841 if ( !origServiceRecord->iServiceEnableLlmnr.IsNull() ) |
|
1842 { |
|
1843 tempServiceRecordPtrToNew->iServiceEnableLlmnr.SetL( |
|
1844 origServiceRecord->iServiceEnableLlmnr ); |
|
1845 } |
|
1846 if ( !origServiceRecord->iIfNetworks.IsNull() ) |
|
1847 { |
|
1848 tempServiceRecordPtrToNew->iIfNetworks.SetL( |
|
1849 origServiceRecord->iIfNetworks ); |
|
1850 } |
|
1851 if ( !origServiceRecord->iIpNetmask.IsNull() ) |
|
1852 { |
|
1853 tempServiceRecordPtrToNew->iIpNetmask.SetL( |
|
1854 origServiceRecord->iIpNetmask ); |
|
1855 } |
|
1856 if ( !origServiceRecord->iIpGateway.IsNull() ) |
|
1857 { |
|
1858 tempServiceRecordPtrToNew->iIpGateway.SetL( |
|
1859 origServiceRecord->iIpGateway ); |
|
1860 } |
|
1861 if ( !origServiceRecord->iIpAddrFromServer.IsNull() ) |
|
1862 { |
|
1863 tempServiceRecordPtrToNew->iIpAddrFromServer.SetL( |
|
1864 origServiceRecord->iIpAddrFromServer ); |
|
1865 } |
|
1866 if ( !origServiceRecord->iIpAddr.IsNull() ) |
|
1867 { |
|
1868 tempServiceRecordPtrToNew->iIpAddr.SetL( |
|
1869 origServiceRecord->iIpAddr ); |
|
1870 } |
|
1871 if ( !origServiceRecord->iIpDnsAddrFromServer.IsNull() ) |
|
1872 { |
|
1873 tempServiceRecordPtrToNew->iIpDnsAddrFromServer.SetL( |
|
1874 origServiceRecord->iIpDnsAddrFromServer ); |
|
1875 } |
|
1876 if ( !origServiceRecord->iIpNameServer1.IsNull() ) |
|
1877 { |
|
1878 tempServiceRecordPtrToNew->iIpNameServer1.SetL( |
|
1879 origServiceRecord->iIpNameServer1 ); |
|
1880 } |
|
1881 if ( !origServiceRecord->iIpNameServer2.IsNull() ) |
|
1882 { |
|
1883 tempServiceRecordPtrToNew->iIpNameServer2.SetL( |
|
1884 origServiceRecord->iIpNameServer2 ); |
|
1885 } |
|
1886 if ( !origServiceRecord->iIp6DnsAddrFromServer.IsNull() ) |
|
1887 { |
|
1888 tempServiceRecordPtrToNew->iIp6DnsAddrFromServer.SetL( |
|
1889 origServiceRecord->iIp6DnsAddrFromServer ); |
|
1890 } |
|
1891 if ( !origServiceRecord->iIp6NameServer1.IsNull() ) |
|
1892 { |
|
1893 tempServiceRecordPtrToNew->iIp6NameServer1.SetL( |
|
1894 origServiceRecord->iIp6NameServer1 ); |
|
1895 } |
|
1896 if ( !origServiceRecord->iIp6NameServer2.IsNull() ) |
|
1897 { |
|
1898 tempServiceRecordPtrToNew->iIp6NameServer2.SetL( |
|
1899 origServiceRecord->iIp6NameServer2 ); |
|
1900 } |
|
1901 if ( !origServiceRecord->iIpAddrLeaseValidFrom.IsNull() ) |
|
1902 { |
|
1903 tempServiceRecordPtrToNew->iIpAddrLeaseValidFrom.SetL( |
|
1904 origServiceRecord->iIpAddrLeaseValidFrom ); |
|
1905 } |
|
1906 if ( !origServiceRecord->iIpAddrLeaseValidTo.IsNull() ) |
|
1907 { |
|
1908 tempServiceRecordPtrToNew->iIpAddrLeaseValidTo.SetL( |
|
1909 origServiceRecord->iIpAddrLeaseValidTo ); |
|
1910 } |
|
1911 if ( !origServiceRecord->iConfigDaemonManagerName.IsNull() ) |
|
1912 { |
|
1913 tempServiceRecordPtrToNew->iConfigDaemonManagerName.SetL( |
|
1914 origServiceRecord->iConfigDaemonManagerName ); |
|
1915 } |
|
1916 if ( !origServiceRecord->iConfigDaemonName.IsNull() ) |
|
1917 { |
|
1918 tempServiceRecordPtrToNew->iConfigDaemonName.SetL( |
|
1919 origServiceRecord->iConfigDaemonName ); |
|
1920 } |
|
1921 if ( !origServiceRecord->iServiceExtensionTableName.IsNull() ) |
|
1922 { |
|
1923 tempServiceRecordPtrToNew->iServiceExtensionTableName.SetL( |
|
1924 origServiceRecord->iServiceExtensionTableName ); |
|
1925 } |
|
1926 if ( !origServiceRecord->iServiceExtensionTableRecordId.IsNull() ) |
|
1927 { |
|
1928 tempServiceRecordPtrToNew->iServiceExtensionTableRecordId.SetL( |
|
1929 origServiceRecord->iServiceExtensionTableRecordId ); |
|
1930 } |
|
1931 |
|
1932 CleanupStack::Pop( serviceRecord ); |
1762 |
1933 |
1763 OstTraceFunctionExit0( CCMPLUGINWLAN_COPYSERVICERECORDL_EXIT ); |
1934 OstTraceFunctionExit0( CCMPLUGINWLAN_COPYSERVICERECORDL_EXIT ); |
1764 return serviceRecord; |
1935 return serviceRecord; |
1765 } |
1936 } |
1766 |
1937 |