https://github.com/nykytenko/onyx-serial
adresindeki kütüphaneyi kullanarak
import onyx.serial;
//module test.main;
void main()
{
/* Create ports */
auto port1 = OxSerialPort("/dev/ttyS1", 9600, "none", 10);
auto port2 = OxSerialPort("/dev/ttyS2", 9600, "none", 10);
port1.open;
port2.open;
ubyte[] data = [0x22, 0x33, 0xCC];
port1.write(data);
ubyte[] buf = port2.read(3);
assert (buf == data);
port1.close();
}
bu kodu derlemeye çalışıyorum. Ama bir sürü bağlayıcı hatası alıyorum.
Alıntı:
>$ dub
Performing "debug" build using dmd for x86.
onyx-config 2.0.4: target for configuration "library" is up to date.
onyx-serial 0.3.4: target for configuration "test" is up to date.
To force a rebuild of up-to-date targets, run again with --force.
Running ./bin/onyx-serial
onyx.serial.SerialPortSetupException@std/stdio.d(3969): Can't setup serial port (Input/output error)
source/onyx/serial.d:503 core.sys.posix.termios.termios onyx.serial.PosixImpl.getTermios() [0x80d01ef]
source/onyx/serial.d:473 void onyx.serial.PosixImpl.setFlags() [0x80d010f]
source/onyx/serial.d:406 void onyx.serial.PosixImpl.setup() [0x80cfed1]
source/onyx/serial.d:196 bool onyx.serial.OxSerialPort.open() [0x80cf8a7]
test/main.d:14 _Dmain [0x80d793f]
??:? _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv [0x80e6f72]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])).tryExec(scope void delegate()) [0x80e6ed5]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])).runAll() [0x80e6f2e]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x80e6ed5]
??:? _d_run_main [0x80e6e5e]
??:? main [0x80d7a53]
??:? __libc_start_main [0x7cc4d2]
Program exited with code 1
Acaba neden olabilir?
--
[ Bu gönderi, http://ddili.org/forum'dan dönüştürülmüştür. ]