2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 /*!-----------------------------------------------------------------------------
22 #ifndef COMMUNICATION_USB_CLIENT_INCLUDE_PERIPHERAL_SERVICE_COMMUSB_API_H_
23 #define COMMUNICATION_USB_CLIENT_INCLUDE_PERIPHERAL_SERVICE_COMMUSB_API_H_
25 #include <sys/types.h>
26 #include <native_service/frameworkunified_types.h>
28 /** @addtogroup BaseSystem
31 /** @addtogroup peripheral_service
35 /** @addtogroup communication_usb
36 * @ingroup peripheral_service
44 * @~english Service Name of PS_CommUSB Thread
46 #define LAN_SERVICE_COMMUSB_MAIN "PS_CommUSB"
49 * @~english The maximum number of delivery entry
51 #define COMMUSB_DELIVERY_DATA_MAX 0xFF
54 * @~english Authentication info
58 *@~english Authentication is NG
60 COMMUSB_AUTH_NG = 0x00,
63 *@~english Authentication is OK
69 * @~english Transmit class
73 *@~english Individual transmission
75 COMMUSB_TRANS_INDIVIDUAL = 0x00,
78 *@~english Group broadcast transmission
83 *@~english Simultaneous broadcast transmission
86 } COMMUSB_TRANS_CLASS;
89 * @~english Clear type of DeliveryEntry table (for debug)
95 USB_CLEAR_TYPE_ALL = 0,
98 * @~english Clear only table without wild card
100 USB_CLEAR_TYPE_WITHOUT_WILDCARD,
103 * @~english Clear only table with wild card
105 USB_CLEAR_TYPE_WITH_WILDCARD,
109 * \ingroup USB_Auth_Info
110 * \~english @par Brief
111 * Set the authentication status of the service PS_CommUSB.
112 * \~english @param [in] h_app
113 * HANDLE - handle for application
114 * \~english @param [in] auth_info
115 * uint8_t - Authentication status,refer to @ref COMMUSB_AUTH_INFO
116 * \~english @retval eFrameworkunifiedStatusOK success
117 * \~english @retval eFrameworkunifiedStatusInvldHandle Invalid handle
118 * \~english @retval eFrameworkunifiedStatusMsgQFull Message queue is full
119 * \~english @retval eFrameworkunifiedStatusErrNoEBADF Invalid File-Descriptor
120 * \~english @retval eFrameworkunifiedStatusErrNoEINTR
121 * An interrupt is generated by the system call (signal)
122 * \~english @retval eFrameworkunifiedStatusNullPointer NULL pointer
123 * \~english @retval eFrameworkunifiedStatusInvldParam Invalid parameter
124 * \~english @retval eFrameworkunifiedStatusInvldBufSize Invalid buffer-size
125 * \~english @retval eFrameworkunifiedStatusInvldBuf Invalid buffer
126 * \~english @retval eFrameworkunifiedStatusBadConnection It can not be a socket connection
127 * \~english @retval eFrameworkunifiedStatusFail Abnormal Error
128 * (System error, Avaiability is FALSE, internal status error)
129 * \~english @retval eFrameworkunifiedStatusInvldHndlType Invalid type of handle
130 * \~english @retval eFrameworkunifiedStatusInvldQName Illegal Message Queue name
131 * \~english @retval eFrameworkunifiedStatusErrOther
132 * Other error has occurred(Cannot access shared memory, etc.)
133 * \~english @par Preconditons
134 * - Availability of PS_CommUSB is TRUE and Authentication state is TRUE.
135 * \~english @par Change of internal status
136 * - Change of internal state according to the API does not occur
137 * \~english @par Conditions of processing failure
138 * - Input parameter error
139 * - Parameter h_app is null
140 * - eFrameworkunifiedStatusInvldHandle
141 * - Parameter auth_info is invalid
142 * - eFrameworkunifiedStatusInvldParam
143 * - Internal process error
144 * - Availability of PS_CommUSB is not TRUE
145 * - The size of the message received by PS_CommUSB is illegal
146 * - eFrameworkunifiedStatusFail
147 * - Execute the process name is not ExtUnitAuth
148 * - eFrameworkunifiedStatusMsgNotProcessed
149 * - Internal process error(ns_framework error)
150 * - eFrameworkunifiedStatusInvldHandle
151 * - eFrameworkunifiedStatusMsgQFull
152 * - eFrameworkunifiedStatusErrNoEBADF
153 * - eFrameworkunifiedStatusErrNoEINTR
154 * - eFrameworkunifiedStatusNullPointer
155 * - eFrameworkunifiedStatusInvldBufSize
156 * - eFrameworkunifiedStatusInvldBuf
157 * - eFrameworkunifiedStatusBadConnection
158 * - eFrameworkunifiedStatusFail
159 * - eFrameworkunifiedStatusInvldHndlType
160 * - eFrameworkunifiedStatusInvldQName
161 * - eFrameworkunifiedStatusErrOther
162 * \~english @par classification
164 * \~english @par Type
166 * \~english @par Details
167 * Set the authentication status for PS_CommUSB.
169 * when using this API,please note the following points:
170 * - The status of service PS_CommUSB and the availability of this
171 * API, refer to PS_CommUSB available function list of BaseSystem
172 * external specification.
173 * - This API is designed for the ExtUnitAuth process, If it is used by
174 * other process, return eFrameworkunifiedStatusMsgNotProcessed.
175 * \~english @see None
177 EFrameworkunifiedStatus USB_Auth_Info(HANDLE h_app, uint8_t auth_info);
181 #endif // __cplusplus
183 /** @}*/ // end of communication_usb
184 /** @}*/ // end of peripheral_service
185 /** @}*/ // end of BaseSystem
186 #endif // COMMUNICATION_USB_CLIENT_INCLUDE_PERIPHERAL_SERVICE_COMMUSB_API_H_