AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
SessionSetupNamespace.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_SESSIONSETUPNAMESPACE_H_
17 #define ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_IPC_NAMESPACES_SESSIONSETUPNAMESPACE_H_
18 
19 #include <string>
20 
21 #include <rapidjson/document.h>
22 
24 
25 namespace alexaClientSDK {
26 namespace sampleApplications {
27 namespace ipcServerSampleApp {
28 namespace ipc {
29 namespace IPCNamespaces {
30 
32 static const char IPC_FRAMEWORK_VERSION[] = "1.0.0";
33 
35 static const char IPC_MSG_NAMESPACE_SESSION_SETUP[] = "SessionSetup";
36 
38 static const int IPC_MSG_VERSION_SESSION_SETUP(1);
39 
41 static const char IPC_MSG_NAME_INIT_CLIENT[] = "initializeClient";
42 
44 static const char IPC_MSG_NAME_CONFIGURE_CLIENT[] = "configureClient";
45 
47 static const char IPC_MSG_IPC_VERSION_TAG[] = "ipcVersion";
48 
53 public:
59  explicit InitClientMessage(const std::string& ipcVersion) :
60  Message(IPC_MSG_NAMESPACE_SESSION_SETUP, IPC_MSG_VERSION_SESSION_SETUP, IPC_MSG_NAME_INIT_CLIENT) {
61  addMemberInPayload(IPC_MSG_IPC_VERSION_TAG, ipcVersion);
62  addPayload();
63  }
64 };
65 
70 public:
76  explicit ConfigureClientMessage(const std::string& payload) :
77  Message(IPC_MSG_NAMESPACE_SESSION_SETUP, IPC_MSG_VERSION_SESSION_SETUP, IPC_MSG_NAME_CONFIGURE_CLIENT) {
78  rapidjson::Document messageDocument(&alloc());
79  setPayload(std::move(messageDocument.Parse(payload)));
80  }
81 };
82 
83 } // namespace IPCNamespaces
84 } // namespace ipc
85 } // namespace ipcServerSampleApp
86 } // namespace sampleApplications
87 } // namespace alexaClientSDK
88 #endif // ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_IPC_NAMESPACES_SESSIONSETUPNAMESPACE_H_
static const char IPC_MSG_NAME_INIT_CLIENT[]
The message name for initializeClient.
Definition: SessionSetupNamespace.h:41
Message & addMemberInPayload(const std::string &name, const std::string &value)
Definition: Message.h:101
ConfigureClientMessage(const std::string &payload)
Definition: SessionSetupNamespace.h:76
::std::string string
Definition: gtest-port.h:1097
static const char IPC_MSG_NAME_CONFIGURE_CLIENT[]
The message name for configureClient.
Definition: SessionSetupNamespace.h:44
static const int IPC_MSG_VERSION_SESSION_SETUP(1)
The namespace version for SessionSetup.
static const char IPC_MSG_NAMESPACE_SESSION_SETUP[]
The message namespace for SessionSetup.
Definition: SessionSetupNamespace.h:35
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
Message & setPayload(rapidjson::Value &&payload)
Definition: Message.h:218
static const char IPC_FRAMEWORK_VERSION[]
The version for the IPC Framework.
Definition: SessionSetupNamespace.h:32
static const char IPC_MSG_IPC_VERSION_TAG[]
The IPC Framework version key in the message.
Definition: SessionSetupNamespace.h:47
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
InitClientMessage(const std::string &ipcVersion)
Definition: SessionSetupNamespace.h:59
const T & move(const T &t)
Definition: gtest-port.h:1317

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