Skip to content

Commit

Permalink
Merge pull request #9 from nykytenko/feature/minor_2021
Browse files Browse the repository at this point in the history
tab correction & updated to 2021
  • Loading branch information
nykytenko authored Mar 9, 2021
2 parents 7f7316f + 402c811 commit 6d3f03c
Show file tree
Hide file tree
Showing 5 changed files with 768 additions and 771 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (©) 2014-2020 Oleg Nykytenko
Copyright (©) 2014-2021 Oleg Nykytenko

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
# onyx-serial

onyx-serial: the D simple serial port library.
onyx-serial: Serial port library for D.


## Key features:
- Open/close serial port.
- Write/read to/from serial port.
- Setup speed - standard value from 50 to 4,000,000.
- parity - none, odd, even.
- Setup read timeout in mS.
- Check is port open.
- Working on posix OS (Linux, OSX, FreeBSD, Solaris).
- Setup: speed - standard value from 50 to 4,000,000.
- Setup: parity - none, odd, even.
- Setup: read timeout in mS.
- Check: is port open.
- Platforms: posix OS (Linux, OSX, FreeBSD, Solaris).


## Examples:

```D
import onyx.serial;
import onyx.serial;
/* Create ports */
auto port1 = OxSerialPort("dev/ttyS1", Speed.B9600, Parity.none, 1000);
auto port2 = OxSerialPort("dev/ttyS2", Speed.B9600, Parity.none, 1000);
/* Create ports */
auto port1 = OxSerialPort("dev/ttyS1", Speed.S9600, Parity.none, 1000);
auto port2 = OxSerialPort("dev/ttyS2", Speed.S9600, Parity.none, 1000);
port1.open;
port2.open;
port1.open;
port2.open;
ubyte[] data = [0x22, 0x33, 0xCC];
ubyte[] data = [0x22, 0x33, 0xCC];
port1.write(data);
port1.write(data);
ubyte[] buf = port2.read(3);
ubyte[] buf = port2.read(3);
assert (buf == data);
assert (buf == data);
port1.close();
port2.close();
port1.close();
port2.close();
```


```D
string[] s1 =
["[port]",
"name = /dev/ttyr06",
"speed = 57600",
"parity = none",
"time_out = 1500"];
string[] s1 =
["[port]",
"name = /dev/ttyr06",
"speed = 57600",
"parity = none",
"time_out = 1500"];
auto bundle = new immutable Bundle(s1);
auto bundle = new immutable Bundle(s1);
auto port3 = OxSerialPort(bundle);
auto port3 = OxSerialPort(bundle);
```


```D
auto bundle = new immutable Bundle("./config/port4.conf");
auto bundle = new immutable Bundle("./config/port4.conf");
auto port4 = OxSerialPort(bundle);
auto port4 = OxSerialPort(bundle);
```
18 changes: 9 additions & 9 deletions dub.sdl
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name "onyx-serial"
description "The D Serial port library"
description "Serial port library for D."
license "MIT"
copyright "Copyright © 2014-2020"
copyright "Copyright © 2014-2021"
authors "Oleg Nykytenko"

targetPath "./bin"

configuration "test" {
targetType "executable"
sourcePaths "test/" "source/"
mainSourceFile "test/main.d"
versions "vOnyxSerialTest"
targetType "executable"
sourcePaths "test/" "source/"
mainSourceFile "test/main.d"
versions "vOnyxSerialTest"
}

configuration "library" {
targetType "library"
excludedSourceFiles "test/main.d"
targetType "library"
excludedSourceFiles "test/main.d"
}


dependency "onyx-config" version=">=2.0.12"
dependency "onyx-config" version=">=2.0.13"
2 changes: 1 addition & 1 deletion dub.selections.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"fileVersion": 1,
"versions": {
"onyx-config": "2.0.3"
"onyx-config": "2.0.13"
}
}
Loading

0 comments on commit 6d3f03c

Please sign in to comment.