Init basesystem source codes.
[staging/basesystem.git] / video_in_hal / nsframework / framework_unified / client / include / native_service / ns_shared_mem.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
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  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 ///////////////////////////////////////////////////////////////////////////////
18 /// \ingroup  tag_NSSharedMemory
19 /// \brief Shared interface file for SharedMemory Service
20 /// Detail description of interface and usage
21 /// \ref http://ptcframeworkunifiedaccbuild2/TikiWiki/tiki-index.php?page=Shared+Memory
22 ///      http://ptcframeworkunifiedaspsql01/sites/ptcsweng/SW%20Engineering%20Document%20Library/
23 ///             Projects/Connected%20Color%20Radio%20(CCR)/Architecture/Framework/
24 ///             CCR%20Messaging.vsd
25 ///
26 /// Declares the external APIs to Zone Player Service.
27 ///
28 ///////////////////////////////////////////////////////////////////////////////
29 //@{
30 /**
31  * @file ns_shared_mem.h
32  * @brief \~english Shared interface file for SharedMemory Service
33  *
34  */
35 /** @addtogroup BaseSystem
36  *  @{
37  */
38 /** @addtogroup native_service
39  *  @ingroup BaseSystem
40  *  @{
41  */
42 /** @addtogroup framework_unified
43  *  @ingroup native_service
44  *  @{
45  */
46 /** @addtogroup native
47  *  @ingroup framework_unified
48  *  @{
49  */
50
51 #ifndef __CCR_NATIVESERVICES_MESSAGECENTER_SHAREDMEMORY_H__  // NOLINT  (build/header_guard)
52 #define __CCR_NATIVESERVICES_MESSAGECENTER_SHAREDMEMORY_H__
53
54
55 #include <native_service/frameworkunified_types.h>          ///< Header file for Template
56 #include <stdint.h>
57 #ifdef AGL_STUB
58 #else
59 #include <devctl.h>
60 #include <sys/neutrino.h>
61 #endif
62
63 typedef struct _pulse_t TPosixHdr;  ///> Header for system-provided messages
64
65 enum ESharedMemCommand {
66   eSharedMemCommandWrite = 1,
67   eSharedMemCommandRead = 2,
68   eSharedMemCommandSize = 3,
69   eSharedMemCommandDelete = 4,
70 };
71
72 #define NS_SHAREDMEM_NAME "NS_SharedMem"
73 #define NS_SHAREDMEM_SOCK_QUEUE 10
74 DEFINE_HANDLE_TYPE(SSHMemID, TShMemID);
75
76 #ifdef AGL_STUB
77 #else
78 #include <_pack1.h>
79 #endif
80 struct SMsgHeader {
81   uint16_t cmd;  // Command to the NS_SharedMem
82   uintptr_t id;  // NS_SharedMem ID
83   UI_32 size;   // The size of the data to write to NS_SharedMem
84 };
85
86 struct SReplyHeader {
87   EFrameworkunifiedStatus status;  // write result
88   UI_32 size;     // The size of the data to read from NS_SharedMem
89 };
90 #ifdef AGL_STUB
91 #else
92 #include <_packpop.h>
93 #endif
94
95 #endif  // __CCR_NATIVESERVICES_MESSAGECENTER_SHAREDMEMORY_H__  // NOLINT  (build/header_guard)
96 /** @}*/
97 /** @}*/
98 /** @}*/
99 /** @}*/
100 //@}