Coder Social home page Coder Social logo

onyx-serial's People

Contributors

nykytenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

onyx-serial's Issues

compile errors with the latesd dmd compiler

../../.dub/packages/onyx-serial-0.3.4/source/onyx/serial.d(476,19): Error: undefined identifier 'CRTSCTS'
../../.dub/packages/onyx-serial-0.3.4/source/onyx/serial.d(477,61): Error: undefined identifier 'ECHOCTL', did you mean variable 'ECHONL'?
../../.dub/packages/onyx-serial-0.3.4/source/onyx/serial.d(477,71): Error: undefined identifier 'ECHOPRT'
../../.dub/packages/onyx-serial-0.3.4/source/onyx/serial.d(477,81): Error: undefined identifier 'ECHOKE', did you mean variable 'ECHOE'?
dmd failed with exit code 1.

Allow the read method to block for input

I've been reading the code around and the read method is works nicely unless you are expecting to read something at an unknown time. I feel that it is relevant to allow the code user to block while the method is unable to read anything (I myself am currently in need of that feature).

I have a pretty good idea about the implementation, so I can do it myself. Interested in a pull request to include this in v4.0?

Linker error when I try to build example program

import onyx.serial;

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();
}

Hello. I changed main.d like this and when I try to compile program using dub I get linker errors like this.

$ dub
Package onyx-config can be upgraded from 2.0.3 to 2.0.4.
Use "dub upgrade" to perform those changes.
Performing "debug" build using dmd for x86.
onyx-config 2.0.3: 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 [0x80e6f92]
??:? void rt.dmain2.d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x80e6ef5]
??:? void rt.dmain2.d_run_main(int, char**, extern (C) int function(char[][])).runAll() [0x80e6f4e]
??:? void rt.dmain2.d_run_main(int, char
, extern (C) int function(char[][])
).tryExec(scope void delegate()) [0x80e6ef5]
??:? _d_run_main [0x80e6e7e]
??:? main [0x80d7a53]
??:? __libc_start_main [0x1294d2]
Program exited with code 1

Any ideas? Thanks.

Parity enum enforced in constructor?

Nice library you made here :)

I was thinking, wouldn't it make much more sense to pass a Parity member instead of a string to specify the parity type? It would be way more typo-proof.

Kind of the same for the BaudRate, since it only makes sense to specify a standard value, accepting an arbitrary integer as a parameter can confuse the code user.

What do you think? Should I do it myself? Any against points?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.