Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,10 @@ CI(GitHub Actions)は両方のテストと `npm run build` を回します

## ライセンス

MIT。コマンド列エンコーダは [dz-print](https://github.com/sb-child/dz-print)(MIT)の
実装を参照しています。
本プロジェクトは **MIT** です。ただしコマンド列エンコーダ
(`src/dzpost/protocol.py` / `web/src/protocol.ts`)は
[dz-print](https://github.com/sb-child/dz-print)(**MPL-2.0**)の派生物なので、
この 2 ファイルだけ **MPL-2.0** が適用されます(ファイル単位のコピーレフト)。

- `LICENSE` — MIT(上記 2 ファイル以外)
- MPL-2.0 の全文 — <https://mozilla.org/MPL/2.0/>
7 changes: 6 additions & 1 deletion README.zh-CN.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,9 @@ CI(GitHub Actions)会跑两边的测试和构建。

## 许可

MIT。命令流编码参考了 [dz-print](https://github.com/sb-child/dz-print)(MIT)。
本项目整体为 **MIT**。但命令流编码器(`src/dzpost/protocol.py` / `web/src/protocol.ts`)
是 [dz-print](https://github.com/sb-child/dz-print)(**MPL-2.0**)的衍生作品,
这两个文件单独适用 **MPL-2.0**(文件级 copyleft)。

- `LICENSE` — MIT(上述两个文件之外)
- MPL-2.0 全文 — <https://mozilla.org/MPL/2.0/>
2 changes: 1 addition & 1 deletion docs/PROTOCOL.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 协议速查

来源:DeTong DP305P(`3533:5C32`,序列号 `DP305P-Y60870279`)真机逆向,
以及 `dz-print`(MIT)的参考实现。完整逆向记录见原工作区
以及 `dz-print`(**MPL-2.0**)的参考实现。完整逆向记录见原工作区
`DeTong/REPORT.md`、`DeTong/analysis/ble.md`、`DeTong/dz-print/protocol.md`。

## 命令帧(USB / BLE 相同)
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ version = "0.1.0"
description = "Print Japan Post ClickPost labels on a DeTong DP-series label printer"
readme = "README.md"
requires-python = ">=3.10"
license = { text = "MIT" }
license = { text = "MIT AND MPL-2.0" }
authors = [{ name = "clickpost-printer contributors" }]
keywords = ["clickpost", "japan-post", "label-printer", "thermal-printer", "ble", "web-bluetooth"]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
Expand Down
10 changes: 9 additions & 1 deletion src/dzpost/protocol.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
#
# Derived from dz-print <https://github.com/sb-child/dz-print> (MPL-2.0),
# notably src/image_proc/cmd_parser.rs and src/command/. Only this file is
# under MPL-2.0; the rest of this project stays MIT.

"""DeTong DP-series label printer command stream.

Everything here was reverse-engineered against a DeTong DP305P
(``3533:5C32``, 300 dpi, 960-dot head) and is byte-compatible with the
reference implementation in ``dz-print`` (MIT).
reference implementation in ``dz-print`` (MPL-2.0).

Two layers of framing exist on the wire:

Expand Down
8 changes: 8 additions & 0 deletions web/src/protocol.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
//
// Derived from dz-print <https://github.com/sb-child/dz-print> (MPL-2.0)
// via src/dzpost/protocol.py. Only this file is under MPL-2.0; the rest of
// this project stays MIT.

/**
* DeTong DP-series label printer command stream.
*
Expand Down