Skip to content

Commit 6f6a09f

Browse files
author
karurochari
committed
Rigthful citation
1 parent eb29e23 commit 6f6a09f

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
> [!WARNING]
22
> This module will only work on the for [stable-gluegunfw](https://github.com/KaruroChori/txiki.js/tree/stable-gluegunfw)
33
4-
Module to handle serial connections via txiki.js. So that you can talk will all your microcontroller friends.
4+
Module to handle serial connections via txiki.js. So that you can talk will all your microcontroller friends.
55

66
What? Do you want **real** friends?
77
Sorry mate, this library will not help.
8+
9+
Based on information reported @ [https://blog.mbedded.ninja/programming/operating-systems/linux/linux-serial-ports-using-c-cpp/](https://blog.mbedded.ninja/programming/operating-systems/linux/linux-serial-ports-using-c-cpp/) & the linux manual pages

src/ts/index.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,20 @@ const speeds_t = t.Union([
99
t.Literal('B115200'), t.Literal('B230400'), t.Literal('B460800')], { default: 'B9600' });
1010

1111
const serial_cfg_schema = t.Object({
12-
parity: t.Union([t.Literal("disabled"), t.Literal("enabled")], { default: 'disabled' }),
13-
bits: t.Union([t.Literal(5), t.Literal(6), t.Literal(7), t.Literal(8)], { default: 8 }),
14-
stop: t.Union([t.Literal(1), t.Literal(2)], { default: 1 }),
15-
hardware_flow: t.Union([t.Literal("disabled"), t.Literal("enabled")], { default: 'enabled' }),
16-
vtime: t.Integer({ default: 0 }),
17-
vmin: t.Integer({ default: 0 }),
18-
ispeed: speeds_t,
19-
ospeed: speeds_t
12+
parity: t.Optional(t.Union([t.Literal("disabled"), t.Literal("enabled")], { default: 'disabled' })),
13+
bits: t.Optional(t.Union([t.Literal(5), t.Literal(6), t.Literal(7), t.Literal(8)], { default: 8 })),
14+
stop: t.Optional(t.Union([t.Literal(1), t.Literal(2)], { default: 1 })),
15+
hardware_flow: t.Optional(t.Union([t.Literal("disabled"), t.Literal("enabled")], { default: 'enabled' })),
16+
vtime: t.Optional(t.Integer({ default: 0 })),
17+
vmin: t.Optional(t.Integer({ default: 0 })),
18+
ispeed: t.Optional(speeds_t),
19+
ospeed: t.Optional(speeds_t)
2020
}, { additionalProperties: false });
2121
type serial_cfg_t = Static<typeof serial_cfg_schema>
2222

2323
const core = globalThis[Symbol.for('tjs.internal.core')];
2424

25-
export function open(file: string, cfg: serial_cfg_t) {
26-
console.log("BANANA")
25+
export function open(file: string, cfg: serial_cfg_t) : tjs.FileHandle {
2726
const pcfg = Value.Default(serial_cfg_schema, cfg)
2827
//@ts-ignore
2928
const fd = core.$__MODULE__.configure(file, {

0 commit comments

Comments
 (0)