AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
LiveViewCameraNamespace.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 ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_IPC_NAMESPACES_LIVEVIEWCAMERANAMESPACE_H_
17 #define ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_IPC_NAMESPACES_LIVEVIEWCAMERANAMESPACE_H_
18 
19 #include <memory>
20 #include <string>
21 
23 
24 namespace alexaClientSDK {
25 namespace sampleApplications {
26 namespace ipcServerSampleApp {
27 namespace ipc {
28 namespace IPCNamespaces {
29 
31 static const char IPC_MSG_NAMESPACE_LIVE_VIEW_CAMERA[] = "LiveViewCamera";
32 
34 static const int IPC_MSG_VERSION_LIVE_VIEW_CAMERA(1);
35 
37 static const char IPC_MSG_NAME_RENDER_CAMERA[] = "renderCamera";
38 
40 static const char IPC_MSG_NAME_SET_CAMERA_STATE[] = "setCameraState";
41 
43 static const char IPC_MSG_NAME_CLEAR_CAMERA[] = "clearCamera";
44 
46 static const char IPC_MSG_START_LIVE_VIEW_PAYLOAD_TAG[] = "startLiveViewPayload";
47 
52 public:
58  explicit RenderCameraMessage(const std::string& startLiveViewPayload) :
59  Message(IPC_MSG_NAMESPACE_LIVE_VIEW_CAMERA, IPC_MSG_VERSION_LIVE_VIEW_CAMERA, IPC_MSG_NAME_RENDER_CAMERA) {
60  rapidjson::Value payload(rapidjson::kObjectType);
61  rapidjson::Document messageDocument(&alloc());
62  payload.AddMember(
63  rapidjson::Value(IPC_MSG_START_LIVE_VIEW_PAYLOAD_TAG, alloc()).Move(),
64  messageDocument.Parse(startLiveViewPayload),
65  alloc());
66  setPayload(std::move(payload));
67  };
68 };
69 
74 public:
80  explicit SetCameraStateMessage(const std::string& cameraState) :
81  Message(
82  IPC_MSG_NAMESPACE_LIVE_VIEW_CAMERA,
84  IPC_MSG_NAME_SET_CAMERA_STATE) {
85  setStateInPayload(cameraState);
86  addPayload();
87  };
88 };
89 
94 public:
98  explicit ClearCameraMessage() :
99  Message(IPC_MSG_NAMESPACE_LIVE_VIEW_CAMERA, IPC_MSG_VERSION_LIVE_VIEW_CAMERA, IPC_MSG_NAME_CLEAR_CAMERA) {
100  addPayload();
101  };
102 };
103 
104 } // namespace IPCNamespaces
105 } // namespace ipc
106 } // namespace ipcServerSampleApp
107 } // namespace sampleApplications
108 } // namespace alexaClientSDK
109 #endif // ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_IPC_NAMESPACES_LIVEVIEWCAMERANAMESPACE_H_
::std::string string
Definition: gtest-port.h:1097
static const int IPC_MSG_VERSION_LIVE_VIEW_CAMERA(1)
The namespace version for LiveViewCamera.
SetCameraStateMessage(const std::string &cameraState)
Definition: LiveViewCameraNamespace.h:80
static const char IPC_MSG_NAMESPACE_LIVE_VIEW_CAMERA[]
The message namespace for LiveViewCamera.
Definition: LiveViewCameraNamespace.h:31
Message(const std::string &nameSpace, const int version, const std::string &name)
Definition: Message.h:64
auto alloc() -> decltype(mDocument.GetAllocator())
Definition: Message.h:227
static const char IPC_MSG_NAME_SET_CAMERA_STATE[]
The message name for setCameraState.
Definition: LiveViewCameraNamespace.h:40
RenderCameraMessage(const std::string &startLiveViewPayload)
Definition: LiveViewCameraNamespace.h:58
Message & setPayload(rapidjson::Value &&payload)
Definition: Message.h:218
bool Value(const T &value, M matcher)
Definition: gmock-matchers.h:4347
static const char IPC_MSG_NAME_RENDER_CAMERA[]
The message name for renderCamera.
Definition: LiveViewCameraNamespace.h:37
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Message & setStateInPayload(const std::string &state)
Definition: Message.h:148
const T & move(const T &t)
Definition: gtest-port.h:1317
static const char IPC_MSG_START_LIVE_VIEW_PAYLOAD_TAG[]
The startLiveViewPayload key in RenderCamera message.
Definition: LiveViewCameraNamespace.h:46
static const char IPC_MSG_NAME_CLEAR_CAMERA[]
The message name for clearCamera.
Definition: LiveViewCameraNamespace.h:43

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