Remove unused directories and files in video_in_hal
[staging/basesystem.git] / service / system / interface_unified / library / include / system_service / ss_devicedetection_service.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  * @file ss_devicedetection_service.h
19  * @brief This file supports the Device Detection service.
20  */
21
22 /** @addtogroup BaseSystem
23  *  @{
24  */
25 /** @addtogroup system_service
26  *  @ingroup BaseSystem
27  *  @{
28  */
29 /** @addtogroup device_detection_service
30  *  @ingroup system_service
31  *  @{
32  */
33
34 #ifndef _SS_DEVICEDETECTION_SERVER_H_  // NOLINT (build/header_guard)
35 #define _SS_DEVICEDETECTION_SERVER_H_
36
37
38 #include <native_service/frameworkunified_types.h>
39 #include <string>
40 #include "system_service/ss_devicedetection_service_types.h"
41
42 /**
43  * \~english The max size of the file path.
44  */
45 #define FILEPATH_SIZE  (256)
46
47 /**
48  * \~english The max size of URL.
49  */
50 #define URL_SIZE  (256)
51
52 /**
53  * \~english The max size of the device name.
54  */
55 #define SS_DEV_DEVICE_NAME_SIZE (64)
56
57 /**
58  * \~english The max size of the name.
59  */
60 #define SS_DEV_NAME_SIZE (256)
61
62
63 /**
64  * \~english Structure for FuseDAV info.
65  */
66 typedef struct _FuseDAVInfo {
67   /**
68    * \~english FuseDAV server address
69    */
70   int8_t  url[URL_SIZE];  // FuseDAV server address
71 }SS_FuseDAVInfo;
72
73 /**
74  * \~english Structure for USB device info.
75  */
76 typedef struct _UsbInfo {
77   /**
78    * \~english Bus Number
79    */
80   uint8_t  bus_no;    // Bus Number
81   /**
82    * \~english Device Number
83    */
84   uint8_t  dev_no;    // Device Number
85   /**
86    * \~english Vendor ID
87    */
88   uint16_t  idVendor;  // Vendor ID
89   /**
90    * \~english Product ID
91    */
92   uint16_t  idProduct;  // Product ID
93   /**
94    * \~english reserved area
95    */
96   uint8_t  reserved[2];
97   /**
98    * \~english Manufacturer Name
99    */
100   CHAR  manufacturerName[SS_DEV_NAME_SIZE];  // Manufacturer Name
101   /**
102    * \~english Product Name
103    */
104   CHAR  productName[SS_DEV_NAME_SIZE];  //  Product Name
105   /**
106    * \~english Serial Number
107    */
108   CHAR  serial_no[SS_DEV_NAME_SIZE];  // Serial Number
109   /**
110    * \~english Device file path
111    */
112   int8_t  deviceFile[FILEPATH_SIZE];  // Device file path
113 }SS_UsbInfo;
114
115 /**
116  * \~english CID(Card Identification Register Data)of SD/MMC card
117  */
118 typedef struct _CID {
119   /**
120    * \~english Manufacturer ID
121    */
122   uint8_t  manufacturerID;      /* Manufacturer ID        */
123   /**
124    * \~english Application ID
125    */
126   uint16_t  applicationID;      /* Application ID        */
127   /**
128    * \~english Product Revision (PRV)
129    */
130   uint8_t  revision;      /* Product Revision (PRV)    */
131   /**
132    * \~english Product Serial Number (PSN)
133    */
134   uint32_t  serialNumber;      /* Product Serial Number (PSN)  */
135   /**
136    * \~english Product Name (PNM)
137    */
138   uint8_t  productName[6];      /* Product Name (PNM)      */
139   /**
140    * \~english Reserved area
141    */
142   uint8_t  reserve[2];      /* Reserve            */
143   /**
144    * \~english Manufacture date (MDT)
145    */
146   uint16_t  manufactureDate;    /* Manufacture date (MDT)    */
147 }SS_CID;
148
149 // CSD(Card Specification Register Data)of SD/MMC card
150 /**
151  * \~english CSD(Card Specification Register Data)of SD/MMC card
152  */
153 typedef struct _CSD {
154   /**
155    * \~english CSD structure
156    */
157   uint8_t  csd_structure;      /* CSD structure        */
158   /**
159    * \~english data read access-time-1
160    */
161   uint8_t  taac;        /* data read access-time-1    */
162   /**
163    * \~english data read access-time-2 in CLK cycles (NSAC*100)
164    */
165   uint8_t  nsac;        /* data read access-time-2 in CLK cycles (NSAC*100)  */
166   /**
167    * \~english max. data transfer rate
168    */
169   uint8_t  tran_speed;      /* max. data transfer rate  */
170   /**
171    * \~english card command classes
172    */
173   uint16_t  ccc;        /* card command classes      */
174   /**
175    * \~english max. read data block length
176    */
177   uint8_t  read_bl_len;      /* max. read data block length  */
178   /**
179    * \~english partial blocks for read allowed
180    */
181   uint8_t  read_bl_partial;    /* partial blocks for read allowed  */
182   /**
183    * \~english write block misalignment
184    */
185   uint8_t  write_blk_misalign;    /* write block misalignment    */
186   /**
187    * \~english read block misalignment
188    */
189   uint8_t  read_blk_misalign;    /* read block misalignment    */
190   /**
191    * \~english DSR implemented
192    */
193   uint8_t  dsr_imp;      /* DSR implemented        */
194   /**
195    * \~english Reserve area 1
196    */
197   uint8_t  reserve1;      /* Reserve 1          */
198   /**
199    * \~english device size
200    */
201   uint32_t  c_size;        /* device size          */
202   /**
203    * \~english max. read current -VDD min
204    */
205   uint8_t  vdd_r_curr_min;      /* max. read current @VDD min  */
206   /**
207    * \~english max. read current -VDD max
208    */
209   uint8_t  vdd_r_curr_max;      /* max. read current @VDD max  */
210   /**
211    * \~english max. write current -VDD min
212    */
213   uint8_t  vdd_w_curr_min;      /* max. write current @VDD min  */
214   /**
215    * \~english max. write current -VDD max
216    */
217   uint8_t  vdd_w_curr_max;      /* max. write current @VDD max  */
218   /**
219    * \~english device size multiplier
220    */
221   uint8_t  c_size_mult;      /* device size multiplier    */
222   /**
223    * \~english erase single block enable
224    */
225   uint8_t  erase_blk_en;      /* erase single block enable  */
226   /**
227    * \~english erase sector size
228    */
229   uint8_t  sector_size;      /* erase sector size      */
230   /**
231    * \~english write protect group size
232    */
233   uint8_t  wp_grp_size;      /* write protect group size    */
234   /**
235    * \~english write protect group enable
236    */
237   uint8_t  wp_grp_enable;      /* write protect group enable  */
238   /**
239    * \~english write speed factor
240    */
241   uint8_t  r2w_factor;      /* write speed factor      */
242   /**
243    * \~english max. write data block length
244    */
245   uint8_t  write_bl_len;      /* max. write data block length  */
246   /**
247    * \~english partial blocks for write allowed
248    */
249   uint8_t  write_bl_partial;    /* partial blocks for write allowed  */
250   /**
251    * \~english File format group
252    */
253   uint8_t  file_format_grp;    /* File format group      */
254   /**
255    * \~english copy flag
256    */
257   uint8_t  copy;        /* copy flag          */
258   /**
259    * \~english permanent write protection
260    */
261   uint8_t  perm_write_protect;    /* permanent write protection  */
262   /**
263    * \~english temporary write protection
264    */
265   uint8_t  tmp_write_protect;    /* temporary write protection  */
266   /**
267    * \~english File format
268    */
269   uint8_t  file_format;      /* File format          */
270   /**
271    * \~english Reserve area 2
272    */
273   uint8_t  reserve2[3];      /* Reserve 2          */
274 } SS_CSD;
275
276 // Structure for SD device info.
277 /**
278  * \~english Structure for SD device info.
279  */
280 typedef struct _SdInfo {
281   /**
282    * \~english CID
283    */
284   SS_CID  cid;    // CID
285   /**
286    * \~english CSD
287    */
288   SS_CSD  csd;    // CSD
289   /**
290    * \~english Device file path
291    */
292   int8_t  deviceFile[FILEPATH_SIZE];  // Device file path
293   /**
294    * \~english Current Partion No
295    */
296   int32_t  part_num;  // Current Partion No
297   /**
298    * \~english Number of partions
299    */
300   int32_t  nparts;    // Number of partions
301 }SS_SdInfo;
302
303 // Structure for DISC info.
304 /**
305  * \~english Structure for DISC info.
306  */
307 typedef struct _DiscInfo {
308   /**
309    * \~english Device file path
310    */
311   int8_t  deviceFile[FILEPATH_SIZE];  // Device file path
312   /**
313    * \~english Disc Type(eCD, eDVD, eBD)
314    */
315   EDISC_TYPE  disc_type;      // Disc Type(eCD, eDVD, eBD)
316 }SS_DiscInfo;
317
318 // Structure that is available when SS_DEV_ANY_USB_EV is published.
319 /**
320  * \~english Structure that is available when SS_DEV_ANY_USB_EV is published.
321  */
322 typedef struct _UsbDeviceInfo {
323   /**
324    * \~english Insert:TURE, Remove:FALSE
325    */
326   BOOL        bIsDeviceAvailable;  // Insert:TURE, Remove:FALSE
327   /**
328    * \~english USB Infomation
329    */
330   SS_UsbInfo    usb_info;    // USB Infomation
331 }SS_UsbDeviceInfo;
332
333 // Structure for device info.
334 /**
335  * \~english Structure for device info.
336  */
337 typedef union _DeviceInfo {
338   /**
339    * \~english usb device info
340    */
341   SS_UsbInfo      usb_info;  // usb device info
342   /**
343    * \~english sd info
344    */
345   SS_SdInfo    sd_info;  // sd info
346   /**
347    * \~english disc info
348    */
349   SS_DiscInfo    disc_info;  // disc info
350   /**
351    * \~english fusedav info
352    */
353   SS_FuseDAVInfo   fusedav_info;  // fusedav info
354 }SS_DeviceInfo;
355
356 // Structure for volume label infomation.
357 /**
358  * \~english Structure for volume label infomation.
359  */
360 typedef struct _VolumeInfo {
361   /**
362    * \~english volume label's availability
363    */
364   BOOL     volume_label_availability;  // volume label's availability
365   /**
366    * \~english volume label
367    */
368   CHAR    volume_label[SS_DEV_NAME_SIZE];  // volume label
369 }SS_VolumeInfo;
370
371 // Structure that is available when SS_DEV_DETECT*_EV is published.
372 /**
373  * \~english Structure that is available when SS_DEV_DETECT*_EV is published.
374  */
375 typedef struct _MediaDetectInfo {
376   /**
377    * \~english Deive type(eUSB,eSD...)
378    */
379   EDEVICE_TYPE   dev_type;      // Deive type(eUSB,eSD...)
380   /**
381    * \~english Insert:TURE, Remove:FALSE
382    */
383   BOOL     bIsDeviceAvailable;    // Insert:TURE, Remove:FALSE
384   /**
385    * \~english Device Infomation
386    */
387   SS_DeviceInfo  dev_info;      // Device Infomation
388   /**
389    * \~english Mount path
390    */
391   CHAR    deviceMountpath[FILEPATH_SIZE];  // Mount path
392   /**
393    * \~english  Do Not Used.(This member is for compatibility)
394    */
395   CHAR    filepathName[FILEPATH_SIZE];  // Do Not Used.(This menber is for compatibility)
396   /**
397    * \~english FuseDav:TRUE, Not FuseDav:FALSE
398    */
399   BOOL    bIsFuseDav;
400   /**
401    * \~english result of mount  NORMAL:SS_DEV_OK, ERR:SS_DEV_ERR_MOUNT
402    */
403   SS_DEV_ERROR  err_code;      // result of mount  NORMAL:SS_DEV_OK, ERR:SS_DEV_ERR_MOUNT
404   /**
405    * \~english volume infomation (USB mass storage only support)
406    */
407   SS_VolumeInfo  volume_info;      // volume infomation (USB mass storage only support)
408 }SS_MediaDetectInfo, *PSS_MediaDetectInfo;
409
410 // Structure that is available when SS_DEV_DETECT_USB_NCM_EV is published.
411 /**
412  * \~english Structure that is available when SS_DEV_DETECT_USB_NCM_EV is published.
413  */
414 typedef struct _NcmDetectInfo {
415   /**
416    * \~english Insert:TURE, Remove:FALSE
417    */
418   BOOL     bIsDeviceAvailable;    // Insert:TURE, Remove:FALSE
419   /**
420    * \~english USB Infomation
421    */
422   SS_UsbInfo  usb_info;      // USB Infomation
423   /**
424    * \~english Network Name
425    */
426   int8_t  networkName[SS_DEV_DEVICE_NAME_SIZE];  // Network Name
427 }SS_NcmDetectInfo;
428
429 // Structure that is available when SS_DEV_DETECT_USB__CWORD57__EV is published.
430 /**
431  * \~english Structure that is available when SS_DEV_DETECT_USB__CWORD57__EV is published.
432  */
433 typedef struct __CWORD57_DetectInfo {
434   /**
435    * \~english Insert:TURE, Remove:FALSE
436    */
437   BOOL     bIsDeviceAvailable;    // Insert:TURE, Remove:FALSE
438   /**
439    * \~english USB Infomation
440    */
441   SS_UsbInfo  usb_info;      // USB Infomation
442 }SS__CWORD57_DetectInfo;
443
444 // Structure that is available when SS_DEV_DETECT_USB_ACM_EV is published.
445 /**
446  * \~english Structure that is available when SS_DEV_DETECT_USB_ACM_EV is published.
447  */
448 typedef struct _AcmDetectInfo {
449   /**
450    * \~english Insert:TURE, Remove:FALSE
451    */
452   BOOL          bIsDeviceAvailable;             // Insert:TURE, Remove:FALSE
453   /**
454    * \~english USB Infomation
455    */
456   SS_UsbInfo    usb_info;                       // USB Infomation
457   /**
458    * \~english ACM device file
459    */
460   int8_t        deviceFile[FILEPATH_SIZE];      // ACM device file
461 }SS_AcmDetectInfo;
462
463 // Structure that is available when SS_DEV_DETECT_USB_DEV_MNG_EV is published.
464 /**
465  * \~english Structure that is available when SS_DEV_DETECT_USB_DEV_MNG_EV is published.
466  */
467 typedef struct _DevMngDetectInfo {
468   /**
469    * \~english Insert:TURE, Remove:FALSE
470    */
471   BOOL          bIsDeviceAvailable;             // Insert:TURE, Remove:FALSE
472   /**
473    * \~english USB Infomation
474    */
475   SS_UsbInfo    usb_info;                       // USB Infomation
476   /**
477    * \~english Device Manager device file
478    */
479   int8_t        deviceFile[FILEPATH_SIZE];      // Device Manager device file
480 }SS_DevMngDetectInfo;
481
482 // Structure that is available when SS_DEV_DETECT_USB_DEV_VEHICLE_CTRL_EV is published.
483 /**
484  * \~english Structure that is available when SS_DEV_DETECT_USB_DEV_VEHICLE_CTRL_EV is published.
485  */
486 typedef struct _VehicleCtrlDetectInfo {
487   /**
488    * \~english Insert:TURE, Remove:FALSE
489    */
490   BOOL          bIsDeviceAvailable;             // Insert:TURE, Remove:FALSE
491   /**
492    * \~english USB Infomation
493    */
494   SS_UsbInfo    usb_info;                       // USB Infomation
495   /**
496    * \~english Vehicle control device file
497    */
498   int8_t        deviceFile[FILEPATH_SIZE];      // Vehicle control device file
499 }SS_VehicleCtrlDetectInfo;
500
501 // Structure for audio detect info.
502 /**
503  * \~english Structure for audio detect info.
504  */
505 typedef struct _AudioDetectInfo {
506   /**
507    * \~english Insert:TURE, Remove:FALSE
508    */
509   BOOL bIsDeviceAvailable;
510   /**
511    * \~english USB Infomation
512    */
513   SS_UsbInfo usb_info;
514   /**
515    * \~english Audio control device file
516    */
517   int8_t audio_ctrl[FILEPATH_SIZE];
518   /**
519    * \~english Audio Playback device file
520    */
521   int8_t audio_play[FILEPATH_SIZE];
522   /**
523    * \~english Audio Capture device file
524    */
525   int8_t audio_capture[FILEPATH_SIZE];
526 }SS_AudioDetectInfo; 
527
528 // Structure that is available when SS_DEV_DETECT_USB_DSRC_APP_EV is published.
529 /**
530  * \~english Structure that is available when SS_DEV_DETECT_USB_DSRC_APP_EV is published.
531  */
532 typedef struct _DsrcAppDetectInfo {
533   /**
534    * \~english Insert:TURE, Remove:FALSE
535    */
536   BOOL          bIsDeviceAvailable;             // Insert:TURE, Remove:FALSE
537   /**
538    * \~english USB Infomation
539    */
540   SS_UsbInfo    usb_info;                       // USB Infomation
541   /**
542    * \~english Dsrc Application device file
543    */
544   int8_t        deviceFile[FILEPATH_SIZE];      // Dsrc Application device file
545 }SS_DsrcAppDetectInfo;
546
547 // Structure that is available when SS_DEV_DETECT_USB_DSRC_CTRL_EV is published.
548 /**
549  * \~english Structure that is available when SS_DEV_DETECT_USB_DSRC_CTRL_EV is published.
550  */
551 typedef struct _DsrcCtrlDetectInfo {
552   /**
553    * \~english Insert:TURE, Remove:FALSE
554    */
555   BOOL          bIsDeviceAvailable;             // Insert:TURE, Remove:FALSE
556   /**
557    * \~english USB Infomation
558    */
559   SS_UsbInfo    usb_info;                       // USB Infomation
560   /**
561    * \~english Dsrc Control device file
562    */
563   int8_t        deviceFile[FILEPATH_SIZE];      // Dsrc Control device file
564 }SS_DsrcCtrlDetectInfo;
565
566 // Structure that is available when SS_DEV_DETECT_USB_IR_VICS_DATA_EV is published.
567 /**
568  * \~english Structure that is available when SS_DEV_DETECT_USB_IR_VICS_DATA_EV is published.
569  */
570 typedef struct _IrVicsDataDetectInfo {
571   /**
572    * \~english Insert:TURE, Remove:FALSE
573    */
574   BOOL          bIsDeviceAvailable;             // Insert:TURE, Remove:FALSE
575   /**
576    * \~english USB Infomation
577    */
578   SS_UsbInfo    usb_info;                       // USB Infomation
579   /**
580    * \~english Ir Vics Data device file
581    */
582   int8_t        deviceFile[FILEPATH_SIZE];      // Ir Vics Data device file
583 }SS_IrVicsDataDetectInfo;
584
585 /**
586  * \~english USB overcurrent error info.
587  */
588 typedef  struct  _UsbOverCurrentErrInfo {
589   /**
590    * \~english error port no
591    */
592   uint8_t   portNo;    // error port no
593 } SS_UsbOverCurrentErrInfo;
594
595 // Structure that is available when SS_DEV_INFO_USB_NOTIFY_EV is published.
596 /**
597  * \~english Structure that is available when SS_DEV_INFO_USB_NOTIFY_EV is published.
598  */
599 typedef struct _UsbNotifyInfo {
600   /**
601    * \~english notify code
602    */
603   SS_NOTIFY_CODE  nofity_code;    // notify code
604   /**
605    * \~english USB device information's availability
606    */
607   BOOL      usb_info_availability;  // USB device information's availability
608   /**
609    * \~english USB device information
610    */
611   SS_UsbInfo    usb_info;    // USB device information
612 } SS_UsbNotifyInfo;
613
614 // Structure that is available when SS_DEV_DETECT_ANY_USB__CWORD57__ROLE_EV is published.
615 /**
616  * \~english Structure that is available when SS_DEV_DETECT_ANY_USB__CWORD57__ROLE_EV is published.
617  */
618 typedef struct __CWORD57_RoleDetectInfo {
619   /**
620    * \~english Insert:TURE, Remove:FALSE
621    */
622   BOOL          bIsDeviceAvailable;             // Insert:TURE, Remove:FALSE
623 } SS__CWORD57_RoleDetectInfo;
624
625 // Structure that is available when SS_DEV_INFO_SD_FORMAT_COMP_EV is published.
626 /**
627  * \~english Structure that is available when SS_DEV_INFO_SD_FORMAT_COMP_EV is published.
628  */
629 typedef struct _SDFormatInfo {
630   /**
631    * \~english Result of SD Format.
632    */
633   SS_DEV_ERROR          result;             // Result of SD Format.
634 } SS_SDFormatInfo;
635
636 #endif /* _SS_DEVICEDETECTION_SERVER_H_ */  // NOLINT (build/header_guard)
637
638 /** @}*/  // end of device_detection_service
639 /** @}*/  // end of system_service
640 /** @}*/  // end of BaseSystem