2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

はじめに

↑ 上の記事で使用した GanCube は、Bluetooth でつなぐことができるキューブでした。

そして、TypeScript で書かれたライブラリが Githubに公開されています。

  • Library for interaction with GAN Smart Timers and GAN Smart Cubes using Web Bluetooth API

Node.jsでも動作しました。

Python で書いた

そして、上のライブラリを Python に書き直した コードを Github におきました。
Web Bluetooth APIの代わりにbleakを使用しています。

(ただし、自分が持っている gen2 キューブのみ対象)

Swift で書いた

さらに、Swiftに書き直して、以前のアプリと連動させてみました。
次のライブラリを使用しています。

・Bluetooth 通信
A small library that adds concurrency to CoreBluetooth APIs.
https://github.com/manolofdez/AsyncBluetooth

・暗号処理(AES128bit)
A Swift wrapper for Apple's CommonCrypto library.
https://github.com/iosdevzone/IDZSwiftCommonCrypto

操作風景

1.5倍速再生 ( たどたどしい手つきですみません

コード

Xcodeプロジェクトは ↓こちらです。Macでのみ動作


過去記事のリンク



以上

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?