void DvProviderAvOpenhomeOrgCredentials1C::DoGet(IDviInvocation& aInvocation) { DvInvocationCPrivate invocationWrapper(aInvocation); IDvInvocationC* invocationC; void* invocationCPtr; invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr); aInvocation.InvocationReadStart(); Brhz Id; aInvocation.InvocationReadString("Id", Id); aInvocation.InvocationReadEnd(); DviInvocation invocation(aInvocation); char* UserName; char* Password; uint32_t PasswordLen; uint32_t Enabled; char* Status; char* Data; ASSERT(iCallbackGet != NULL); if (0 != iCallbackGet(iPtrGet, invocationC, invocationCPtr, (const char*)Id.Ptr(), &UserName, &Password, &PasswordLen, &Enabled, &Status, &Data)) { invocation.Error(502, Brn("Action failed")); return; } DviInvocationResponseString respUserName(aInvocation, "UserName"); DviInvocationResponseBinary respPassword(aInvocation, "Password"); DviInvocationResponseBool respEnabled(aInvocation, "Enabled"); DviInvocationResponseString respStatus(aInvocation, "Status"); DviInvocationResponseString respData(aInvocation, "Data"); invocation.StartResponse(); Brhz bufUserName((const TChar*)UserName); OhNetFreeExternal(UserName); respUserName.Write(bufUserName); respUserName.WriteFlush(); Brh bufPassword; bufPassword.Set((const TByte*)Password, PasswordLen); OhNetFreeExternal(Password); respPassword.Write(bufPassword); respPassword.WriteFlush(); respEnabled.Write((Enabled!=0)); Brhz bufStatus((const TChar*)Status); OhNetFreeExternal(Status); respStatus.Write(bufStatus); respStatus.WriteFlush(); Brhz bufData((const TChar*)Data); OhNetFreeExternal(Data); respData.Write(bufData); respData.WriteFlush(); invocation.EndResponse(); }
void DvProviderUpnpOrgAVTransport1::DoGetPositionInfo(IDviInvocation& aInvocation, TUint aVersion) { aInvocation.InvocationReadStart(); TUint InstanceID = aInvocation.InvocationReadUint("InstanceID"); aInvocation.InvocationReadEnd(); InvocationResponse resp(aInvocation); InvocationResponseUint respTrack(aInvocation, "Track"); InvocationResponseString respTrackDuration(aInvocation, "TrackDuration"); InvocationResponseString respTrackMetaData(aInvocation, "TrackMetaData"); InvocationResponseString respTrackURI(aInvocation, "TrackURI"); InvocationResponseString respRelTime(aInvocation, "RelTime"); InvocationResponseString respAbsTime(aInvocation, "AbsTime"); InvocationResponseInt respRelCount(aInvocation, "RelCount"); InvocationResponseInt respAbsCount(aInvocation, "AbsCount"); GetPositionInfo(resp, aVersion, InstanceID, respTrack, respTrackDuration, respTrackMetaData, respTrackURI, respRelTime, respAbsTime, respRelCount, respAbsCount); }
void DvProviderUpnpOrgScheduledRecording2Cpp::DoGetSortCapabilities(IDviInvocation& aInvocation, uint32_t aVersion) { aInvocation.InvocationReadStart(); aInvocation.InvocationReadEnd(); std::string respSortCaps; uint32_t respSortLevelCap; GetSortCapabilities(aVersion, respSortCaps, respSortLevelCap); aInvocation.InvocationWriteStart(); InvocationResponseString respWriterSortCaps(aInvocation, "SortCaps"); Brn buf_SortCaps((const TByte*)respSortCaps.c_str(), (TUint)respSortCaps.length()); respWriterSortCaps.Write(buf_SortCaps); aInvocation.InvocationWriteStringEnd("SortCaps"); InvocationResponseUint respWriterSortLevelCap(aInvocation, "SortLevelCap"); respWriterSortLevelCap.Write(respSortLevelCap); aInvocation.InvocationWriteEnd(); }
void DvProviderUpnpOrgConnectionManager2C::DoGetCurrentConnectionInfo(IDviInvocation& aInvocation, TUint aVersion) { aInvocation.InvocationReadStart(); TInt ConnectionID = aInvocation.InvocationReadInt("ConnectionID"); aInvocation.InvocationReadEnd(); InvocationResponse resp(aInvocation); int32_t RcsID; int32_t AVTransportID; char* ProtocolInfo; char* PeerConnectionManager; int32_t PeerConnectionID; char* Direction; char* Status; ASSERT(iCallbackGetCurrentConnectionInfo != NULL); if (0 != iCallbackGetCurrentConnectionInfo(iPtrGetCurrentConnectionInfo, aVersion, ConnectionID, &RcsID, &AVTransportID, &ProtocolInfo, &PeerConnectionManager, &PeerConnectionID, &Direction, &Status)) { resp.Error(502, Brn("Action failed")); return; } InvocationResponseInt respRcsID(aInvocation, "RcsID"); InvocationResponseInt respAVTransportID(aInvocation, "AVTransportID"); InvocationResponseString respProtocolInfo(aInvocation, "ProtocolInfo"); InvocationResponseString respPeerConnectionManager(aInvocation, "PeerConnectionManager"); InvocationResponseInt respPeerConnectionID(aInvocation, "PeerConnectionID"); InvocationResponseString respDirection(aInvocation, "Direction"); InvocationResponseString respStatus(aInvocation, "Status"); resp.Start(); respRcsID.Write(RcsID); respAVTransportID.Write(AVTransportID); Brhz bufProtocolInfo((const TChar*)ProtocolInfo); OhNetFreeExternal(ProtocolInfo); respProtocolInfo.Write(bufProtocolInfo); respProtocolInfo.WriteFlush(); Brhz bufPeerConnectionManager((const TChar*)PeerConnectionManager); OhNetFreeExternal(PeerConnectionManager); respPeerConnectionManager.Write(bufPeerConnectionManager); respPeerConnectionManager.WriteFlush(); respPeerConnectionID.Write(PeerConnectionID); Brhz bufDirection((const TChar*)Direction); OhNetFreeExternal(Direction); respDirection.Write(bufDirection); respDirection.WriteFlush(); Brhz bufStatus((const TChar*)Status); OhNetFreeExternal(Status); respStatus.Write(bufStatus); respStatus.WriteFlush(); resp.End(); }
void DviService::Invoke(IDviInvocation& aInvocation, const Brx& aActionName) { iLock.Wait(); #if 0 // debug logging { Bws<512> debugBuf("Service: "); debugBuf.Append(iServiceType.Name()); debugBuf.Append(", Action: "); debugBuf.Append(aActionName); debugBuf.Append("\n"); Log::Print(debugBuf); } #endif TBool disabled = iDisabled; if (disabled) { iLock.Signal(); aInvocation.InvocationReportError(502, Brn("Action not available")); } iCurrentInvocationCount++; (void)iDisabledSem.Clear(); iLock.Signal(); { AutoFunctor a(MakeFunctor(*this, &DviService::InvocationCompleted)); for (TUint i=0; i<iDvActions.size(); i++) { if (iDvActions[i].Action()->Name() == aActionName) { try { iDvActions[i].Functor()(aInvocation); } catch (InvocationError&) { // avoid calls to aInvocation.InvocationReportError in other catch blocks throw; } catch (Exception& e) { Brn msg(e.Message()); aInvocation.InvocationReportError(801, msg); } catch (...) { aInvocation.InvocationReportError(801, Brn("Unknown error")); } return; } } } aInvocation.InvocationReportError(501, Brn("Action not implemented")); }
void DvProviderUpnpOrgAVTransport1::DoGetMediaInfo(IDviInvocation& aInvocation, TUint aVersion) { aInvocation.InvocationReadStart(); TUint InstanceID = aInvocation.InvocationReadUint("InstanceID"); aInvocation.InvocationReadEnd(); InvocationResponse resp(aInvocation); InvocationResponseUint respNrTracks(aInvocation, "NrTracks"); InvocationResponseString respMediaDuration(aInvocation, "MediaDuration"); InvocationResponseString respCurrentURI(aInvocation, "CurrentURI"); InvocationResponseString respCurrentURIMetaData(aInvocation, "CurrentURIMetaData"); InvocationResponseString respNextURI(aInvocation, "NextURI"); InvocationResponseString respNextURIMetaData(aInvocation, "NextURIMetaData"); InvocationResponseString respPlayMedium(aInvocation, "PlayMedium"); InvocationResponseString respRecordMedium(aInvocation, "RecordMedium"); InvocationResponseString respWriteStatus(aInvocation, "WriteStatus"); GetMediaInfo(resp, aVersion, InstanceID, respNrTracks, respMediaDuration, respCurrentURI, respCurrentURIMetaData, respNextURI, respNextURIMetaData, respPlayMedium, respRecordMedium, respWriteStatus); }
void DvProviderLinnCoUkVolkano1Cpp::DoSoftwareUpdate(IDviInvocation& aInvocation) { aInvocation.InvocationReadStart(); aInvocation.InvocationReadEnd(); bool respaAvailable; std::string respaSoftwareVersion; DvInvocationStd invocation(aInvocation); SoftwareUpdate(invocation, respaAvailable, respaSoftwareVersion); aInvocation.InvocationWriteStart(); DviInvocationResponseBool respWriteraAvailable(aInvocation, "aAvailable"); respWriteraAvailable.Write(respaAvailable); DviInvocationResponseString respWriteraSoftwareVersion(aInvocation, "aSoftwareVersion"); Brn buf_aSoftwareVersion((const TByte*)respaSoftwareVersion.c_str(), (TUint)respaSoftwareVersion.length()); respWriteraSoftwareVersion.Write(buf_aSoftwareVersion); aInvocation.InvocationWriteStringEnd("aSoftwareVersion"); aInvocation.InvocationWriteEnd(); }
void DvProviderAvOpenhomeOrgRadio1C::DoStop(IDviInvocation& aInvocation) { DvInvocationCPrivate invocationWrapper(aInvocation); IDvInvocationC* invocationC; void* invocationCPtr; invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr); aInvocation.InvocationReadStart(); aInvocation.InvocationReadEnd(); DviInvocation invocation(aInvocation); ASSERT(iCallbackStop != NULL); if (0 != iCallbackStop(iPtrStop, invocationC, invocationCPtr)) { invocation.Error(502, Brn("Action failed")); return; } invocation.StartResponse(); invocation.EndResponse(); }
void DvProviderUpnpOrgDimming1Cpp::DoGetOnEffectParameters(IDviInvocation& aInvocation) { aInvocation.InvocationReadStart(); aInvocation.InvocationReadEnd(); std::string respretOnEffect; uint32_t respretOnEffectLevel; DvInvocationStd invocation(aInvocation); GetOnEffectParameters(invocation, respretOnEffect, respretOnEffectLevel); aInvocation.InvocationWriteStart(); DviInvocationResponseString respWriterretOnEffect(aInvocation, "retOnEffect"); Brn buf_retOnEffect((const TByte*)respretOnEffect.c_str(), (TUint)respretOnEffect.length()); respWriterretOnEffect.Write(buf_retOnEffect); aInvocation.InvocationWriteStringEnd("retOnEffect"); DviInvocationResponseUint respWriterretOnEffectLevel(aInvocation, "retOnEffectLevel"); respWriterretOnEffectLevel.Write(respretOnEffectLevel); aInvocation.InvocationWriteEnd(); }
void DvProviderAvOpenhomeOrgTime1Cpp::DoTime(IDviInvocation& aInvocation, uint32_t aVersion) { aInvocation.InvocationReadStart(); aInvocation.InvocationReadEnd(); uint32_t respTrackCount; uint32_t respDuration; uint32_t respSeconds; Time(aVersion, respTrackCount, respDuration, respSeconds); aInvocation.InvocationWriteStart(); InvocationResponseUint respWriterTrackCount(aInvocation, "TrackCount"); respWriterTrackCount.Write(respTrackCount); InvocationResponseUint respWriterDuration(aInvocation, "Duration"); respWriterDuration.Write(respDuration); InvocationResponseUint respWriterSeconds(aInvocation, "Seconds"); respWriterSeconds.Write(respSeconds); aInvocation.InvocationWriteEnd(); }
void DvProviderUpnpOrgScheduledRecording2Cpp::DoCreateRecordSchedule(IDviInvocation& aInvocation) { aInvocation.InvocationReadStart(); Brhz buf_Elements; aInvocation.InvocationReadString("Elements", buf_Elements); std::string Elements((const char*)buf_Elements.Ptr(), buf_Elements.Bytes()); aInvocation.InvocationReadEnd(); std::string respRecordScheduleID; std::string respResult; uint32_t respUpdateID; DvInvocationStd invocation(aInvocation); CreateRecordSchedule(invocation, Elements, respRecordScheduleID, respResult, respUpdateID); aInvocation.InvocationWriteStart(); DviInvocationResponseString respWriterRecordScheduleID(aInvocation, "RecordScheduleID"); Brn buf_RecordScheduleID((const TByte*)respRecordScheduleID.c_str(), (TUint)respRecordScheduleID.length()); respWriterRecordScheduleID.Write(buf_RecordScheduleID); aInvocation.InvocationWriteStringEnd("RecordScheduleID"); DviInvocationResponseString respWriterResult(aInvocation, "Result"); Brn buf_Result((const TByte*)respResult.c_str(), (TUint)respResult.length()); respWriterResult.Write(buf_Result); aInvocation.InvocationWriteStringEnd("Result"); DviInvocationResponseUint respWriterUpdateID(aInvocation, "UpdateID"); respWriterUpdateID.Write(respUpdateID); aInvocation.InvocationWriteEnd(); }
void DvProviderUpnpOrgAVTransport1C::DoPrevious(IDviInvocation& aInvocation) { DvInvocationCPrivate invocationWrapper(aInvocation); IDvInvocationC* invocationC; void* invocationCPtr; invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr); aInvocation.InvocationReadStart(); TUint InstanceID = aInvocation.InvocationReadUint("InstanceID"); aInvocation.InvocationReadEnd(); DviInvocation invocation(aInvocation); ASSERT(iCallbackPrevious != NULL); if (0 != iCallbackPrevious(iPtrPrevious, invocationC, invocationCPtr, InstanceID)) { invocation.Error(502, Brn("Action failed")); return; } invocation.StartResponse(); invocation.EndResponse(); }
void DvProviderAvOpenhomeOrgRadio1C::DoSeekSecondRelative(IDviInvocation& aInvocation) { DvInvocationCPrivate invocationWrapper(aInvocation); IDvInvocationC* invocationC; void* invocationCPtr; invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr); aInvocation.InvocationReadStart(); TInt Value = aInvocation.InvocationReadInt("Value"); aInvocation.InvocationReadEnd(); DviInvocation invocation(aInvocation); ASSERT(iCallbackSeekSecondRelative != NULL); if (0 != iCallbackSeekSecondRelative(iPtrSeekSecondRelative, invocationC, invocationCPtr, Value)) { invocation.Error(502, Brn("Action failed")); return; } invocation.StartResponse(); invocation.EndResponse(); }
void DvProviderAvOpenhomeOrgTransport1Cpp::DoStreamInfo(IDviInvocation& aInvocation) { aInvocation.InvocationReadStart(); aInvocation.InvocationReadEnd(); uint32_t respStreamId; bool respCanSeek; bool respCanPause; DvInvocationStd invocation(aInvocation); StreamInfo(invocation, respStreamId, respCanSeek, respCanPause); aInvocation.InvocationWriteStart(); DviInvocationResponseUint respWriterStreamId(aInvocation, "StreamId"); respWriterStreamId.Write(respStreamId); DviInvocationResponseBool respWriterCanSeek(aInvocation, "CanSeek"); respWriterCanSeek.Write(respCanSeek); DviInvocationResponseBool respWriterCanPause(aInvocation, "CanPause"); respWriterCanPause.Write(respCanPause); aInvocation.InvocationWriteEnd(); }
void DvProviderAvOpenhomeOrgInfo1Cpp::DoCounters(IDviInvocation& aInvocation) { aInvocation.InvocationReadStart(); aInvocation.InvocationReadEnd(); uint32_t respTrackCount; uint32_t respDetailsCount; uint32_t respMetatextCount; DvInvocationStd invocation(aInvocation); Counters(invocation, respTrackCount, respDetailsCount, respMetatextCount); aInvocation.InvocationWriteStart(); DviInvocationResponseUint respWriterTrackCount(aInvocation, "TrackCount"); respWriterTrackCount.Write(respTrackCount); DviInvocationResponseUint respWriterDetailsCount(aInvocation, "DetailsCount"); respWriterDetailsCount.Write(respDetailsCount); DviInvocationResponseUint respWriterMetatextCount(aInvocation, "MetatextCount"); respWriterMetatextCount.Write(respMetatextCount); aInvocation.InvocationWriteEnd(); }
void DvProviderUpnpOrgContentDirectory1C::DoStopTransferResource(IDviInvocation& aInvocation) { DvInvocationCPrivate invocationWrapper(aInvocation); IDvInvocationC* invocationC; void* invocationCPtr; invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr); aInvocation.InvocationReadStart(); TUint TransferID = aInvocation.InvocationReadUint("TransferID"); aInvocation.InvocationReadEnd(); DviInvocation invocation(aInvocation); ASSERT(iCallbackStopTransferResource != NULL); if (0 != iCallbackStopTransferResource(iPtrStopTransferResource, invocationC, invocationCPtr, TransferID)) { invocation.Error(502, Brn("Action failed")); return; } invocation.StartResponse(); invocation.EndResponse(); }
void DvProviderUpnpOrgAVTransport2Cpp::DoGetPositionInfo(IDviInvocation& aInvocation) { aInvocation.InvocationReadStart(); uint32_t InstanceID = aInvocation.InvocationReadUint("InstanceID"); aInvocation.InvocationReadEnd(); uint32_t respTrack; std::string respTrackDuration; std::string respTrackMetaData; std::string respTrackURI; std::string respRelTime; std::string respAbsTime; int32_t respRelCount; int32_t respAbsCount; DvInvocationStd invocation(aInvocation); GetPositionInfo(invocation, InstanceID, respTrack, respTrackDuration, respTrackMetaData, respTrackURI, respRelTime, respAbsTime, respRelCount, respAbsCount); aInvocation.InvocationWriteStart(); DviInvocationResponseUint respWriterTrack(aInvocation, "Track"); respWriterTrack.Write(respTrack); DviInvocationResponseString respWriterTrackDuration(aInvocation, "TrackDuration"); Brn buf_TrackDuration((const TByte*)respTrackDuration.c_str(), (TUint)respTrackDuration.length()); respWriterTrackDuration.Write(buf_TrackDuration); aInvocation.InvocationWriteStringEnd("TrackDuration"); DviInvocationResponseString respWriterTrackMetaData(aInvocation, "TrackMetaData"); Brn buf_TrackMetaData((const TByte*)respTrackMetaData.c_str(), (TUint)respTrackMetaData.length()); respWriterTrackMetaData.Write(buf_TrackMetaData); aInvocation.InvocationWriteStringEnd("TrackMetaData"); DviInvocationResponseString respWriterTrackURI(aInvocation, "TrackURI"); Brn buf_TrackURI((const TByte*)respTrackURI.c_str(), (TUint)respTrackURI.length()); respWriterTrackURI.Write(buf_TrackURI); aInvocation.InvocationWriteStringEnd("TrackURI"); DviInvocationResponseString respWriterRelTime(aInvocation, "RelTime"); Brn buf_RelTime((const TByte*)respRelTime.c_str(), (TUint)respRelTime.length()); respWriterRelTime.Write(buf_RelTime); aInvocation.InvocationWriteStringEnd("RelTime"); DviInvocationResponseString respWriterAbsTime(aInvocation, "AbsTime"); Brn buf_AbsTime((const TByte*)respAbsTime.c_str(), (TUint)respAbsTime.length()); respWriterAbsTime.Write(buf_AbsTime); aInvocation.InvocationWriteStringEnd("AbsTime"); DviInvocationResponseInt respWriterRelCount(aInvocation, "RelCount"); respWriterRelCount.Write(respRelCount); DviInvocationResponseInt respWriterAbsCount(aInvocation, "AbsCount"); respWriterAbsCount.Write(respAbsCount); aInvocation.InvocationWriteEnd(); }
void DvProviderAvOpenhomeOrgCredentials1C::DoClear(IDviInvocation& aInvocation) { DvInvocationCPrivate invocationWrapper(aInvocation); IDvInvocationC* invocationC; void* invocationCPtr; invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr); aInvocation.InvocationReadStart(); Brhz Id; aInvocation.InvocationReadString("Id", Id); aInvocation.InvocationReadEnd(); DviInvocation invocation(aInvocation); ASSERT(iCallbackClear != NULL); if (0 != iCallbackClear(iPtrClear, invocationC, invocationCPtr, (const char*)Id.Ptr())) { invocation.Error(502, Brn("Action failed")); return; } invocation.StartResponse(); invocation.EndResponse(); }
void DvProviderOpenhomeOrgSubscriptionLongPoll1C::DoUnsubscribe(IDviInvocation& aInvocation) { DvInvocationCPrivate invocationWrapper(aInvocation); IDvInvocationC* invocationC; void* invocationCPtr; invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr); aInvocation.InvocationReadStart(); Brhz Sid; aInvocation.InvocationReadString("Sid", Sid); aInvocation.InvocationReadEnd(); DviInvocation invocation(aInvocation); ASSERT(iCallbackUnsubscribe != NULL); if (0 != iCallbackUnsubscribe(iPtrUnsubscribe, invocationC, invocationCPtr, (const char*)Sid.Ptr())) { invocation.Error(502, Brn("Action failed")); return; } invocation.StartResponse(); invocation.EndResponse(); }
void DvProviderUpnpOrgConnectionManager2C::DoGetCurrentConnectionIDs(IDviInvocation& aInvocation, TUint aVersion) { aInvocation.InvocationReadStart(); aInvocation.InvocationReadEnd(); InvocationResponse resp(aInvocation); char* ConnectionIDs; ASSERT(iCallbackGetCurrentConnectionIDs != NULL); if (0 != iCallbackGetCurrentConnectionIDs(iPtrGetCurrentConnectionIDs, aVersion, &ConnectionIDs)) { resp.Error(502, Brn("Action failed")); return; } InvocationResponseString respConnectionIDs(aInvocation, "ConnectionIDs"); resp.Start(); Brhz bufConnectionIDs((const TChar*)ConnectionIDs); OhNetFreeExternal(ConnectionIDs); respConnectionIDs.Write(bufConnectionIDs); respConnectionIDs.WriteFlush(); resp.End(); }
void DvProviderUpnpOrgContentDirectory1C::DoDestroyObject(IDviInvocation& aInvocation) { DvInvocationCPrivate invocationWrapper(aInvocation); IDvInvocationC* invocationC; void* invocationCPtr; invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr); aInvocation.InvocationReadStart(); Brhz ObjectID; aInvocation.InvocationReadString("ObjectID", ObjectID); aInvocation.InvocationReadEnd(); DviInvocation invocation(aInvocation); ASSERT(iCallbackDestroyObject != NULL); if (0 != iCallbackDestroyObject(iPtrDestroyObject, invocationC, invocationCPtr, (const char*)ObjectID.Ptr())) { invocation.Error(502, Brn("Action failed")); return; } invocation.StartResponse(); invocation.EndResponse(); }
void DvProviderUpnpOrgContentDirectory1C::DoDeleteResource(IDviInvocation& aInvocation) { DvInvocationCPrivate invocationWrapper(aInvocation); IDvInvocationC* invocationC; void* invocationCPtr; invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr); aInvocation.InvocationReadStart(); Brhz ResourceURI; aInvocation.InvocationReadString("ResourceURI", ResourceURI); aInvocation.InvocationReadEnd(); DviInvocation invocation(aInvocation); ASSERT(iCallbackDeleteResource != NULL); if (0 != iCallbackDeleteResource(iPtrDeleteResource, invocationC, invocationCPtr, (const char*)ResourceURI.Ptr())) { invocation.Error(502, Brn("Action failed")); return; } invocation.StartResponse(); invocation.EndResponse(); }
void DvProviderAvOpenhomeOrgInfo1C::DoMetatext(IDviInvocation& aInvocation, TUint aVersion) { aInvocation.InvocationReadStart(); aInvocation.InvocationReadEnd(); InvocationResponse resp(aInvocation); char* Value; ASSERT(iCallbackMetatext != NULL); if (0 != iCallbackMetatext(iPtrMetatext, aVersion, &Value)) { resp.Error(502, Brn("Action failed")); return; } InvocationResponseString respValue(aInvocation, "Value"); resp.Start(); Brhz bufValue((const TChar*)Value); OhNetFreeExternal(Value); respValue.Write(bufValue); respValue.WriteFlush(); resp.End(); }
void DvProviderAvOpenhomeOrgRadio1C::DoSetId(IDviInvocation& aInvocation) { DvInvocationCPrivate invocationWrapper(aInvocation); IDvInvocationC* invocationC; void* invocationCPtr; invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr); aInvocation.InvocationReadStart(); TUint Value = aInvocation.InvocationReadUint("Value"); Brhz Uri; aInvocation.InvocationReadString("Uri", Uri); aInvocation.InvocationReadEnd(); DviInvocation invocation(aInvocation); ASSERT(iCallbackSetId != NULL); if (0 != iCallbackSetId(iPtrSetId, invocationC, invocationCPtr, Value, (const char*)Uri.Ptr())) { invocation.Error(502, Brn("Action failed")); return; } invocation.StartResponse(); invocation.EndResponse(); }
void DvProviderAvOpenhomeOrgRadio1C::DoChannelsMax(IDviInvocation& aInvocation) { DvInvocationCPrivate invocationWrapper(aInvocation); IDvInvocationC* invocationC; void* invocationCPtr; invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr); aInvocation.InvocationReadStart(); aInvocation.InvocationReadEnd(); DviInvocation invocation(aInvocation); uint32_t Value; ASSERT(iCallbackChannelsMax != NULL); if (0 != iCallbackChannelsMax(iPtrChannelsMax, invocationC, invocationCPtr, &Value)) { invocation.Error(502, Brn("Action failed")); return; } DviInvocationResponseUint respValue(aInvocation, "Value"); invocation.StartResponse(); respValue.Write(Value); invocation.EndResponse(); }
void DvProviderAvOpenhomeOrgCredentials1C::DoGetSequenceNumber(IDviInvocation& aInvocation) { DvInvocationCPrivate invocationWrapper(aInvocation); IDvInvocationC* invocationC; void* invocationCPtr; invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr); aInvocation.InvocationReadStart(); aInvocation.InvocationReadEnd(); DviInvocation invocation(aInvocation); uint32_t SequenceNumber; ASSERT(iCallbackGetSequenceNumber != NULL); if (0 != iCallbackGetSequenceNumber(iPtrGetSequenceNumber, invocationC, invocationCPtr, &SequenceNumber)) { invocation.Error(502, Brn("Action failed")); return; } DviInvocationResponseUint respSequenceNumber(aInvocation, "SequenceNumber"); invocation.StartResponse(); respSequenceNumber.Write(SequenceNumber); invocation.EndResponse(); }
void DviService::Invoke(IDviInvocation& aInvocation, TUint aVersion, const Brx& aActionName) { for (TUint i=0; i<iDvActions.size(); i++) { if (iDvActions[i].Action()->Name() == aActionName) { iDvActions[i].Functor()(aInvocation, aVersion); return; } } aInvocation.InvocationReportError(501, Brn("Action not implemented")); }
void DvProviderUpnpOrgAVTransport1C::DoPlay(IDviInvocation& aInvocation) { DvInvocationCPrivate invocationWrapper(aInvocation); IDvInvocationC* invocationC; void* invocationCPtr; invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr); aInvocation.InvocationReadStart(); TUint InstanceID = aInvocation.InvocationReadUint("InstanceID"); Brhz Speed; aInvocation.InvocationReadString("Speed", Speed); aInvocation.InvocationReadEnd(); DviInvocation invocation(aInvocation); ASSERT(iCallbackPlay != NULL); if (0 != iCallbackPlay(iPtrPlay, invocationC, invocationCPtr, InstanceID, (const char*)Speed.Ptr())) { invocation.Error(502, Brn("Action failed")); return; } invocation.StartResponse(); invocation.EndResponse(); }
void DvProviderUpnpOrgAVTransport1C::DoSetRecordQualityMode(IDviInvocation& aInvocation) { DvInvocationCPrivate invocationWrapper(aInvocation); IDvInvocationC* invocationC; void* invocationCPtr; invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr); aInvocation.InvocationReadStart(); TUint InstanceID = aInvocation.InvocationReadUint("InstanceID"); Brhz NewRecordQualityMode; aInvocation.InvocationReadString("NewRecordQualityMode", NewRecordQualityMode); aInvocation.InvocationReadEnd(); DviInvocation invocation(aInvocation); ASSERT(iCallbackSetRecordQualityMode != NULL); if (0 != iCallbackSetRecordQualityMode(iPtrSetRecordQualityMode, invocationC, invocationCPtr, InstanceID, (const char*)NewRecordQualityMode.Ptr())) { invocation.Error(502, Brn("Action failed")); return; } invocation.StartResponse(); invocation.EndResponse(); }
void DvProviderLinnCoUkCloud1C::DoGetConnected(IDviInvocation& aInvocation) { DvInvocationCPrivate invocationWrapper(aInvocation); IDvInvocationC* invocationC; void* invocationCPtr; invocationWrapper.GetInvocationC(&invocationC, &invocationCPtr); aInvocation.InvocationReadStart(); aInvocation.InvocationReadEnd(); DviInvocation invocation(aInvocation); uint32_t Connected; ASSERT(iCallbackGetConnected != NULL); if (0 != iCallbackGetConnected(iPtrGetConnected, invocationC, invocationCPtr, &Connected)) { invocation.Error(502, Brn("Action failed")); return; } DviInvocationResponseBool respConnected(aInvocation, "Connected"); invocation.StartResponse(); respConnected.Write((Connected!=0)); invocation.EndResponse(); }