- """
- 1. Creating the gadgets
- -----------------------
-
- For each gadget to be created its corresponding directory must be created::
-
- $ mkdir $CONFIGFS_HOME/usb_gadget/<gadget name>
-
- e.g.::
-
- $ mkdir $CONFIGFS_HOME/usb_gadget/g1
-
- ...
- ...
- ...
-
- $ cd $CONFIGFS_HOME/usb_gadget/g1
-
- Each gadget needs to have its vendor id <VID> and product id <PID> specified::
-
- $ echo <VID> > idVendor
- $ echo <PID> > idProduct
-
- A gadget also needs its serial number, manufacturer and product strings.
- In order to have a place to store them, a strings subdirectory must be created
- for each language, e.g.::
-
- $ mkdir strings/0x409
-
- Then the strings can be specified::
-
- $ echo <serial number> > strings/0x409/serialnumber
- $ echo <manufacturer> > strings/0x409/manufacturer
- $ echo <product> > strings/0x409/product
- """
- Path("%s/functions" % gadget_root).mkdir(parents=True, exist_ok=True)
- Path("%s/configs" % gadget_root).mkdir(parents=True, exist_ok=True)
- Path("%s/bcdDevice" % gadget_root).write_text("%s" % 1) # Version 1.0.0
- Path("%s/bcdUSB" % gadget_root).write_text("%s" % 0x0200) # USB 2.0
- Path("%s/bDeviceClass" % gadget_root).write_text(
- "%s" % 0x00
+ # """
+ # 1. Creating the gadgets
+ # -----------------------
+ #
+ # For each gadget to be created its corresponding directory must be created::
+ #
+ # $ mkdir $CONFIGFS_HOME/usb_gadget/<gadget name>
+ #
+ # e.g.::
+ #
+ # $ mkdir $CONFIGFS_HOME/usb_gadget/g1
+ #
+ # ...
+ # ...
+ # ...
+ #
+ # $ cd $CONFIGFS_HOME/usb_gadget/g1
+ #
+ # Each gadget needs to have its vendor id <VID> and product id <PID> specified::
+ #
+ # $ echo <VID> > idVendor
+ # $ echo <PID> > idProduct
+ #
+ # A gadget also needs its serial number, manufacturer and product strings.
+ # In order to have a place to store them, a strings subdirectory must be created
+ # for each language, e.g.::
+ #
+ # $ mkdir strings/0x409
+ #
+ # Then the strings can be specified::
+ #
+ # $ echo <serial number> > strings/0x409/serialnumber
+ # $ echo <manufacturer> > strings/0x409/manufacturer
+ # $ echo <product> > strings/0x409/product
+ # """
+ Path("%s/functions" % this.gadget_root).mkdir(parents=True, exist_ok=True)
+ Path("%s/configs" % this.gadget_root).mkdir(parents=True, exist_ok=True)
+ Path("%s/bcdDevice" % this.gadget_root).write_text(
+ "%s" % 1, encoding="utf-8"
+ ) # Version 1.0.0
+ Path("%s/bcdUSB" % this.gadget_root).write_text(
+ "%s" % 0x0200, encoding="utf-8"
+ ) # USB 2.0
+ Path("%s/bDeviceClass" % this.gadget_root).write_text(
+ "%s" % 0x00, encoding="utf-8"