CommonAPI的使用1
客户端中使用
if (pSource->isUSB())
{
swapSongs(categoryType);
bool isFolderUpDownAvailable{false};
if (categoryType == CategoryType::FOLDER_AUDIO)
{
CommonAPI::CallStatus callStatus{ CommonAPI::CallStatus::UNKNOWN };
m_mediaPlayerProxy->getIsFolderUpDownAvailableAttribute().getValue(callStatus, isFolderUpDownAvailable);
if (callStatus != CommonAPI::CallStatus::SUCCESS)
{
isFolderUpDownAvailable = false;
}
}
m_indications.SetIndication(IAudioPlayer::IND_FolderUpDownAvailable, isFolderUpDownAvailable);
m_pAudioPlayerEvent->notifyIndicationsChanged(m_indications);
}
FIDL文件中的写法
package com.clarion.ivi.media
import com.clarion.ivi.media.* from "MediaCAPITypes.fidl"
import com.clarion.ivi.media.* from "PlayerTypes.fidl"
interface MediaPlayer
{
version { major 1 minor 0 }
attribute Boolean isFolderUpDownAvailable readonly
服务端端中使用
void MediaStubAttributeHandler::IsFolderDownUpAvailableAttributeHandler::acceptEvent(const MediaEvent& event)
{
DLT_LOG_FCN_CXX(StubAdapterContext, DLT_LOG_DEBUG, "Process event:", static_cast(event.evID));
switch (event.evID)
{
case eMediaEvents::MEDIAE_DM_DEVICE_DISCONNECTED:
{
const auto strongMediaEvent = getEvent<:mediae_dm_device_disconnected>(event);
if (strongMediaEvent.device.type == MediaTypes::DeviceType::USB)
{
DLT_LOG_FCN_CXX(StubAdapterContext, DLT_LOG_DEBUG
, "FolderUpDown disabled for"
, "source id:", strongMediaEvent.device.id);
m_mediaPlayerStub->setIsFolderUpDownAvailableAttribute(false);
}
break;
}
case eMediaEvents::MEDIAE_IS_FOLDER_UP_DOWN:
{
auto strongMediaEvent = getEvent<:mediae_is_folder_up_down>(event);
DLT_LOG_FCN_CXX(StubAdapterContext, DLT_LOG_DEBUG
, "isFolderUpDown available:", strongMediaEvent.isFolderUpDown);
m_mediaPlayerStub->setIsFolderUpDownAvailableAttribute(strongMediaEvent.isFolderUpDown);
break;
}
default:
break;
}
}
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.e1idc.net