@@ -39,12 +39,18 @@ echo -e "$UDEV_HEADER" > "$UDEV_FILE"
39
39
echo -e " Creating device list"
40
40
HID_LIST=$( grep -hR -e " static\ HIDDeviceDetector" . | cut -d ' (' -f 2- | awk -F , ' { print $2 ":|" $3 "|" $4 "|" $1 "|" }' )
41
41
42
+ # Check the output of the hid_list
43
+ # echo -e "$HID_LIST" >> "hid_list.txt"
44
+
42
45
# -----------------------------------------------------------------------------#
43
46
# Create a list of RGBController.cpp classes including path #
44
47
# -----------------------------------------------------------------------------#
45
48
echo -e " Creating file list to parse metadata"
46
49
FILE_LIST=$( find ${CONTROLLER_PATH} | grep RGBController_ | grep cpp)
47
50
51
+ # Check the output of the file_list
52
+ # echo -e "$FILE_LIST" >> "file_list.txt"
53
+
48
54
# -----------------------------------------------------------------------------#
49
55
# Iterate over the Controller file list and repplace the detectors #
50
56
# for each controller with the list of PIDs #
@@ -53,9 +59,9 @@ while read -r controller
53
59
do
54
60
DATA=$( awk -v RS=' ' ' /\/\*\*/' ${controller} )
55
61
56
- name=$( printf %s " $DATA " | grep @name | sed -e ' s/@name//g' -e ' s/^ *//g' )
57
- type=$( printf %s " $DATA " | grep @type | sed -e ' s/@type//g' -e ' s/^ *//g' )
58
- detectors=$( printf %s " $DATA " | grep @detectors | sed -e ' s/@detectors *//g' -e ' s/^ *//g' -e ' s/\,/\n/g' )
62
+ name=$( printf %s " $DATA " | grep @name | sed -e ' s/\r$// ' -e ' s/ @name//g' -e ' s/^ *//g' )
63
+ type=$( printf %s " $DATA " | grep @type | sed -e ' s/\r$// ' -e ' s/ @type//g' -e ' s/^ *//g' )
64
+ detectors=$( printf %s " $DATA " | grep @detectors | sed -e ' s/\r$// ' -e ' s/ @detectors *//g' -e ' s/^ *//g' -e ' s/\,/\n/g' )
59
65
60
66
if [[ $type = USB || $type = Serial ]]; then # Check that the type is USB
61
67
# # Iterate over the comma seperated detector function list
79
85
device_name=${device_name// [^[:alnum:][:blank:]]/ }
80
86
81
87
udev_line=$( printf ' SUBSYSTEMS=="%s|hidraw", ATTRS{idVendor}=="%s", ATTRS{idProduct}=="%s", TAG+="uaccess", TAG+="%s"\n' ${type,,} ${vid,,} ${pid,,} ${device_name// / _} )
82
-
88
+
83
89
# Check to ensure that the vid and pid are not blank
84
90
if [[ $vid = " " || $pid = " " ]]; then
85
91
echo -e " Blank VID or PID Skipping: ${udev_line} "
0 commit comments