I'm new using the D programming language and I was wondering if D can make use of the Serial port or usb port?
USB allows data to travel on the average of ten times the speed of the normal parallel port. It is also faster than a serial port. The average serial port transfer rate is 150 kbps; the USB port is up to 12 Mbps. USB 2 is forty times faster, with a maximum transfer rate of 480 Mbps.
The serial port standard is RS-232. This standard is used for transmitting serial communication between devices, which are usually called data communications equipment (DCE) and data terminal equipment (DTE). The serial port uses a nine-pin (DE-9) connector or a 25-pin (DB-25) connector.
Universal Serial Bus (USB) is a type of cable and connector commonly used for half-duplex or full-duplex serial data transmission between a computer and attached devices.
That would presumably involve system calls of some kind, which would be in C, but you can call C functions from D, so unless there's a library that will wrap it for you (which I rather doubt), you'll have to figure out what the appropriate C calls are and use them.
Creating bindings to C libraries is pretty straightforward in D, so you might try libusb for cross-system USB access.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With