Lines Matching refs:pkt
79 std::shared_ptr<VendorPacket> pkt) { in VendorPacketHandler() argument
81 DEVICE_VLOG(3) << __func__ << ": pdu=" << pkt->GetCommandPdu(); in VendorPacketHandler()
83 if (!pkt->IsValid()) { in VendorPacketHandler()
91 if (pkt->GetCType() == CType::NOT_IMPLEMENTED) { in VendorPacketHandler()
95 if (pkt->GetCType() >= CType::ACCEPTED) { in VendorPacketHandler()
96 switch (pkt->GetCommandPdu()) { in VendorPacketHandler()
100 Packet::Specialize<RegisterNotificationResponse>(pkt); in VendorPacketHandler()
117 << __func__ << ": Unhandled Response: pdu=" << pkt->GetCommandPdu(); in VendorPacketHandler()
123 switch (pkt->GetCommandPdu()) { in VendorPacketHandler()
126 Packet::Specialize<GetCapabilitiesRequest>(pkt)); in VendorPacketHandler()
131 Packet::Specialize<RegisterNotificationRequest>(pkt)); in VendorPacketHandler()
135 … auto get_element_attributes_request_pkt = Packet::Specialize<GetElementAttributesRequest>(pkt); in VendorPacketHandler()
139 auto response = RejectBuilder::MakeBuilder(pkt->GetCommandPdu(), Status::INVALID_PARAMETER); in VendorPacketHandler()
153 HandlePlayItem(label, Packet::Specialize<PlayItemRequest>(pkt)); in VendorPacketHandler()
161 auto set_addressed_player_request = Packet::Specialize<SetAddressedPlayerRequest>(pkt); in VendorPacketHandler()
165 auto response = RejectBuilder::MakeBuilder(pkt->GetCommandPdu(), Status::INVALID_PARAMETER); in VendorPacketHandler()
175 DEVICE_LOG(ERROR) << "Unhandled Vendor Packet: " << pkt->ToString(); in VendorPacketHandler()
177 (CommandPdu)pkt->GetCommandPdu(), Status::INVALID_COMMAND); in VendorPacketHandler()
184 uint8_t label, const std::shared_ptr<GetCapabilitiesRequest>& pkt) { in HandleGetCapabilities() argument
186 << ": capability=" << pkt->GetCapabilityRequested(); in HandleGetCapabilities()
188 if (!pkt->IsValid()) { in HandleGetCapabilities()
190 auto response = RejectBuilder::MakeBuilder(pkt->GetCommandPdu(), Status::INVALID_PARAMETER); in HandleGetCapabilities()
195 switch (pkt->GetCapabilityRequested()) { in HandleGetCapabilities()
222 << pkt->GetCapabilityRequested(); in HandleGetCapabilities()
231 uint8_t label, const std::shared_ptr<RegisterNotificationRequest>& pkt) { in HandleNotification() argument
232 if (!pkt->IsValid()) { in HandleNotification()
234 auto response = RejectBuilder::MakeBuilder(pkt->GetCommandPdu(), in HandleNotification()
240 DEVICE_VLOG(4) << __func__ << ": event=" << pkt->GetEventRegistered(); in HandleNotification()
242 switch (pkt->GetEventRegistered()) { in HandleNotification()
256 play_pos_interval_ = pkt->GetInterval(); in HandleNotification()
299 << pkt->GetEventRegistered(); in HandleNotification()
301 (CommandPdu)pkt->GetCommandPdu(), Status::INVALID_PARAMETER); in HandleNotification()
336 uint8_t label, const std::shared_ptr<RegisterNotificationResponse>& pkt) { in HandleVolumeChanged() argument
337 DEVICE_VLOG(1) << __func__ << ": interim=" << pkt->IsInterim(); in HandleVolumeChanged()
339 if (!pkt->IsValid()) { in HandleVolumeChanged()
341 auto response = RejectBuilder::MakeBuilder(pkt->GetCommandPdu(), Status::INVALID_PARAMETER); in HandleVolumeChanged()
351 if (pkt->GetCType() == CType::REJECTED) { in HandleVolumeChanged()
360 if (!pkt->IsInterim()) { in HandleVolumeChanged()
368 volume_ = pkt->GetVolume(); in HandleVolumeChanged()
384 volume_ = pkt->GetVolume(); in HandleVolumeChanged()
585 uint8_t label, std::shared_ptr<GetElementAttributesRequest> pkt, in GetElementAttributesResponse() argument
589 auto get_element_attributes_pkt = pkt; in GetElementAttributesResponse()
612 void Device::MessageReceived(uint8_t label, std::shared_ptr<Packet> pkt) { in MessageReceived() argument
613 if (!pkt->IsValid()) { in MessageReceived()
620 DEVICE_VLOG(4) << __func__ << ": opcode=" << pkt->GetOpcode(); in MessageReceived()
622 switch (pkt->GetOpcode()) { in MessageReceived()
630 auto pass_through_packet = Packet::Specialize<PassThroughPacket>(pkt); in MessageReceived()
678 auto vendor_pkt = Packet::Specialize<VendorPacket>(pkt); in MessageReceived()
685 std::shared_ptr<PlayItemRequest> pkt) { in HandlePlayItem() argument
686 DEVICE_VLOG(2) << __func__ << ": scope=" << pkt->GetScope() in HandlePlayItem()
687 << " uid=" << pkt->GetUid(); in HandlePlayItem()
689 if (!pkt->IsValid()) { in HandlePlayItem()
691 auto response = RejectBuilder::MakeBuilder(pkt->GetCommandPdu(), Status::INVALID_PARAMETER); in HandlePlayItem()
697 switch (pkt->GetScope()) { in HandlePlayItem()
699 media_id = now_playing_ids_.get_media_id(pkt->GetUid()); in HandlePlayItem()
702 media_id = vfs_ids_.get_media_id(pkt->GetUid()); in HandlePlayItem()
717 pkt->GetScope() == Scope::NOW_PLAYING, media_id); in HandlePlayItem()
724 uint8_t label, std::shared_ptr<SetAddressedPlayerRequest> pkt, in HandleSetAddressedPlayer() argument
726 DEVICE_VLOG(2) << __func__ << ": PlayerId=" << pkt->GetPlayerId(); in HandleSetAddressedPlayer()
728 if (curr_player != pkt->GetPlayerId()) { in HandleSetAddressedPlayer()
742 std::shared_ptr<BrowsePacket> pkt) { in BrowseMessageReceived() argument
743 if (!pkt->IsValid()) { in BrowseMessageReceived()
750 DEVICE_VLOG(1) << __func__ << ": pdu=" << pkt->GetPdu(); in BrowseMessageReceived()
752 switch (pkt->GetPdu()) { in BrowseMessageReceived()
755 Packet::Specialize<SetBrowsedPlayerRequest>(pkt)); in BrowseMessageReceived()
759 Packet::Specialize<GetFolderItemsRequest>(pkt)); in BrowseMessageReceived()
762 HandleChangePath(label, Packet::Specialize<ChangePathRequest>(pkt)); in BrowseMessageReceived()
766 label, Packet::Specialize<GetItemAttributesRequest>(pkt)); in BrowseMessageReceived()
770 label, Packet::Specialize<GetTotalNumberOfItemsRequest>(pkt)); in BrowseMessageReceived()
773 DEVICE_LOG(WARNING) << __func__ << ": " << pkt->GetPdu(); in BrowseMessageReceived()
782 std::shared_ptr<GetFolderItemsRequest> pkt) { in HandleGetFolderItems() argument
783 if (!pkt->IsValid()) { in HandleGetFolderItems()
792 DEVICE_VLOG(2) << __func__ << ": scope=" << pkt->GetScope(); in HandleGetFolderItems()
794 switch (pkt->GetScope()) { in HandleGetFolderItems()
798 weak_ptr_factory_.GetWeakPtr(), label, pkt)); in HandleGetFolderItems()
804 weak_ptr_factory_.GetWeakPtr(), label, pkt)); in HandleGetFolderItems()
809 weak_ptr_factory_.GetWeakPtr(), label, pkt)); in HandleGetFolderItems()
812 DEVICE_LOG(ERROR) << __func__ << ": " << pkt->GetScope(); in HandleGetFolderItems()
820 uint8_t label, std::shared_ptr<GetTotalNumberOfItemsRequest> pkt) { in HandleGetTotalNumberOfItems() argument
821 if (!pkt->IsValid()) { in HandleGetTotalNumberOfItems()
828 DEVICE_VLOG(2) << __func__ << ": scope=" << pkt->GetScope(); in HandleGetTotalNumberOfItems()
830 switch (pkt->GetScope()) { in HandleGetTotalNumberOfItems()
849 DEVICE_LOG(ERROR) << __func__ << ": " << pkt->GetScope(); in HandleGetTotalNumberOfItems()
882 std::shared_ptr<ChangePathRequest> pkt) { in HandleChangePath() argument
883 if (!pkt->IsValid()) { in HandleChangePath()
890 DEVICE_VLOG(2) << __func__ << ": direction=" << pkt->GetDirection() in HandleChangePath()
891 << " uid=" << loghex(pkt->GetUid()); in HandleChangePath()
893 if (pkt->GetDirection() == Direction::DOWN && in HandleChangePath()
894 vfs_ids_.get_media_id(pkt->GetUid()) == "") { in HandleChangePath()
896 << ": No item found for UID=" << pkt->GetUid(); in HandleChangePath()
903 if (pkt->GetDirection() == Direction::DOWN) { in HandleChangePath()
904 current_path_.push(vfs_ids_.get_media_id(pkt->GetUid())); in HandleChangePath()
925 label, pkt)); in HandleChangePath()
929 std::shared_ptr<ChangePathRequest> pkt, in ChangePathResponse() argument
939 uint8_t label, std::shared_ptr<GetItemAttributesRequest> pkt) { in HandleGetItemAttributes() argument
940 if (!pkt->IsValid()) { in HandleGetItemAttributes()
947 DEVICE_VLOG(2) << __func__ << ": scope=" << pkt->GetScope() in HandleGetItemAttributes()
948 << " uid=" << loghex(pkt->GetUid()) in HandleGetItemAttributes()
949 << " uid counter=" << loghex(pkt->GetUidCounter()); in HandleGetItemAttributes()
950 if (pkt->GetUidCounter() != 0x0000) { // For database unaware player, use 0 in HandleGetItemAttributes()
958 switch (pkt->GetScope()) { in HandleGetItemAttributes()
962 weak_ptr_factory_.GetWeakPtr(), label, pkt)); in HandleGetItemAttributes()
972 weak_ptr_factory_.GetWeakPtr(), label, pkt)); in HandleGetItemAttributes()
981 uint8_t label, std::shared_ptr<GetItemAttributesRequest> pkt, in GetItemAttributesNowPlayingResponse() argument
983 DEVICE_VLOG(2) << __func__ << ": uid=" << loghex(pkt->GetUid()); in GetItemAttributesNowPlayingResponse()
987 auto media_id = now_playing_ids_.get_media_id(pkt->GetUid()); in GetItemAttributesNowPlayingResponse()
1001 auto attributes_requested = pkt->GetAttributesRequested(); in GetItemAttributesNowPlayingResponse()
1020 uint8_t label, std::shared_ptr<GetItemAttributesRequest> pkt, in GetItemAttributesVFSResponse() argument
1022 DEVICE_VLOG(2) << __func__ << ": uid=" << loghex(pkt->GetUid()); in GetItemAttributesVFSResponse()
1024 auto media_id = vfs_ids_.get_media_id(pkt->GetUid()); in GetItemAttributesVFSResponse()
1046 auto attributes_requested = pkt->GetAttributesRequested(); in GetItemAttributesVFSResponse()
1080 uint8_t label, std::shared_ptr<GetFolderItemsRequest> pkt, in GetMediaPlayerListResponse() argument
1106 for (size_t i = pkt->GetStartItem(); in GetMediaPlayerListResponse()
1107 i <= pkt->GetEndItem() && i < players.size(); i++) { in GetMediaPlayerListResponse()
1129 std::shared_ptr<GetFolderItemsRequest> pkt, in GetVFSListResponse() argument
1131 DEVICE_VLOG(2) << __func__ << ": start_item=" << pkt->GetStartItem() in GetVFSListResponse()
1132 << " end_item=" << pkt->GetEndItem(); in GetVFSListResponse()
1153 for (auto i = pkt->GetStartItem(); i <= pkt->GetEndItem() && i < items.size(); in GetVFSListResponse()
1170 if (pkt->GetNumAttributes() == 0x00) { // All attributes requested in GetVFSListResponse()
1174 filter_attributes_requested(song, pkt->GetAttributesRequested()); in GetVFSListResponse()
1187 uint8_t label, std::shared_ptr<GetFolderItemsRequest> pkt, in GetNowPlayingListResponse() argument
1198 for (size_t i = pkt->GetStartItem(); in GetNowPlayingListResponse()
1199 i <= pkt->GetEndItem() && i < song_list.size(); i++) { in GetNowPlayingListResponse()
1206 if (pkt->GetNumAttributes() == 0x00) { in GetNowPlayingListResponse()
1210 filter_attributes_requested(song, pkt->GetAttributesRequested()); in GetNowPlayingListResponse()
1222 uint8_t label, std::shared_ptr<SetBrowsedPlayerRequest> pkt) { in HandleSetBrowsedPlayer() argument
1223 if (!pkt->IsValid()) { in HandleSetBrowsedPlayer()
1230 DEVICE_VLOG(2) << __func__ << ": player_id=" << pkt->GetPlayerId(); in HandleSetBrowsedPlayer()
1232 pkt->GetPlayerId(), in HandleSetBrowsedPlayer()
1234 weak_ptr_factory_.GetWeakPtr(), label, pkt)); in HandleSetBrowsedPlayer()
1238 uint8_t label, std::shared_ptr<SetBrowsedPlayerRequest> pkt, bool success, in SetBrowsedPlayerResponse() argument
1250 curr_browsed_player_id_ = pkt->GetPlayerId(); in SetBrowsedPlayerResponse()