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

Synchronized iPhones!

Tachibana Kaoru
September 01, 2018

Synchronized iPhones!

iOSDC 2018

Tachibana Kaoru

September 01, 2018
Tweet

More Decks by Tachibana Kaoru

Other Decks in Technology

Transcript

  1. Synchronized iPhones! iOSDC 2018 @TachibanaKaoru

  2. About Me @TachibanaKaoru Freelance iOS Engineer iOSDC Core Staff (Track

    A) ϘϧμϦϯά޷͖ ࠓ೥ͷςʔϚɿཱྀΛ͠ͳ͕Β࢓ࣄΛ͢Δ όϦౡɺαϯτϦʔχౡɺόϯίΫɺϑΟϯϥϯυɺϊϧ΢Σʔ ͱ͖Ͳ͖φΨϊ 2018 ࢀՃத
  3. ࠓ೔ͷ࿩ iOSσόΠεΛSyncͯ͠΍Γ͍ͨ͜ͱ iOSσόΠεͷ࣌ࠁ߹Θͤ σόΠεؒಉظ

  4. Sync ͯ͠΍Γ͍ͨ͜ͱ

  5. OK

  6. None
  7. None
  8. None
  9. None
  10. None
  11. None
  12. NG

  13. None
  14. None
  15. None
  16. None
  17. None
  18. None
  19. t deviceA deviceB deviceC deviceD

  20. Syncͱ͸ iOS୺຤ͷϦϑϨογϡϨʔτʹ͋Θͤͯಉ͡ը໘Λදࣔ͢Δɻ ୺຤ؒͷදࣔ࣌ؒʹޡ͕ࠩ͋Δ৔߹ɺϦϑϨογϡϨʔτͷߋ৽ִؒҎ Լɻ ୺຤͝ͱʹϦϑϨογϡϨʔτ͕ҟͳΔ৔߹ʹ͸ɺ࠷΋ૣ͍୺຤ʹ͋Θ ͤΔɻ

  21. Syncͱ͸ iOS୺຤Ͱ࠷΋ૣ͍ϦϑϨογϡϨʔτ͸60fps ϦϑϨογϡϨʔτͷߋ৽ִؒ͸1/60 = 16.66 msec

  22. ϦϑϨογϡϨʔτʹ͋Θͤͨඳը CADisplayLinkΛ࢖͑͹ɺϦϑϨογϡϨʔτʹ͋Θͤͯඳը͢Δ͜ͱ͕ Ͱ͖Δɻ iOSͷϦϑϨογϡϨʔτ͸جຊతʹ͸60͕ͩɺ༷ʑͳঢ়گʹΑͬͯ΋ม Խ͢Δɻ σόΠεͷछྨ΍iOS versionɺforeground/backgroundͰಈ࡞͍ͯ͠Δϓ ϩηεʹґଘɻ

  23. How to use CADisplayLink let displaylink = CADisplayLink(target: self, selector:

    #selector(drawSomething)) displaylink?.add(to: .current, forMode: RunLoop.Mode.default)
  24. Ͳ͏΍ͬͨΒ୺຤ؒͷޡࠩΛ16.66 msec ҎԼʹͰ͖Δʁ

  25. ·ͣ͸iPhoneͷγεςϜ࣌ؒΛ ͋ΘͤͯΈΔ

  26. ͯ͞ɻ͜͜ͰɺiPhone͸Ͳ͏΍ͬͯ࣌ ؒΛ͋Θ͍ͤͯΔͷ͔Λ෮श͠·͢ɻ

  27. ձ৔ͷΈͳ͞Μʹ࣭໰Ͱ͢ɻ

  28. iOSσόΠε͸Ͳ͏΍ͬͯ࣌ࠁΛ͋Θ ͍ͤͯΔͷͰ͠ΐ͏ʁ

  29. iOS୺຤ͷ࣌ࠁ͋Θͤ ʢෳ਺ճ౴Մʣ 1. ࣌ใ༻ͷి೾Λ͔͍ͭͬͯΔ 2. Πϯλʔωοτ্ͷ࣌ࠁαʔόʔʹΞΫηε͍ͯ͠Δ 3. GPS৴߸ʹؚ·Εͨ࣌ࠁΛར༻͍ͯ͠Δ 4. ܞଳి࿩ճઢ͔ΒऔಘͰ͖Δ࣌ࠁΛར༻͍ͯ͠Δ

  30. ࣌ใ༻ͷి೾Λ ͔͍ͭͬͯΔ

  31. Πϯλʔωοτ্ ͷ࣌ࠁαʔόʔʹ ΞΫηε͍ͯ͠Δ

  32. GPS৴߸ʹؚ·Εͨ ࣌ࠁΛར༻͍ͯ͠Δ

  33. ܞଳి࿩ճઢ͔ ΒऔಘͰ͖Δ࣌ ࠁΛར༻͍ͯ͠Δ

  34. iOS୺຤ͷ࣌ࠁ͋Θͤ ʢෳ਺ճ౴Մʣ 1. ࣌ใ༻ͷి೾Λ͔͍ͭͬͯΔ 2. Πϯλʔωοτ্ͷ࣌ࠁαʔόʔʹΞΫηε͍ͯ͠Δ 3. GPS৴߸ʹؚ·Εͨ࣌ࠁΛར༻͍ͯ͠Δ 4. ܞଳి࿩ճઢ͔ΒऔಘͰ͖Δ࣌ࠁΛར༻͍ͯ͠Δ

  35. iOS୺຤ͷ࣌ࠁ͋Θͤ 1. ࣌ใ༻ͷి೾Λ͔͍ͭͬͯΔ 2. Πϯλʔωοτ্ͷ࣌ࠁαʔόʔʹΞΫηε͍ͯ͠Δ 3. GPS৴߸ʹؚ·Εͨ࣌ࠁΛར༻͍ͯ͠Δ 4. ܞଳి࿩ճઢ͔ΒऔಘͰ͖Δ࣌ࠁΛར༻͍ͯ͠Δ

  36. iOS୺຤ͷ࣌ࠁ͋Θͤ 1. ࣌ใ༻ͷి೾ ඪ४ి೾ 2. Πϯλʔωοτ্ͷ࣌ࠁαʔόʔʹΞΫηε NTP 3. GPS৴߸ʹؚ·Εͨ࣌ࠁ GPS

    4. ܞଳి࿩ճઢ͔ΒऔಘͰ͖Δ࣌ࠁ NITZ
  37. iOS୺຤ͷ࣌ࠁ͋Θͤ NITZ GPS NTP iPhone ◦ ◦ ◦ iPad (with

    Mobile) ◦ ◦ ◦ iPad (without Mobile) × ◦ ◦ iPod touch × × ◦
  38. iOS୺຤ͷ࣌ࠁ͋Θͤ Ͳͷ୺຤ͰͲͷํࣜΛ༏ઌ͍ͯ͠Δ͔͸ެද͞Ε͍ͯͳ͍ɻ ड৴࣌ͷਫ਼౓ʹΑͬͯ࠾༻ɾෆ࠾༻Λม͍͑ͯΔՄೳੑ΋͋Δɻ

  39. ඪ४ి೾ ৘ใ௨৴ݚڀػߏʢNICTʣͰӡ༻͍ͯ͠Δ࣌ใ༻ͷి೾ ͍ΘΏΔి೾࣌ܭͰ࢖ΘΕ͍ͯΔ࢓૊Έ ೔ຊࠃ಺޲͚ ࣌ࠁ͸UTCͰૹ৴͞ΕΔ

  40. NTP Network্ͷ NTPαʔόʔʢ࣌ࠁαʔόʔʣʹ઀ଓͯ࣌͠ࠁΛઃఆ͢Δɻ UTC͕഑৴͞ΕΔ Mac OSͰ͸ɺσϑΥϧτNTP ͸ time.asia.apple.com ʢมߋՄʣ iosͰ͸ɺσϑΥϧτNTP͸มߋෆՄ

  41. GPS ΞϝϦΧ͕؅ཧ͢ΔӴ੕Λ࢖ͬͨଌҐγεςϜ ੈքதͰ࢖༻Մೳ GPS time͕ૹ৴͞ΕΔ ࣌ࠁਫ਼౓͸ඇৗʹߴ͍͕ɺਖ਼͘͠ܭࢉ͢ΔͨΊʹ͸GPSӴ੕4ͭͷ৴߸Λ ड৴͢Δඞཁ͕͋Δ

  42. NITZ Network Identity and Time Zone ௨৴ΩϟϦΞ͔Β഑৴͞ΕΔ࣌ࠁ ରԠͨ͠ΩϟϦΞͰͷΈ࢖༻Մೳ ਫ਼౓͸ͦΕͧΕͷࣄۀऀʹΑΔ UTCϕʔεͷLocal

    TimeɺTime Zone͕ૹ৴͞ΕΔ
  43. ࣌ࠁ߹Θͤͷํ๏ औಘํ๏ Time ඪ४ి೾ ి೾ UTC NTP Πϯλʔωοτճઢ UTC GPS

    ి೾ GPS Time NITZ ܞଳి࿩ճઢ Local Time (on UTC)
  44. …What is UTC/GPS Time?

  45. JST, UTC, TAI http://www.nict.go.jp/JST/JST5.html JST 13:02:45 UTC 04:02:45 TAI 04:03:22

    9:00:00 0:00:37 TimeZone ???
  46. What is TAI? TAI : Temps Atomique International ʢϑϥϯεޠʣɺࠃࡍݪࢠ࣌ Le

    TAI est une échelle de temps-coordonnée définie dans un repère de référence géocentrique avec comme unité d'échelle la seconde du SI telle qu'elle est réalisée sur le géoïde en rotation ༁ɿTAI ͸, ճస͢ΔδΦΠυ্Ͱ࣮ݱ͞ΕΔ SI ͷඵΛ໨੝Γͷ୯Ґͱͨ͠, ஍৺࠲ඪܥͰఆٛ͞ΕΔ࠲ඪ࣌ͷ໨ ੝ΓͰ͋Δ ― CCDS ͷ੠໌ɺBIPM Com. Cons. Déf. Seconde, 1980, 9, S 15 ٴͼ Metrologia, 1981, 17, 70
  47. What is TAI? TAI ͸ɺճస͢ΔδΦΠυ্Ͱ࣮ݱ͞ΕΔ SI ͷඵΛ໨੝Γͷ୯Ґͱ͠ ͨɺ஍৺࠲ඪܥͰఆٛ͞ΕΔ࠲ඪ࣌ͷ໨੝ΓͰ͋Δɻ δΦΠυͱ͸ɺ஍ٿͷฏۉւਫ໘ʹۃΊͯྑ͘Ұக͢Δ౳δΦϙςϯ γϟϧ໘Λݴ͏ɻʢWikipediaͷδΦΠυͷ߲໨ΑΓʣ

    ·͋ɺʮ͍͍ͩͨւਫ໘্ʯͱͱΒ͍͑ͯͩ͘͞ɻ
  48. ͳͥʮδΦΠυʯ্ͳͷ͔ Ұൠ૬ରੑཧ࿦ͷӨڹͰɺॏྗ৔ͷڧ͞ ʹΑͬͯɺ࣌ؒͷྲྀΕ͕ӨڹΛ͏͚Δ͔ ΒͰ͢ɻ ඪߴ͕ߴ͘ͳΕ͹ͳΔ΄Ͳɺॏྗ͸ऑ͘ ͳΓɺ࣌ؒ͸ૣ͘ਐΈ·͢ɻ Slow Fast

  49. What is TAI? TAI ͸ɺճస͢ΔδΦΠυ্Ͱ࣮ݱ͞ΕΔ SI ͷඵΛ໨੝Γͷ୯Ґͱ͠ ͨɺ஍৺࠲ඪܥͰఆٛ͞ΕΔ࠲ඪ࣌ͷ໨੝ΓͰ͋Δɻ SIͷඵͱ͸ɺʮηγ΢Ϝ133ݪࢠͷجఈঢ়ଶͷ2ͭͷ௒ඍࡉߏ଄४ҐʢF =

    4, M = 0 ͓Αͼ F = 3, M = 0ʣؒͷભҠʹରԠ͢Δ์ࣹͷपظͷ 9 192 631 770 ഒͷܧଓ࣌ؒɻʯʢ1967೥੍ఆʣ 1967೥ΑΓલ͸ɺ̍೔ͷ௕͞Λ 86400 Ͱ෼ׂͨ͠΋ͷͰͨ͠ɻ
  50. What is TAI? TAIͱ͸ɺఱମͷಈ͖ʢ஍ٿ΍ଠཅͳͲʣͷಈ͖Λجૅʹͨ͠Θ͚Ͱ͸ͳ ͘ɺʮ஍ද໘Ͱଌఆ͍ͯ͠Δʢηγ΢Ϝʣݪࢠ࣌ܭΛجຊʹͨ࣌͠ࠁܥʯ

  51. What is UTC? UTC : Coordinated Universal Timeɺ ڠఆੈք࣌ ࠃࡍݪࢠ࣌

    (TAI) ʹ༝དྷ͢Δݪࢠ࣌ܥͷ࣌ࠁͰɺUT1ੈք࣌ʹಉௐ͢ΔΑ ͏ʹௐ੔͞Εͨج४࣌ࠁΛࢦ͢ɻ 1972೥͔Β࢖ΘΕ͍ͯΔɻ
  52. What is UTC? ࠃࡍݪࢠ࣌ (TAI) ʹ༝དྷ͢Δݪࢠ࣌ܥͷ࣌ࠁͰɺUT1ੈք࣌ʹಉௐ͢ΔΑ ͏ʹௐ੔͞Εͨج४࣌ࠁΛࢦ͢ɻ UTCͱTAIͷඵͷ௕͞͸ಉ͡ɻ

  53. What is UTC? ࠃࡍݪࢠ࣌ (TAI) ʹ༝དྷ͢Δݪࢠ࣌ܥͷ࣌ࠁͰɺUT1ੈք࣌ʹಉௐ͢ΔΑ ͏ʹௐ੔͞Εͨج४࣌ࠁΛࢦ͢ɻ UT1͸ఱମͷಈ͖͔Βܭࢉͨ࣌͠ࠁܥ

  54. What is UTC? ݫີͳ࣌ࠁଌఆ͕Ͱ͖ΔΑ͏ʹͳͬͯ͘Δͱɺ̍೥ͷ௕͞ɺ̍೔ͷ௕͞ ͕ݫີʹ͸ҰఆͰ͸ͳ͍͜ͱ͕Θ͔͖ͬͯ·ͨ͠ɻ ͜͜Ͱ͸Θ͔Γ΍͘͢ɺ̍೔ͷ௕͕͞13 SIඵͷ೔ͱɺ16 SIඵͷ೔͕͋Δ ৔߹Λߟ͑ͯݟ·͠ΐ͏ɻ

  55. ఱจ͔࣌Βܭࢉͨ࣌͠ࠁ TAI UT1 ఱจ͔࣌Βܭࢉ ͨ࣌͠ࠁ x13 x13 x13 x13 x13

    X13 1೔ͷ௕͕͞13 SIඵͷ೔ 1೔ͷ௕͕͞13 SIඵͷ೔ 1೔ͷ௕͕͞16 SIඵͷ೔
  56. Մมඵ ΋͠ɺʮ̍೔ͷ௕͞ͷ86400 ෼ׂʯΛඵͰఆٛͯ͠͠·͏ͱɺ೔ʹΑͬ ͯ̍ඵͷ௕͕͞ҧ͖ͬͯͯ͠·͍·͢ɻ ͜Ε͸ɺ೔ৗੜ׆ΛૹΔ্Ͱ͸໰୊͋Γ·ͤΜ͕ɺ෺ཧ࣮ݧ΍Τϯδ χΞϦϯάʹ͸େ͖ͳࢧো͕Ͱ·͢ΑͶɻ

  57. ̍೔ͷ௕͞ͷมಈ ̍೔ΛSIඵͰදࣔͨ͠΋ͷɻ௕͍೔ͱ୹͍೔Ͱ 5msͷ͕ࠩ͋Δ͜ͱ͕Θ ͔Δɻ

  58. UTC TAI UT1 UTC x13 x13 X13+3 x13 x13 X13

    1೔ͷ௕͕͞13 SIඵͷ೔ 1೔ͷ௕͕͞13 SIඵͷ೔ 1೔ͷ௕͕͞16 SIඵͷ೔ ͏Δ͏ඵ
  59. ͏Δ͏ඵ Leap second : ͏Δ͏ඵ TAIͱఱจ༝དྷͷ࣌ࠁΛ͋ΘͤΔͨΊʹUTCʹૠೖ͞ΕΔ UTCͷӡ༻։͔࢝Βద༻͞Εɺࠓ·Ͱ37ճ͔Βૠೖ͞Ε͍ͯΔ

  60. None
  61. Leap second in iOS and macOS iOSͱMac OSͷ಺෦࣌ܭɺ͓ΑͼFoundationͷDateΫϥε͸Leap second ʹରԠ͍ͯ͠·ͤΜɻ

  62. Leap second in iOS and macOS લճͷ͏Δ͏ඵ͸ɺ2016/12/31 23:59:60 UTCͰͨ͠ɻ 2016/12/31

    23:59:59 UTC 2016/12/31 23:59:60 UTC 2017/01/01 00:00:00 UTC
  63. Leap second in iOS and macOS let calendar = Calendar(identifier:

    .gregorian) // 2016/12/31 23:59 var dateComp20162332235959 = DateComponents() dateComp20162332235959.calendar = calendar dateComp20162332235959.year = 2016 dateComp20162332235959.month = 12 dateComp20162332235959.day = 31 dateComp20162332235959.hour = 23 dateComp20162332235959.minute = 59 dateComp20162332235959.second = 59 dateComp20162332235959.date?.timeIntervalSince1970 // => 1483196399
  64. Leap second in iOS and macOS let calendar = Calendar(identifier:

    .gregorian) // 2016/12/31 23:60 var dateComp20162332235960 = DateComponents() dateComp20162332235960.calendar = calendar dateComp20162332235960.year = 2016 dateComp20162332235960.month = 12 dateComp20162332235960.day = 31 dateComp20162332235960.hour = 23 dateComp20162332235960.minute = 59 dateComp20162332235960.second = 60 dateComp20162332235960.date?.timeIntervalSince1970 // => 1483196400
  65. Leap second in iOS and macOS let calendar = Calendar(identifier:

    .gregorian) // 2017/01/01 00:00 var dateComp20170101000000 = DateComponents() dateComp20170101000000.calendar = calendar dateComp20170101000000.year = 2017 dateComp20170101000000.month = 1 dateComp20170101000000.day = 1 dateComp20170101000000.hour = 0 dateComp20170101000000.minute = 0 dateComp20170101000000.second = 0 dateComp20170101000000.date?.timeIntervalSince1970 // => 1483196400
  66. Leap second in iOS and macOS // 2016/12/31 23:59 dateComp20162332235959.date?.timeIntervalSince1970

    // => 1483196399 // 2016/12/31 23:60 dateComp20162332235960.date?.timeIntervalSince1970 // => 1483196400 // 2017/01/01 00:00 dateComp20170101000000.date?.timeIntervalSince1970 // => 1483196400 2016/12/31 23:60ͱ2017/01/01 00:00͸಺෦తʹ౳͍͠ɻ ʹɹ͏Δ͏ඵʹ͸ରԠ͍ͯ͠ͳ͍ɻ
  67. Leap second in iOS and macOS ݫີʹ͸ɺMac΍iPhone΍ʢͦͷଞͷଟ͘ͷσδλϧσόΠε͸ʣ͢΂ͯ TAIʹ༝དྷ͢Δಠࣗͷݪࢠ࣌ͷ࣌ࠁͰɺඪ४ి೾΍NTPͳͲͷ֤छٕज़ʹ ΑͬͯɺUTCʹಉௐ͢ΔΑ͏ʹௐ੔͞Εͨ࣌ࠁΛ͖͟ΜͰ͍ΔΘ͚Ͱ ͢ɻ

  68. What is GPS Time? http://leapsecond.com/java/gpsclock.htm UTC 04:02:45 GPS 04:02:45 TAI

    04:03:22 0:00:19 ??? 0:00:37 ͏Δ͏ඵ
  69. GPS Time ࠃࡍݪࢠ࣌ (TAI) ʹ༝དྷ͢Δݪࢠ࣌ܥͷ࣌ࠁͰɺ1980/1/6ʹUTCͱಉظ͠ ͍ͯΔ࣌ࠁΛࢦ͢ɻ ॳͷGPSӴ੕ଧ্͕ͪ͛1978೥ɻ ͏Δ͏ඵͷิਖ਼͸ߦͳ͍ͬͯͳ͍ɻʢTAIͱͷࠩ͸Ұఆʣ

  70. ඵͷ௕͞ ͏Δ͏ඵิਖ਼ ӡ༻ظؒ TAI SIඵʢݻఆʣ ͳ͠ 1970~ GPS Time SIඵʢݻఆʣ

    ͳ͠ 1980~ UTC SIඵʢݻఆʣ ͋Γ 1972~ چUTC มಈ ͳ͠ 1961~1971
  71. None
  72. Special relativity in GPS −(v/c)2/2 = − 8.4 × 10−11

  73. General relativity in GPS ΔU/c2 = 5.27 × 10−10

  74. Relativity in GPS −4.45 × 10−10 −(v/c)2/2 = − 8.4

    × 10−11 ΔU/c2 = 5.27 × 10−10
  75. ࣮ࡍͷiOS DeviceͰଌఆͯ͠ΈΔ

  76. ۀ຿ػີ ۀ຿ػີ ۀ຿ػີ

  77. iOS Systemͷ࣌ࠁ߹Θͤਫ਼౓͸ࠓճඞཁ ͳਫ਼౓ʹରͯ͠͸NGͰͨ͠ɻ

  78. Ͳ͏΍ͬͯSync͢Δ?

  79. Peer to Peer Time Sync on BT

  80. BTʹΑΔ৘ใڞ༗ CoreBTͰPeripheralͱCentralؒͰදࣔ৘ใΛڞ༗͢Δɻ ਌ͱͳΔPeripheralʹଞͷ୺຤͕Centralͱͯ͠઀ଓɻ Peripheral͔Β઀ଓͨ͠Centralʹදࣔ৘ใΛૹ৴ɻ BTʹ͓͍ͯPeripheral-CentralؒͰૹ৴Ͱ͖Δ৘ใྔ͸গͳ͍ͨΊɺը ૾σʔλΛૹ৴͢ΔΘ͚Ͱ͸ͳ͘ɺ͋Β͔͡Ί୺຤಺ʹอ࣋͢Δը૾ Λมߋ͢Δํࣜͱ͢Δɻ

  81. BTʹΑΔ৘ใڞ༗ Peripheral͔ΒCentralʹ࣮ࡍʹૹ৴ͯ͠Έͨͱ͜Ζɺฏۉͯ͠20~40 msecͷ஗Ԇ͕ੜ͡ɺཁٻ͞ΕΔ16.66 msecͷൣғʹ͸͓͞·Βͳ͔ͬ ͨɻ

  82. t Peripheral Central 1 Central 2 Central 3 20~40 msec

  83. ௨৴࣌ͷ஗ԆΛফڈ͢Δ BT௨৴ʹ͔͔Δॲཧ࣌ؒ ୺຤಺ͷॲཧ࣌ؒ + ௨৴࣌ؒ ௨৴࣌ؒ ∝ PeripheralͱCentralͷڑ཭

  84. ௨৴࣌ͷ஗ԆΛফڈ͢Δ Central Peripheral Peripheral͔ΒCentralʹTAIΛجຊͱͨ͠ಠࣗͷ࣌ࠁ ܥΛఆظతʹૹ৴͠ɺCentral͔Β΋Peripheralଆʹ ࣗσόΠεͷ࣌ࠁ஋Λૹ৴͢Δɻ

  85. ௨৴࣌ͷ஗ԆΛফڈ͢Δ Peripheral Central 1 2 3 4 5 6 ?

    ? ? ? ? ? 1 - -
  86. ௨৴࣌ͷ஗ԆΛফڈ͢Δ Peripheral Central 1 2 3 4 5 6 0.4

    1.4 2.4 3.4 4.4 5.4 1 1 - -
  87. ௨৴࣌ͷ஗ԆΛফڈ͢Δ Peripheral Central 1 2 3 4 5 6 1.4

    0.4 1.4 2.4 3.4 4.4 5.4
  88. ௨৴࣌ͷ஗ԆΛফڈ͢Δ Peripheral Central 1 2 3 4 5 6 1.4

    2.6 0.4 1.4 2.4 3.4 4.4 5.4
  89. ௨৴࣌ͷ஗ԆΛফڈ͢Δ Peripheral Central 1 2 3 4 5 6 1.4

    2.6 3 2.6 1.4 0.4 1.4 2.4 3.4 4.4 5.4
  90. ௨৴࣌ͷ஗ԆΛফڈ͢Δ Peripheral Central 1 2 3 4 5 6 1.2

    2.6 3 2.6 1.4 3 + ( 2.6 - 1.4) / 2 = 3.6 3.0 0.4 1.4 2.4 3.4 4.4 5.4
  91. ௨৴࣌ͷ஗ԆΛফڈ͢Δ Peripheral Central 1 2 3 4 5 6 1.2

    2.6 3.6 > 3.0 3.0 0.4 1.4 2.4 3.4 4.4 5.4 3 2.6 1.4
  92. ௨৴࣌ͷ஗ԆΛফڈ͢Δ Peripheral Central 1 2 3 4 5 6 1.2

    2.6 3.6 > 3.0 3.6 0.4 1.4 2.4 3.4 4.4 5.4 3 2.6 1.4
  93. ௨৴࣌ͷ஗ԆΛফڈ͢Δ Peripheral Central 1 2 3 4 5 6 1.2

    2.6 3.6 > 3.0 3.6 1.0 2.0 3.0 4.0 5.0 6.0 3 2.6 1.4
  94. ௨৴࣌ͷ஗ԆΛফڈ͢Δ Peripheral Central 1 2 3 4 5 6 1.2

    2.6 3.6 4.0 1.0 2.0 3.0 4.0 5.0 6.0
  95. ௨৴࣌ͷ஗ԆΛফڈ͢Δ Peripheral Central 1 2 3 4 5 6 1.2

    2.6 3.6 4.0 4.6 1.0 2.0 3.0 4.0 5.0 6.0
  96. ௨৴࣌ͷ஗ԆΛফڈ͢Δ Peripheral Central 1 2 3 4 5 6 1.2

    2.6 3.6 4.0 4.6 5 4.6 4.0 1.0 2.0 3.0 4.0 5.0 6.0
  97. ௨৴࣌ͷ஗ԆΛফڈ͢Δ Peripheral Central 1 2 3 4 5 6 1.2

    2.6 3.6 4.0 4.6 5 + (4.6 - 4.0) / 2 = 5.3 5.6 1.0 2.0 3.0 4.0 5.0 6.0 5 4.6 4.0
  98. ௨৴࣌ͷ஗ԆΛফڈ͢Δ Peripheral Central 1 2 3 4 5 6 1.2

    2.6 3.6 4.0 4.6 5.3 < 5.6 5.6 1.0 2.0 3.0 4.0 5.0 6.0 5 4.6 4.0
  99. ௨৴࣌ͷ஗ԆΛফڈ͢Δ Centralଆ͔ΒPeripheralʹࣗσόΠεͷ࣌ࠁΛૹ৴͠ɺPeripheralଆ͔Β͸ ͦͷࠩΛৗʹCentralଆʹૹ৴͢ΔΑ͏ʹઃఆɻ ఆظతʹޡࠩΛૹΔ͜ͱͰɺ࣌ؒࠩΛऩଋͤ͞Δɻ ͜ΕʹΑΓɺPeripheral - Central ؒͷޡࠩΛ10 msecఔ౓ʹ͢Δ͜ͱ͕Մ ೳͱͳͬͨɻ

  100. ͔͠͠ɺ·ͨผͷ੍ݶ͕……

  101. ઀ଓτϥϒϧ 1୆ͷPeripheralʹରͯ͠ɺ4୆ͷCentral· Ͱ͸઀ଓ͢Δ͜ͱ͕Ͱ͖͕ͨɺ5୆໨ͷ CentralΛ઀ଓ͢Δ͜ͱ͕Ͱ͖ͳ͔ͬͨɻ

  102. Appleʹ໰͍߹Θͤ 1୆ͷPeripheralʹ઀ଓͰ͖ΔCentral਺͸ɺ࢓্༷͸੍ݶ͕ͳ͍͕࣮ӡ༻ ্͸౰વ੍ݶ͕͋Δɻ ͦͷ઀ଓ୆਺͸ɺσόΠεͷεϖοΫ΍؀ڥʹΑܾͬͯ·ΓɺҰҙʹఆ ٛ͢Δ͜ͱ͸Ͱ͖ͳ͍ɻ

  103. Single Layer Structure

  104. MultiLayer Structure

  105. Multilayer Structure ͜ΕͰ10୆ఔ౓ͷSync͸Մೳͱͳͬͨɻ ͨͩ͠ɺPeripheralͱCentralΛ͔Ͷͨ୺຤ͷ઀ଓ͕ෆ҆ఆɻ Centralଆ͔ΒPeripheralͷ઀ଓ͕੒ޭ͢Δ͕ɺҰఆ࣌ؒʢ਺ඵʙॏ਺ ඵʣͨͭͱࣗવʹdisconnect͢Δ৔߹͕͋Δɻ

  106. ·ͱΊ BT૬ޓ௨৴Ͱ࣌ࠁࠩΛऩଋͤ͞Δ࢓૊ΈʹΑΓɺ୺຤ؒͷ࣌ࠁࠩΛ10 msecఔ౓·Ͱʹ͢Δ͜ͱ͕Ͱ͖ͨɻ MultiLayer StructureΛͱΔ͜ͱʹΑΓɺBTͷ઀ଓ੍ݶ਺Λ௒͑ͨଟ਺ͷ ୺຤ؒͰͷSync΁ͷՄೳੑ͸ײ͡Δɻ ͨͩ҆ఆ౓ʹ໰୊͕͋Γɺݱঢ়Ͱ͸100୆ͷ୺຤ʹΑΔSync͸ԕ͍ɻ

  107. References •ը૾ ͍Β͢ͱ΍ https://www.irasutoya.com/ •GPSͷ૬ର࿦ิਖ਼ʹ͍ͭͯ GPS ͱ෺ཧʢ໺ଜ ਗ਼ӳʣ http://maya.phys.kyushu-u.ac.jp/~knomura/museum/GPS/node11.html