void DviDevice::SetAttribute(const TChar* aKey, const TChar* aValue) { Brn key(aKey); Parser parser(key); Brn name = parser.Next('.'); aKey += name.Bytes() + 1; // assume keys starting 'Test' are a special case which can be updated at any time if (strlen(aKey) < 4 || strncmp(aKey, "Test", 4) != 0) { ASSERT(iEnabled == eDisabled); } if (name == Brn("Core")) { static const char* longPollEnable = "LongPollEnable"; if (iProviderSubscriptionLongPoll == NULL && strncmp(aKey, longPollEnable, sizeof(longPollEnable)-1) == 0) { iProviderSubscriptionLongPoll = new DviProviderSubscriptionLongPoll(*this); ConfigChanged(); } } else { for (TUint i=0; i<(TUint)iProtocols.size(); i++) { IDvProtocol* protocol = iProtocols[i]; if (protocol->ProtocolName() == name) { protocol->SetAttribute(aKey, aValue); ConfigChanged(); break; } } } }
void DviDevice::SetAttribute(const TChar* aKey, const TChar* aValue) { Brn key(aKey); Parser parser(key); Brn name = parser.Next('.'); aKey += name.Bytes() + 1; // assume keys starting 'Test' are a special case which can be updated at any time if (strlen(aKey) <4 || strncmp(aKey, "Test", 4) != 0) { ASSERT(iEnabled == eDisabled); } for (TUint i=0; i<(TUint)iProtocols.size(); i++) { IDvProtocol* protocol = iProtocols[i]; if (protocol->ProtocolName() == name) { protocol->SetAttribute(aKey, aValue); ConfigChanged(); break; } } }