AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Bluetooth.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ACSDKBLUETOOTH_BLUETOOTH_H_
17 #define ACSDKBLUETOOTH_BLUETOOTH_H_
18 
19 #include <atomic>
20 #include <deque>
21 #include <functional>
22 #include <map>
23 #include <memory>
24 #include <string>
25 #include <queue>
26 #include <unordered_set>
27 
66 
70 
71 namespace alexaClientSDK {
72 namespace acsdkBluetooth {
73 
75 static const constexpr char* BLUETOOTH_MEDIA_PLAYER_NAME = "BluetoothMediaPlayer";
76 
120  : public std::enable_shared_from_this<Bluetooth>
129 public:
131 
135  enum class StreamingState {
137  INACTIVE,
138 
140  PAUSED,
141 
144 
147 
149  ACTIVE
150  };
151 
155  enum class FocusTransitionState {
157  NONE,
158 
160  INTERNAL,
161 
167  PENDING_INTERNAL,
168 
170  EXTERNAL
171  };
172 
185  ACTIVE,
186 
195  PENDING_INACTIVE,
196 
205  INACTIVE
206  };
207 
229  static std::shared_ptr<Bluetooth> createBluetoothCapabilityAgent(
230  std::shared_ptr<avsCommon::sdkInterfaces::ContextManagerInterface> contextManager,
231  std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface> messageSender,
232  std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface> exceptionEncounteredSender,
233  std::shared_ptr<acsdkBluetoothInterfaces::BluetoothStorageInterface> bluetoothStorage,
234  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceManagerInterface> deviceManager,
235  std::shared_ptr<avsCommon::utils::bluetooth::BluetoothEventBus> eventBus,
236  std::shared_ptr<registrationManager::CustomerDataManagerInterface> customerDataManager,
237  std::shared_ptr<acsdkApplicationAudioPipelineFactoryInterfaces::ApplicationAudioPipelineFactoryInterface>
238  audioPipelineFactory,
242  std::shared_ptr<acsdkShutdownManagerInterfaces::ShutdownNotifierInterface> shutdownNotifier,
246  std::shared_ptr<acsdkBluetoothInterfaces::BluetoothDeviceConnectionRulesProviderInterface>
247  connectionRulesProvider,
248  std::shared_ptr<BluetoothMediaInputTransformer> mediaInputTransformer,
249  std::shared_ptr<acsdkBluetoothInterfaces::BluetoothNotifierInterface> bluetoothNotifier);
250 
254  void handleDirectiveImmediately(std::shared_ptr<avsCommon::avs::AVSDirective> directive) override;
255  void preHandleDirective(std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo> info) override;
256  void handleDirective(std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo> info) override;
257  void cancelDirective(std::shared_ptr<avsCommon::avs::CapabilityAgent::DirectiveInfo> info) override;
260 
263  void setDiscoverableMode(bool discoverable) override;
264  void setScanMode(bool scanning) override;
265  void pair(const std::string& addr) override;
266  void unpair(const std::string& addr) override;
267  void connect(const std::string& addr) override;
268  void disconnect(const std::string& addr) override;
269  void setPairingPin(const std::string& addr, const std::string& pin) override;
271 
274  std::unordered_set<std::shared_ptr<avsCommon::avs::CapabilityConfiguration>> getCapabilityConfigurations() override;
276 
277  // @name ContextRequester Functions
279  void onContextAvailable(const std::string& jsonContext) override;
282 
283  // @name RequiresShutdown Functions
285  void doShutdown() override;
287 
290  void onFirstByteRead(
293  void onPlaybackStarted(
296  void onPlaybackStopped(
299  void onPlaybackFinished(
302  void onPlaybackError(
305  std::string error,
308 
311  void clearData() override;
313 protected:
316  void onEventFired(const avsCommon::utils::bluetooth::BluetoothEvent& event) override;
318 
319 private:
340  Bluetooth(
341  std::shared_ptr<avsCommon::sdkInterfaces::ContextManagerInterface> contextManager,
342  std::shared_ptr<avsCommon::sdkInterfaces::FocusManagerInterface> focusManager,
343  std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface> messageSender,
344  std::shared_ptr<avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface> exceptionEncounteredSender,
345  std::shared_ptr<acsdkBluetoothInterfaces::BluetoothStorageInterface> bluetoothStorage,
346  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceManagerInterface> deviceManager,
347  std::shared_ptr<avsCommon::utils::bluetooth::BluetoothEventBus> eventBus,
348  std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface> mediaPlayer,
349  std::shared_ptr<registrationManager::CustomerDataManagerInterface> customerDataManager,
350  std::unordered_set<std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceConnectionRuleInterface>>
351  enabledConnectionRules,
352  std::shared_ptr<avsCommon::sdkInterfaces::ChannelVolumeInterface> bluetoothChannelVolumeInterface,
353  std::shared_ptr<BluetoothMediaInputTransformer> mediaInputTransformer,
354  std::shared_ptr<acsdkBluetoothInterfaces::BluetoothNotifierInterface> bluetoothNotifier);
355 
361  bool init();
362 
367  void syncWithDeviceManager();
368 
369  // TODO ACSDK-1392: Optimize by updating the context only when there is a delta.
371  void executeUpdateContext();
372 
382  bool extractAvsProfiles(
383  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device,
384  rapidjson::Document::AllocatorType& allocator,
385  rapidjson::Value* supportedProfiles);
386 
392  void executeSetHandlingCompleted(std::shared_ptr<DirectiveInfo> info);
393 
399  void removeDirective(std::shared_ptr<DirectiveInfo> info);
400 
408  void sendExceptionEncountered(
409  std::shared_ptr<CapabilityAgent::DirectiveInfo> info,
410  const std::string& message,
412 
414  void executeEnterForeground();
415 
417  void executeEnterBackground(avsCommon::avs::MixingBehavior behavior);
418 
420  void executeEnterNone();
421 
425  void executeHandleEnterDiscoverableMode();
426 
430  void executeHandleExitDiscoverableMode();
431 
435  void executeHandleScanDevices();
436 
443  bool executeHandlePairDevices(const std::unordered_set<std::string>& uuids);
444 
451  bool executeHandleUnpairDevices(const std::unordered_set<std::string>& uuids);
452 
460  bool executeHandleConnectByDeviceIds(const std::unordered_set<std::string>& uuids);
461 
469  bool executeHandleDisconnectDevices(const std::unordered_set<std::string>& uuids);
470 
477  bool executeSetDiscoverableMode(bool discoverable);
478 
486  bool executeSetScanMode(bool scanning, bool shouldReport = true);
487 
494  bool executePairDevices(const std::unordered_set<std::string>& uuids);
495 
502  bool executeUnpairDevices(const std::unordered_set<std::string>& uuids);
503 
510  std::map<std::string, std::string> executeSetDeviceCategories(
511  const std::map<std::string, std::string>& uuidCategoryMap);
512 
519  void executeConnectByDeviceIds(const std::unordered_set<std::string>& uuids);
520 
529  void executeConnectByProfile(const std::string& profileName, const std::string& profileVersion);
530 
537  void executeDisconnectDevices(const std::unordered_set<std::string>& uuids);
538 
545  void executeSetPairingPin(const std::string& addr, const std::string& pin);
546 
553  void executeOnDeviceDisconnect(
554  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device,
555  avsCommon::avs::Requester requester);
556 
563  void executeOnDeviceConnect(
564  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device,
565  bool shouldNotifyConnection = true);
566 
573  bool executeFunctionOnDevice(
574  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface>& device,
575  std::function<std::future<bool>(
576  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface>&)> function);
577 
583  void executePlay(std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
584 
590  void executeStop(std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
591 
597  void executeNext(std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
598 
604  void executePrevious(std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
605 
607  void executeInitializeMediaSource();
608 
610  void cleanupMediaSource();
611 
613  void executeAbortMediaPlayback();
614 
622  void setCurrentStream(std::shared_ptr<avsCommon::utils::bluetooth::FormattedAudioStreamAdapter> stream);
623 
626 
627  void onFormattedAudioStreamAdapterData(
628  avsCommon::utils::AudioFormat audioFormat,
629  const unsigned char* buffer,
630  size_t size) override;
631 
633 
640  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> retrieveDeviceByMac(
641  const std::string& mac);
642 
649  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> retrieveDeviceByUuid(
650  const std::string& uuid);
651 
659  bool retrieveDeviceCategoryByUuid(const std::string& uuid, DeviceCategory* category);
660 
666  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceConnectionRuleInterface>
667  retrieveConnectionRuleByUuid(const std::string& uuid);
668 
677  bool retrieveUuid(const std::string& mac, std::string* uuid);
678 
685  std::unordered_set<std::string> retrieveUuidsFromConnectionPayload(const rapidjson::Document& payload);
686 
688  void clearUnusedUuids();
689 
696  void executeSendEvent(const std::string& eventName, const std::string& eventPayload);
697 
705  void executeQueueEventAndRequestContext(const std::string& eventName, const std::string& eventPayload);
706 
713  void executeSendScanDevicesReport(
714  const std::list<std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface>>& devices,
715  bool hasMore);
716 
718  void executeSendScanDevicesFailed();
719 
721  void executeSendEnterDiscoverableModeSucceeded();
722 
724  void executeSendEnterDiscoverableModeFailed();
725 
731  void executeSendPairDevicesSucceeded(
732  const std::unordered_set<std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface>>&
733  devices);
734 
741  void executeSendPairFailedEvent(const std::string& eventName, const std::unordered_set<std::string>& uuids);
742 
748  void executeSendPairDevicesFailed(const std::unordered_set<std::string>& uuids);
749 
755  void executeSendUnpairDevicesSucceeded(
756  const std::unordered_set<std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface>>&
757  devices);
758 
764  void executeSendUnpairDevicesFailed(const std::unordered_set<std::string>& uuids);
765 
771  void executeSetDeviceCategoriesSucceeded(const std::map<std::string, std::string>& uuidCategoryMap);
772 
778  void executeSetDeviceCategoriesFailed(const std::map<std::string, std::string>& uuidCategoryMap);
779 
786  void executeSendConnectByDeviceIdsSucceeded(
787  const std::unordered_set<std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface>>&
788  devices,
789  avsCommon::avs::Requester requester);
790 
797  void executeSendConnectByDeviceIdsFailed(
798  const std::unordered_set<std::string>& uuids,
799  avsCommon::avs::Requester requester);
800 
808  void executeSendConnectByProfileSucceeded(
809  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device,
810  const std::string& profileName,
811  avsCommon::avs::Requester requester);
812 
820  void executeSendConnectByProfileFailed(const std::string& profileName, avsCommon::avs::Requester requester);
821 
828  void executeSendDisconnectDevicesSucceeded(
829  const std::unordered_set<std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface>>&
830  devices,
831  avsCommon::avs::Requester requester);
832 
840  void executeSendConnectFailedEvent(
841  const std::string& eventName,
842  const std::unordered_set<std::string>& uuids,
843  avsCommon::avs::Requester requester);
844 
851  void executeSendDisconnectDevicesFailed(
852  const std::unordered_set<std::string>& uuids,
853  avsCommon::avs::Requester requester);
854 
861  void executeSendMediaControlEvent(
862  const std::string& eventName,
863  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
864 
870  void executeSendMediaControlPlaySucceeded(
871  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
872 
878  void executeSendMediaControlPlayFailed(
879  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
880 
886  void executeSendMediaControlStopSucceeded(
887  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
888 
894  void executeSendMediaControlStopFailed(
895  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
896 
902  void executeSendMediaControlNextSucceeded(
903  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
904 
910  void executeSendMediaControlNextFailed(
911  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
912 
918  void executeSendMediaControlPreviousSucceeded(
919  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
920 
926  void executeSendMediaControlPreviousFailed(
927  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
928 
935  void executeSendStreamingEvent(
936  const std::string& eventName,
937  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
938 
944  void executeSendStreamingStarted(
945  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
946 
952  void executeSendStreamingEnded(
953  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
954 
958  ObserverInterface::DeviceAttributes generateDeviceAttributes(
959  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
960 
968  template <typename ServiceType>
969  std::shared_ptr<ServiceType> getService(
970  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device);
971 
980  void executeInsertBluetoothEventState(
981  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device,
985 
993  std::shared_ptr<BluetoothEventState> executeRemoveBluetoothEventState(
994  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> device,
996 
1000  void executeRestrictA2DPDevices();
1001 
1006  void executeUnrestrictA2DPDevices();
1007 
1013  void executeAcquireFocus(const std::string& callingMethodName = "");
1014 
1020  void executeReleaseFocus(const std::string& callingMethodName = "");
1021 
1023  std::unordered_set<std::shared_ptr<avsCommon::avs::CapabilityConfiguration>> m_capabilityConfigurations;
1024 
1026  std::shared_ptr<avsCommon::sdkInterfaces::MessageSenderInterface> m_messageSender;
1027 
1029  std::shared_ptr<avsCommon::sdkInterfaces::ContextManagerInterface> m_contextManager;
1030 
1032  std::shared_ptr<avsCommon::sdkInterfaces::FocusManagerInterface> m_focusManager;
1033 
1034  // TODO 1396: Combine @c m_streamingState and @c m_focusState into a single state machine if possible.
1039  StreamingState m_streamingState;
1040 
1044  FocusTransitionState m_focusTransitionState;
1045 
1049  ScanningTransitionState m_scanningTransitionState;
1050 
1052  avsCommon::avs::FocusState m_focusState;
1053 
1056 
1058  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceManagerInterface> m_deviceManager;
1059 
1061  std::queue<std::pair<std::string, std::string>> m_eventQueue;
1062 
1064  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> m_activeA2DPDevice;
1065 
1067  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface> m_disabledA2DPDevice;
1068 
1070  std::vector<std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface>> m_restrictedDevices;
1071 
1073  std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface> m_mediaPlayer;
1074 
1076  std::shared_ptr<acsdkBluetoothInterfaces::BluetoothStorageInterface> m_db;
1077 
1079  std::shared_ptr<avsCommon::utils::bluetooth::BluetoothEventBus> m_eventBus;
1080 
1082  std::shared_ptr<BluetoothMediaInputTransformer> m_mediaInputTransformer;
1083 
1085  std::shared_ptr<avsCommon::utils::bluetooth::FormattedAudioStreamAdapter> m_mediaStream;
1086 
1088  std::shared_ptr<avsCommon::avs::attachment::InProcessAttachment> m_mediaAttachment;
1089 
1091  std::shared_ptr<avsCommon::avs::attachment::AttachmentWriter> m_mediaAttachmentWriter;
1092 
1094  std::shared_ptr<avsCommon::avs::attachment::AttachmentReader> m_mediaAttachmentReader;
1095 
1097  std::map<
1099  std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceConnectionRuleInterface>>
1100  m_enabledConnectionRules;
1101 
1103  std::map<DeviceCategory, std::set<std::shared_ptr<avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceInterface>>>
1104  m_connectedDevices;
1105 
1107  std::map<std::string, std::unordered_set<std::shared_ptr<BluetoothEventState>>> m_bluetoothEventStates;
1108 
1111  std::shared_ptr<avsCommon::sdkInterfaces::ChannelVolumeInterface> m_bluetoothChannelVolumeInterface;
1112 
1114  std::shared_ptr<acsdkBluetoothInterfaces::BluetoothNotifierInterface> m_bluetoothNotifier;
1115 
1117  std::atomic<uint8_t> m_pendingFocusTransitions;
1118 
1121 };
1122 
1130  switch (state) {
1132  return "INACTIVE";
1134  return "PAUSED";
1136  return "PENDING_PAUSED";
1138  return "PENDING_ACTIVE";
1140  return "ACTIVE";
1141  }
1142 
1143  return "UNKNOWN";
1144 }
1145 
1153 inline std::ostream& operator<<(std::ostream& stream, const Bluetooth::StreamingState state) {
1154  return stream << streamingStateToString(state);
1155 }
1156 
1164  switch (state) {
1166  return "NONE";
1168  return "INTERNAL";
1170  return "PENDING_INTERNAL";
1172  return "EXTERNAL";
1173  }
1174 
1175  return "UNKNOWN";
1176 }
1177 
1186 inline std::ostream& operator<<(std::ostream& stream, const Bluetooth::FocusTransitionState state) {
1187  return stream << focusTransitionStateToString(state);
1188 }
1189 
1197  switch (state) {
1199  return "ACTIVE";
1201  return "PENDING_ACTIVE";
1203  return "INACTIVE";
1204  }
1205 
1206  return "UNKNWON";
1207 }
1208 
1217 inline std::ostream& operator<<(std::ostream& stream, const Bluetooth::ScanningTransitionState state) {
1218  return stream << scanningStateToString(state);
1219 }
1220 
1221 } // namespace acsdkBluetooth
1222 } // namespace alexaClientSDK
1223 
1224 #endif // ACSDKBLUETOOTH_BLUETOOTH_H_
void onPlaybackError(avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface::SourceId id, const avsCommon::utils::mediaPlayer::ErrorType &type, std::string error, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
Definition: CapabilityAgent.h:47
avsCommon::avs::DirectiveHandlerConfiguration getConfiguration() const override
MixingBehavior
Definition: MixingBehavior.h:25
void handleDirective(std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
void cancelDirective(std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
void connect(const std::string &addr) override
FocusTransitionState
Definition: Bluetooth.h:155
Focus in Bluetooth class is lost because another class has taken focus.
::std::string string
Definition: gtest-port.h:1097
void disconnect(const std::string &addr) override
ContextRequestError
Definition: ContextRequesterInterface.h:40
Single-thread executor implementation.
Definition: Executor.h:45
ExceptionErrorType
Definition: ExceptionErrorType.h:28
AVRCP Pause is sent, waiting for local playback to stop.
std::string scanningStateToString(Bluetooth::ScanningTransitionState state)
Definition: Bluetooth.h:1196
static const constexpr char * BLUETOOTH_MEDIA_PLAYER_NAME
String to identify the Bluetooth media player to render audio.
Definition: Bluetooth.h:75
FocusState
Definition: FocusState.h:29
void pair(const std::string &addr) override
std::string focusTransitionStateToString(Bluetooth::FocusTransitionState state)
Definition: Bluetooth.h:1163
void setDiscoverableMode(bool discoverable) override
void handleDirectiveImmediately(std::shared_ptr< avsCommon::avs::AVSDirective > directive) override
void setPairingPin(const std::string &addr, const std::string &pin) override
void onFirstByteRead(avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface::SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
void setScanMode(bool scanning) override
std::ostream & operator<<(std::ostream &stream, const Bluetooth::StreamingState state)
Definition: Bluetooth.h:1153
void unpair(const std::string &addr) override
bool Value(const T &value, M matcher)
Definition: gmock-matchers.h:4347
Focus in Bluetooth class is lost because it explicitly released focus.
void onContextAvailable(const std::string &jsonContext) override
std::unordered_map< directiveRoutingRule::DirectiveRoutingRule, BlockingPolicy > DirectiveHandlerConfiguration
Definition: DirectiveHandlerConfiguration.h:32
void onPlaybackStopped(avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface::SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
DeviceCategory
Definition: DeviceCategory.h:24
MediaPlayerInterface::SourceId SourceId
A type that identifies which source is currently being operated on.
Definition: MediaPlayerObserverInterface.h:49
AVRCP Play is sent, waiting for local playback to start.
void preHandleDirective(std::shared_ptr< avsCommon::avs::CapabilityAgent::DirectiveInfo > info) override
void onEventFired(const avsCommon::utils::bluetooth::BluetoothEvent &event) override
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
void onFocusChanged(avsCommon::avs::FocusState newFocus, avsCommon::avs::MixingBehavior behavior) override
DeviceState
Definition: BluetoothDeviceInterface.h:48
void onPlaybackStarted(avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface::SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
type
Definition: upload.py:443
void onPlaybackFinished(avsCommon::utils::mediaPlayer::MediaPlayerObserverInterface::SourceId id, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
ErrorType
Identifies the specific type of error in a PlaybackFailed event.
Definition: ErrorTypes.h:28
void onContextFailure(const avsCommon::sdkInterfaces::ContextRequestError error) override
std::unordered_set< std::shared_ptr< avsCommon::avs::CapabilityConfiguration > > getCapabilityConfigurations() override
ScanningTransitionState
Definition: Bluetooth.h:177
static std::shared_ptr< Bluetooth > createBluetoothCapabilityAgent(std::shared_ptr< avsCommon::sdkInterfaces::ContextManagerInterface > contextManager, std::shared_ptr< avsCommon::sdkInterfaces::MessageSenderInterface > messageSender, std::shared_ptr< avsCommon::sdkInterfaces::ExceptionEncounteredSenderInterface > exceptionEncounteredSender, std::shared_ptr< acsdkBluetoothInterfaces::BluetoothStorageInterface > bluetoothStorage, std::shared_ptr< avsCommon::sdkInterfaces::bluetooth::BluetoothDeviceManagerInterface > deviceManager, std::shared_ptr< avsCommon::utils::bluetooth::BluetoothEventBus > eventBus, std::shared_ptr< registrationManager::CustomerDataManagerInterface > customerDataManager, std::shared_ptr< acsdkApplicationAudioPipelineFactoryInterfaces::ApplicationAudioPipelineFactoryInterface > audioPipelineFactory, acsdkManufactory::Annotated< avsCommon::sdkInterfaces::AudioFocusAnnotation, avsCommon::sdkInterfaces::FocusManagerInterface > audioFocusManager, std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > shutdownNotifier, acsdkManufactory::Annotated< avsCommon::sdkInterfaces::endpoints::DefaultEndpointAnnotation, avsCommon::sdkInterfaces::endpoints::EndpointCapabilitiesRegistrarInterface > endpointCapabilitiesRegistrar, std::shared_ptr< acsdkBluetoothInterfaces::BluetoothDeviceConnectionRulesProviderInterface > connectionRulesProvider, std::shared_ptr< BluetoothMediaInputTransformer > mediaInputTransformer, std::shared_ptr< acsdkBluetoothInterfaces::BluetoothNotifierInterface > bluetoothNotifier)
StreamingState
Definition: Bluetooth.h:135
Requester
An enum class indicating whether an operation originated from a Device or Cloud (AVS).
Definition: Requester.h:24
tuple message
Definition: gtest_output_test.py:331
std::string streamingStateToString(Bluetooth::StreamingState state)
Definition: Bluetooth.h:1129
Base class for a BluetoothEvent.
Definition: BluetoothEvents.h:66

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0