Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Core Bluetooth プログラミング〜 L2CAP初めの⼀歩 〜

Core Bluetooth プログラミング〜 L2CAP初めの⼀歩 〜

■イベント
SansanモバイルエンジニアLT会 & 懇親会 〜春の新生活編〜
https://sansan.connpass.com/event/312187/

■発表者
Mobile Applicationグループ 藤⾨ 莉⽣

■iOSエンジニア 採用情報
https://media.sansan-engineering.com/ios-engineer

■Androidエンジニア 採用情報
https://media.sansan-engineering.com/android-engineer

SansanTech

March 28, 2024
Tweet

More Decks by SansanTech

Other Decks in Technology

Transcript

  1. ⾃⼰紹介 2 © Sansan, Inc. - 名前:藤⾨ 莉⽣(Rio Fujimon) -

    所属:技術本部 Mobile Application グループ - 🔰 23卒 - 🍎 Eight(iOS版)を開発 - SNS:@RioFujimon
  2. 📚Core Bluetoothについてのこれまでの学習 🌸Sansan⼊社 🗣iOSDC2023で Core Bluetoothに ついて発表 4⽉ 9⽉ 3⽉

    L2CAP学習 START 💪 7⽉ Core Bluetoothの 学習START 🏃 💳📱 Core NFCとか学習
  3. 🧑🏫 Core Bluetooth 基礎知識(復習) Central(セントラル) → ScanやConnectを⾏うデバイス Peripheral(ペリフェラル) → Scanで発⾒されるデバイス

    characteristic A(データを保持) ・ ・ ・ characteristic B(データを保持) Service(characteristicを保持) characteristic A(データを保持) ‧ ‧ ‧ characteristic B(データを保持) characteristic C(データを保持) ・ ・ ・ characteristic D(データを保持) Service(characteristicを保持) ‧ ‧ ‧ 1. Advertise →周囲のCentralに ⾃分の存在を通知 2. Scan & Connect → 特定のPeripheral を検索して、 発⾒して接続 3. データのやり取り → Read, Write, Notify ServiceやCharacteristicは、 ユニークな16進数のIDで識別 例:02D11FC9-AEA6-4B49-A57C-F02F32F0498E
  4. 💡L2CAPの要点 PHY LE Physical L2CAP Logical Link Control and Adaption

    Protocol GATT Generic Attribute Profile SMP Security Manager Protocol ATT Attribute Protocol LL Link Layer GAP (Generic Access Profile) Application層 Host層 Controller層 - 無線接続を制御する回路 - 無線接続を制御するソフトウェア群 - 全てソフトウェア Application Interface になる 💡ポイント Host層とController層の間 で様々な形式のパケットを やり取りする機能を実現
  5. GATT (Generic Atributte Profile) - 書き込みのdefault MTU(Maximum Transfer Unit)は 20

    byte - MTU拡張した場合は最⼤ 512 byte - etc ⚖ GATT と L2CAPの⽐較 L2CAP (Logical Link Control and Adaption Protocol) - ⼤量のデータを送信することが可能 - GATTがMTU拡張した512 byteより 多くのデータ送信が可能 - etc
  6. - 👍 Good - L2CAPを利⽤して channel を open し、接続する部分までは容易 -

    👎 Bad - channel を安定的に接続したまま、データの書き込みや読み込みを ⾏うには、設計や実装⽅法に対する知⾒がないと難しそう - 💪 Next - channel を安定的に接続したまま、データの書き込みや読み込みを ⾏う設計や実装⽅法について学習 まとめ