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.
18 * @file ss_devicedetection_service.h
19 * @brief This file supports the Device Detection service.
22 /** @addtogroup BaseSystem
25 /** @addtogroup system_service
29 /** @addtogroup device_detection_service
30 * @ingroup system_service
34 #ifndef _SS_DEVICEDETECTION_SERVER_H_ // NOLINT (build/header_guard)
35 #define _SS_DEVICEDETECTION_SERVER_H_
38 #include <native_service/frameworkunified_types.h>
40 #include "system_service/ss_devicedetection_service_types.h"
43 * \~english The max size of the file path.
45 #define FILEPATH_SIZE (256)
48 * \~english The max size of URL.
50 #define URL_SIZE (256)
53 * \~english The max size of the device name.
55 #define SS_DEV_DEVICE_NAME_SIZE (64)
58 * \~english The max size of the name.
60 #define SS_DEV_NAME_SIZE (256)
64 * \~english Structure for FuseDAV info.
66 typedef struct _FuseDAVInfo {
68 * \~english FuseDAV server address
70 int8_t url[URL_SIZE]; // FuseDAV server address
74 * \~english Structure for USB device info.
76 typedef struct _UsbInfo {
78 * \~english Bus Number
80 uint8_t bus_no; // Bus Number
82 * \~english Device Number
84 uint8_t dev_no; // Device Number
88 uint16_t idVendor; // Vendor ID
90 * \~english Product ID
92 uint16_t idProduct; // Product ID
94 * \~english reserved area
98 * \~english Manufacturer Name
100 CHAR manufacturerName[SS_DEV_NAME_SIZE]; // Manufacturer Name
102 * \~english Product Name
104 CHAR productName[SS_DEV_NAME_SIZE]; // Product Name
106 * \~english Serial Number
108 CHAR serial_no[SS_DEV_NAME_SIZE]; // Serial Number
110 * \~english Device file path
112 int8_t deviceFile[FILEPATH_SIZE]; // Device file path
116 * \~english CID(Card Identification Register Data)of SD/MMC card
118 typedef struct _CID {
120 * \~english Manufacturer ID
122 uint8_t manufacturerID; /* Manufacturer ID */
124 * \~english Application ID
126 uint16_t applicationID; /* Application ID */
128 * \~english Product Revision (PRV)
130 uint8_t revision; /* Product Revision (PRV) */
132 * \~english Product Serial Number (PSN)
134 uint32_t serialNumber; /* Product Serial Number (PSN) */
136 * \~english Product Name (PNM)
138 uint8_t productName[6]; /* Product Name (PNM) */
140 * \~english Reserved area
142 uint8_t reserve[2]; /* Reserve */
144 * \~english Manufacture date (MDT)
146 uint16_t manufactureDate; /* Manufacture date (MDT) */
149 // CSD(Card Specification Register Data)of SD/MMC card
151 * \~english CSD(Card Specification Register Data)of SD/MMC card
153 typedef struct _CSD {
155 * \~english CSD structure
157 uint8_t csd_structure; /* CSD structure */
159 * \~english data read access-time-1
161 uint8_t taac; /* data read access-time-1 */
163 * \~english data read access-time-2 in CLK cycles (NSAC*100)
165 uint8_t nsac; /* data read access-time-2 in CLK cycles (NSAC*100) */
167 * \~english max. data transfer rate
169 uint8_t tran_speed; /* max. data transfer rate */
171 * \~english card command classes
173 uint16_t ccc; /* card command classes */
175 * \~english max. read data block length
177 uint8_t read_bl_len; /* max. read data block length */
179 * \~english partial blocks for read allowed
181 uint8_t read_bl_partial; /* partial blocks for read allowed */
183 * \~english write block misalignment
185 uint8_t write_blk_misalign; /* write block misalignment */
187 * \~english read block misalignment
189 uint8_t read_blk_misalign; /* read block misalignment */
191 * \~english DSR implemented
193 uint8_t dsr_imp; /* DSR implemented */
195 * \~english Reserve area 1
197 uint8_t reserve1; /* Reserve 1 */
199 * \~english device size
201 uint32_t c_size; /* device size */
203 * \~english max. read current -VDD min
205 uint8_t vdd_r_curr_min; /* max. read current @VDD min */
207 * \~english max. read current -VDD max
209 uint8_t vdd_r_curr_max; /* max. read current @VDD max */
211 * \~english max. write current -VDD min
213 uint8_t vdd_w_curr_min; /* max. write current @VDD min */
215 * \~english max. write current -VDD max
217 uint8_t vdd_w_curr_max; /* max. write current @VDD max */
219 * \~english device size multiplier
221 uint8_t c_size_mult; /* device size multiplier */
223 * \~english erase single block enable
225 uint8_t erase_blk_en; /* erase single block enable */
227 * \~english erase sector size
229 uint8_t sector_size; /* erase sector size */
231 * \~english write protect group size
233 uint8_t wp_grp_size; /* write protect group size */
235 * \~english write protect group enable
237 uint8_t wp_grp_enable; /* write protect group enable */
239 * \~english write speed factor
241 uint8_t r2w_factor; /* write speed factor */
243 * \~english max. write data block length
245 uint8_t write_bl_len; /* max. write data block length */
247 * \~english partial blocks for write allowed
249 uint8_t write_bl_partial; /* partial blocks for write allowed */
251 * \~english File format group
253 uint8_t file_format_grp; /* File format group */
255 * \~english copy flag
257 uint8_t copy; /* copy flag */
259 * \~english permanent write protection
261 uint8_t perm_write_protect; /* permanent write protection */
263 * \~english temporary write protection
265 uint8_t tmp_write_protect; /* temporary write protection */
267 * \~english File format
269 uint8_t file_format; /* File format */
271 * \~english Reserve area 2
273 uint8_t reserve2[3]; /* Reserve 2 */
276 // Structure for SD device info.
278 * \~english Structure for SD device info.
280 typedef struct _SdInfo {
290 * \~english Device file path
292 int8_t deviceFile[FILEPATH_SIZE]; // Device file path
294 * \~english Current Partion No
296 int32_t part_num; // Current Partion No
298 * \~english Number of partions
300 int32_t nparts; // Number of partions
303 // Structure for DISC info.
305 * \~english Structure for DISC info.
307 typedef struct _DiscInfo {
309 * \~english Device file path
311 int8_t deviceFile[FILEPATH_SIZE]; // Device file path
313 * \~english Disc Type(eCD, eDVD, eBD)
315 EDISC_TYPE disc_type; // Disc Type(eCD, eDVD, eBD)
318 // Structure that is available when SS_DEV_ANY_USB_EV is published.
320 * \~english Structure that is available when SS_DEV_ANY_USB_EV is published.
322 typedef struct _UsbDeviceInfo {
324 * \~english Insert:TURE, Remove:FALSE
326 BOOL bIsDeviceAvailable; // Insert:TURE, Remove:FALSE
328 * \~english USB Infomation
330 SS_UsbInfo usb_info; // USB Infomation
333 // Structure for device info.
335 * \~english Structure for device info.
337 typedef union _DeviceInfo {
339 * \~english usb device info
341 SS_UsbInfo usb_info; // usb device info
345 SS_SdInfo sd_info; // sd info
347 * \~english disc info
349 SS_DiscInfo disc_info; // disc info
351 * \~english fusedav info
353 SS_FuseDAVInfo fusedav_info; // fusedav info
356 // Structure for volume label infomation.
358 * \~english Structure for volume label infomation.
360 typedef struct _VolumeInfo {
362 * \~english volume label's availability
364 BOOL volume_label_availability; // volume label's availability
366 * \~english volume label
368 CHAR volume_label[SS_DEV_NAME_SIZE]; // volume label
371 // Structure that is available when SS_DEV_DETECT*_EV is published.
373 * \~english Structure that is available when SS_DEV_DETECT*_EV is published.
375 typedef struct _MediaDetectInfo {
377 * \~english Deive type(eUSB,eSD...)
379 EDEVICE_TYPE dev_type; // Deive type(eUSB,eSD...)
381 * \~english Insert:TURE, Remove:FALSE
383 BOOL bIsDeviceAvailable; // Insert:TURE, Remove:FALSE
385 * \~english Device Infomation
387 SS_DeviceInfo dev_info; // Device Infomation
389 * \~english Mount path
391 CHAR deviceMountpath[FILEPATH_SIZE]; // Mount path
393 * \~english Do Not Used.(This member is for compatibility)
395 CHAR filepathName[FILEPATH_SIZE]; // Do Not Used.(This menber is for compatibility)
397 * \~english FuseDav:TRUE, Not FuseDav:FALSE
401 * \~english result of mount NORMAL:SS_DEV_OK, ERR:SS_DEV_ERR_MOUNT
403 SS_DEV_ERROR err_code; // result of mount NORMAL:SS_DEV_OK, ERR:SS_DEV_ERR_MOUNT
405 * \~english volume infomation (USB mass storage only support)
407 SS_VolumeInfo volume_info; // volume infomation (USB mass storage only support)
408 }SS_MediaDetectInfo, *PSS_MediaDetectInfo;
410 // Structure that is available when SS_DEV_DETECT_USB_NCM_EV is published.
412 * \~english Structure that is available when SS_DEV_DETECT_USB_NCM_EV is published.
414 typedef struct _NcmDetectInfo {
416 * \~english Insert:TURE, Remove:FALSE
418 BOOL bIsDeviceAvailable; // Insert:TURE, Remove:FALSE
420 * \~english USB Infomation
422 SS_UsbInfo usb_info; // USB Infomation
424 * \~english Network Name
426 int8_t networkName[SS_DEV_DEVICE_NAME_SIZE]; // Network Name
429 // Structure that is available when SS_DEV_DETECT_USB__CWORD57__EV is published.
431 * \~english Structure that is available when SS_DEV_DETECT_USB__CWORD57__EV is published.
433 typedef struct __CWORD57_DetectInfo {
435 * \~english Insert:TURE, Remove:FALSE
437 BOOL bIsDeviceAvailable; // Insert:TURE, Remove:FALSE
439 * \~english USB Infomation
441 SS_UsbInfo usb_info; // USB Infomation
442 }SS__CWORD57_DetectInfo;
444 // Structure that is available when SS_DEV_DETECT_USB_ACM_EV is published.
446 * \~english Structure that is available when SS_DEV_DETECT_USB_ACM_EV is published.
448 typedef struct _AcmDetectInfo {
450 * \~english Insert:TURE, Remove:FALSE
452 BOOL bIsDeviceAvailable; // Insert:TURE, Remove:FALSE
454 * \~english USB Infomation
456 SS_UsbInfo usb_info; // USB Infomation
458 * \~english ACM device file
460 int8_t deviceFile[FILEPATH_SIZE]; // ACM device file
463 // Structure that is available when SS_DEV_DETECT_USB_DEV_MNG_EV is published.
465 * \~english Structure that is available when SS_DEV_DETECT_USB_DEV_MNG_EV is published.
467 typedef struct _DevMngDetectInfo {
469 * \~english Insert:TURE, Remove:FALSE
471 BOOL bIsDeviceAvailable; // Insert:TURE, Remove:FALSE
473 * \~english USB Infomation
475 SS_UsbInfo usb_info; // USB Infomation
477 * \~english Device Manager device file
479 int8_t deviceFile[FILEPATH_SIZE]; // Device Manager device file
480 }SS_DevMngDetectInfo;
482 // Structure that is available when SS_DEV_DETECT_USB_DEV_VEHICLE_CTRL_EV is published.
484 * \~english Structure that is available when SS_DEV_DETECT_USB_DEV_VEHICLE_CTRL_EV is published.
486 typedef struct _VehicleCtrlDetectInfo {
488 * \~english Insert:TURE, Remove:FALSE
490 BOOL bIsDeviceAvailable; // Insert:TURE, Remove:FALSE
492 * \~english USB Infomation
494 SS_UsbInfo usb_info; // USB Infomation
496 * \~english Vehicle control device file
498 int8_t deviceFile[FILEPATH_SIZE]; // Vehicle control device file
499 }SS_VehicleCtrlDetectInfo;
501 // Structure for audio detect info.
503 * \~english Structure for audio detect info.
505 typedef struct _AudioDetectInfo {
507 * \~english Insert:TURE, Remove:FALSE
509 BOOL bIsDeviceAvailable;
511 * \~english USB Infomation
515 * \~english Audio control device file
517 int8_t audio_ctrl[FILEPATH_SIZE];
519 * \~english Audio Playback device file
521 int8_t audio_play[FILEPATH_SIZE];
523 * \~english Audio Capture device file
525 int8_t audio_capture[FILEPATH_SIZE];
528 // Structure that is available when SS_DEV_DETECT_USB_DSRC_APP_EV is published.
530 * \~english Structure that is available when SS_DEV_DETECT_USB_DSRC_APP_EV is published.
532 typedef struct _DsrcAppDetectInfo {
534 * \~english Insert:TURE, Remove:FALSE
536 BOOL bIsDeviceAvailable; // Insert:TURE, Remove:FALSE
538 * \~english USB Infomation
540 SS_UsbInfo usb_info; // USB Infomation
542 * \~english Dsrc Application device file
544 int8_t deviceFile[FILEPATH_SIZE]; // Dsrc Application device file
545 }SS_DsrcAppDetectInfo;
547 // Structure that is available when SS_DEV_DETECT_USB_DSRC_CTRL_EV is published.
549 * \~english Structure that is available when SS_DEV_DETECT_USB_DSRC_CTRL_EV is published.
551 typedef struct _DsrcCtrlDetectInfo {
553 * \~english Insert:TURE, Remove:FALSE
555 BOOL bIsDeviceAvailable; // Insert:TURE, Remove:FALSE
557 * \~english USB Infomation
559 SS_UsbInfo usb_info; // USB Infomation
561 * \~english Dsrc Control device file
563 int8_t deviceFile[FILEPATH_SIZE]; // Dsrc Control device file
564 }SS_DsrcCtrlDetectInfo;
566 // Structure that is available when SS_DEV_DETECT_USB_IR_VICS_DATA_EV is published.
568 * \~english Structure that is available when SS_DEV_DETECT_USB_IR_VICS_DATA_EV is published.
570 typedef struct _IrVicsDataDetectInfo {
572 * \~english Insert:TURE, Remove:FALSE
574 BOOL bIsDeviceAvailable; // Insert:TURE, Remove:FALSE
576 * \~english USB Infomation
578 SS_UsbInfo usb_info; // USB Infomation
580 * \~english Ir Vics Data device file
582 int8_t deviceFile[FILEPATH_SIZE]; // Ir Vics Data device file
583 }SS_IrVicsDataDetectInfo;
586 * \~english USB overcurrent error info.
588 typedef struct _UsbOverCurrentErrInfo {
590 * \~english error port no
592 uint8_t portNo; // error port no
593 } SS_UsbOverCurrentErrInfo;
595 // Structure that is available when SS_DEV_INFO_USB_NOTIFY_EV is published.
597 * \~english Structure that is available when SS_DEV_INFO_USB_NOTIFY_EV is published.
599 typedef struct _UsbNotifyInfo {
601 * \~english notify code
603 SS_NOTIFY_CODE nofity_code; // notify code
605 * \~english USB device information's availability
607 BOOL usb_info_availability; // USB device information's availability
609 * \~english USB device information
611 SS_UsbInfo usb_info; // USB device information
614 // Structure that is available when SS_DEV_DETECT_ANY_USB__CWORD57__ROLE_EV is published.
616 * \~english Structure that is available when SS_DEV_DETECT_ANY_USB__CWORD57__ROLE_EV is published.
618 typedef struct __CWORD57_RoleDetectInfo {
620 * \~english Insert:TURE, Remove:FALSE
622 BOOL bIsDeviceAvailable; // Insert:TURE, Remove:FALSE
623 } SS__CWORD57_RoleDetectInfo;
625 // Structure that is available when SS_DEV_INFO_SD_FORMAT_COMP_EV is published.
627 * \~english Structure that is available when SS_DEV_INFO_SD_FORMAT_COMP_EV is published.
629 typedef struct _SDFormatInfo {
631 * \~english Result of SD Format.
633 SS_DEV_ERROR result; // Result of SD Format.
636 #endif /* _SS_DEVICEDETECTION_SERVER_H_ */ // NOLINT (build/header_guard)
638 /** @}*/ // end of device_detection_service
639 /** @}*/ // end of system_service
640 /** @}*/ // end of BaseSystem