iOSDC 2019 BLE

C58d9fc209cfdc0b822f851911110fa6?s=47 coe
September 01, 2019

iOSDC 2019 BLE

iOSDC 2019 BLE and L2CAP

C58d9fc209cfdc0b822f851911110fa6?s=128

coe

September 01, 2019
Tweet

Transcript

  1. 2.

    ࣗݾ঺հ w ೔޲ڧʢ5TVZPTIJ)ZVHBʣ w גࣜձࣾ"NB[JB w !DP⒎FFHZVOZV w IUUQTHJUIVCDPNDPF w

    J1IPOF04ʙ w "OESPJE%POVUʙ w 5JUBOJVN.PCJMF w UW04ʙ
  2. 5.
  3. 6.
  4. 10.
  5. 13.
  6. 19.
  7. 25.
  8. 32.
  9. 42.

    -$"1ʹΑΔ૒ํ޲௨৴ J04 "OESPJE -$"1௨৴༻ͷ $IBOOFMΛ༻ҙ͢Δ CBPeripheralManager#publis hL2CAPChannel(withEncrypti on:) BluetoothAdapter#listenUsin gL2capChannel()

    14.ͱ͍͏൪߸͕෷͍ग़ ͞ΕΔ CBPeripheralManagerDelegat e#peripheralManager(_:didPu blishL2CAPChannel:error:) BluetoothServerSocket# getPsm() 1FSJQIFSBMଆͰ෷͍ग़͞Ε͍ͯΔ 14.Λࢦఆ͠ɺ -$"1$IBOOFMͷΦʔϓϯΛߦ͏ CBPeripheral#openL2CAPChannel(_:) BluetoothDevice# createL2capChannel(psm) BluetoothSocket#connect() -$"1$IBOOFM͕Φʔϓ ϯ͞Εͨ͜ͱΛ͓ޓ͍ݕ஌͢Δ CBPeripheralDelegate#peripheral(_:did Open:error:) CBPeripheralManagerDelegate.periphe ralManager(_:didOpen:error:) BluetoothServerSocket#acc ept() ૒ํ޲௨৴ ޙड़ ޙड़
  10. 58.
  11. 63.

    $FOUSBMˠ1FSJQIFSBM $IBSBDUFSJTUJD ໊લ छผ ໾ׂ 1 σʔλॻ͖ࠐΈ Write with response

    ૹ৴͢Δσʔλͦͷ΋ͷ 2 σʔλॻ͖ࠐΈόΠτ਺௨஌ొ࿥ Notify Central͔ΒPeripheralʹॻ ͖ࠐ·ΕͨRaw DataαΠ ζΛ௨஌
  12. 64.
  13. 73.

    1FSJQIFSBM J1IPOF1MVT 1FSJQIFSBM 1JYFMB $FOUSBM J1IPOF1MVT - 180 $FOUSBM 1JYFMB

    20 - "OESPJE͸ɺJ04ʹൺ΂ɺഒ΄Ͳͷεϐʔυͷ͕ࠩ͋Δ σʔλॻ͖ࠐΈόΠτ਺
  14. 94.

    

  15. 95.

    

  16. 114.
  17. 115.

    $FOUSBMXSJUFCZUFT 1FSJQIFSBM J1IPOF 1FSJQIFSBM 1JYFMB 1FSJQIFSBM J1IPOF94.BY $FOUSBM J1IPOF -

    180 180 $FOUSBM 1JYFMB 514 - 514 $FOUSBM J1IPOF94.BY 512 512 - ಉҰ04Ͱ͋ͬͯ΋ɺ୺຤ʹΑͬͯૹ৴Ͱ͖ΔόΠτ਺ʹ͕ࠩग़Δ
  18. 117.
  19. 123.
  20. 125.

    1FSJQIFSBMˠ$FOUSBM $IBSBDUFSJTUJD ໊લ छผ ໾ׂ 1 ಡΈऔΓϦΫΤετ Write with response

    σʔλͷಡΈऔΓ։࢝ό ΠτҐஔΛࢦఆ͢Δ 2 ಡΈऔΓϨεϙϯε௨஌ొ࿥ Notify ಡΈऔΓϦΫΤετ͔Βɺ ૹΓ͍ͨσʔλΛ੾Γऔͬ ͯ௨஌͢Δ
  21. 134.
  22. 141.

    σʔλ͕ਖ਼͘͠ૹΕͳ͍ w όΠτΦʔμʔ -JUUMF&OEJBO #JH&OEJBO ʹ໰୊͕͋Γ·͢ w J04ଆ w όΠτΦʔμʔΛ֬ೝ͢Δ

    #ZUF0SEFS6UJMJUJFT  w $'#ZUF0SEFS(FU$VSSFOU  w "OESPJEଆ w #ZUF#V⒎FSͷѻ͍ʹؾΛ͚ͭΔ w #ZUF#V⒎FSͷॳظόΠτΦʔμʔ͸#JHFOEJBOͰ͢ w #ZUF#V⒎FSPSEFS