Add `TIOCM_OUT1`, `TIOCM_OUT2`, and `TIOCM_LOOP` constants to `termios`
オープン
extension-modules
type-feature
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Feature or enhancement
Proposal:
This issue suggests adding new termios constants.
TIOCM_LOOP
TIOCM_OUT1
TIOCM_OUT2
example:
import array
import fcntl
import termios
f = open('/dev/ttyS0', 'r')
buf = array.array('h', [0])
# return a mask
fcntl.ioctl(f, termios.TIOCMGET, buf)
# some mask operation
# check if the target device has this flag activated
if buf[0] & TIOCM_OUT1: ...
if /* more compare */: ...
It's suitable for the physical characteristics of the terminal equipment, such as interrupt and chip select output
for example, a library like this uses.
https://github.com/makerbot/pyserial
ref:
https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/termios.h
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
- gh-127336
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず issue の termios 例と参照されている Linux の termios ヘッダーを読み、次に、すでに進行中の作業を確認するため、リンクされている PR gh-127336 を調べてください。説明されている ioctl マスクチェックで使用できる 3 つの定数が Python の termios インターフェースから利用可能になれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- linux, python
- 領域
- operating-systems
- issue の種類
- 機能追加
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100