Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
BLE on React Native
Search
januswel
February 08, 2018
Programming
2
1.3k
BLE on React Native
some tips to use BLE on React Native
januswel
February 08, 2018
Tweet
Share
More Decks by januswel
See All by januswel
今日からできる環境カイゼン
januswel
0
720
読みやすいコード クラスメソッド 2022 年度新卒研修
januswel
2
8.9k
Accelerate your business with React Native
januswel
0
2.2k
猫の手も借りたい引っ張りだこ企業による LINE API活用事例発表会! クラスメソッド編
januswel
0
140
現状確認
januswel
0
870
polyglot になろう !!
januswel
1
5.8k
React Native & monorepo
januswel
0
1k
What is React Native?
januswel
1
1.1k
discussion about the bridge
januswel
1
4k
Other Decks in Programming
See All in Programming
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
330
C++でシェーダを書く
fadis
6
4.1k
役立つログに取り組もう
irof
28
9.6k
CSC509 Lecture 12
javiergs
PRO
0
160
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
120
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.7k
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.9k
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
Outline View in SwiftUI
1024jp
1
330
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
290
Featured
See All Featured
Embracing the Ebb and Flow
colly
84
4.5k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
The Cult of Friendly URLs
andyhume
78
6k
Designing the Hi-DPI Web
ddemaree
280
34k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Thoughts on Productivity
jonyablonski
67
4.3k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Navigating Team Friction
lara
183
14k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Transcript
BLE ON REACT NATIVE REACT NATIVE MEETUP #7 2018/01/22 BY
JANUSWEL
About speaker KBOVTXFM TPGUXBSFFOHJOFFS !$VSF"QQ
CO checker
What is CO checker? "EFWJDFUPNFBTVSFDPODFOUSBUJPOTPG$0JOUIF CSFBUI 5IFNFBTVSFEWBMVFTBSFJNQPSUBOUJOEFYUPDVSF OJDPUJOFBEEJDUJPO #VUFYJTUJOHQSPEVDUTBSFWFSZFYQFOTJWF TPEFWJDFT
BSFFRVJQQFEJOPOMZIPTQJUBMTDMJOJDT 8FEFDJEFEUPQSPEVDFBOEEJTUSJCVUFEFWJDFTUP QBUJFOUT
Layout 3FBE8SJUF $0WBMVFT 4VCNJU $0WBMVFT
Layout 3FBE8SJUF $0WBMVFT 4VCNJU $0WBMVFT 5PEBZ`TUPQJD
In CureApp… 8FXPSLFEXJUIIBSEXBSFWFOEPS IBSEXBSFEFTJHO pSNXBSFEFWFMPQNFOU $VSF"QQJTSFTQPOTJCMFGPSUIFTPGUXBSFPG TNBSUQIPOFEFWFMPQNFOU
BLE chips $IPPTFPOFGSPNGPMMPXJOHDBUBMPH IUUQTGBCLVSBHJUCPPLTJPCMFEPDT DPOUFOUNPEVMFIUNM 6TFDIJQTIBWFDFSUJpDBUJPOPGDPNQMJBODF XJUIUFDIOJDBMTUBOEBSET l&WBMVBUJPOCPBSEzTBSFUIFCFTUDIPJDFUPHFU TUBSUFE
BLE scanners "OESPJE#-&4DBOOFS IUUQTQMBZHPPHMFDPNTUPSFBQQTEFUBJMT JEDPNNBDEPNCMFCMFTDBOOFSIMKB J04#-&YQMS IUUQTJUVOFTBQQMFDPNKQBQQCMFYQMS JE NU
Module to use BLE SFBDUOBUJWFCMFNBOBHFS IUUQTHJUIVCDPNJOOPWFJUSFBDUOBUJWF CMFNBOBHFS SFBDUOBUJWFCMFJTOPUNBJOUBJOFEOPMPOHFS
Words $FOUSBM %FWJDFTUPVTFTFSWJDFT 4FFBTDMJFOUTJODMJFOUTFSWFSNPEFM 1FSJQIFSBM %FWJDFTUPQSPWJEFTFSWJDFT 4FFBTTFSWFSTJODMJFOUTFSWFSNPEFM
Words $IBSBDUFSJTUJD 4UPSFUP3FBE8SJUFWBMVFT #POEJOH 'FBUVSFTGPSTFDVSJUZ "WBJMBCMF&ODSZQUJPO"VUIFOUJDBUJPO "MTPDBMMFEBTl1BJSJOHz
Read Peripheral Central
Write Peripheral Central
Notify Peripheral Central
Indicate Peripheral Central
Steps to communicate 4FFEPDVNFOUTPGSFBDUOBUJWFCMFNBOBHFS 4DBOQFSJQIFSBM T $POOFDUUPBEJTDPWFSFEQFSJQIFSBM 3FBE8SJUF/PUJGZ*OEJDBUF
CureApp Use Case 3FBE $0DIBSBDUFSJTUJD XJUIFODSZQUJPO Peripheral Central
React Integration 8FVTF&WFOU&NJUUFS IUUQTHJUIVCDPNBTZODMZ&WFOU&NJUUFS &NJUUJOHFWFOUTXIFO 4DBOOJOHQFSJQIFSBMTJTEPOF 3FBEJTEPOFGSPNQFSJQIFSBMT FUDʜ
React Integration 4FUFWFOUIBOEMFSTJO3FBDUDPNQPOFOU DPNQPOFOU%JE.PVOU $POTVNFFWFOUTXJUITFU4UBUF3FEVYBDUJPOT JOFWFOUIBOEMFST
1 class BleManager extends EventEmitter2 { 2 startScanning() { /*
snip */ } 3 connectToPeripheral() { /* snip */ } 4 async readCharacteristic() { /* snip */ } 5 async startMeasuring() { 6 const value = await this.readCharacteristic() 7 this.emit('READ', value) 8 } 9 } 1 class SomeComponent extends React.Component { 2 handleRead(value) { 3 this.props.actions.storeValues(value) 4 } 5 componentDidMount() { 6 this.props.bleManager.on( 7 'READ', 8 this.handleRead.bind(this) 9 ) 10 } 11 render() { 12 /* render buttons to 13 * - startScanning 14 * - connectToPeripheral, 15 * - startMeasuring */ 16 } 17 }
Problems 4PNF"OESPJEEFWJDFTBSFUPPTMPXUP DPOTVNFFWFOUT "EEXBJUT +VTUBGUFSEFWJDFTBSFCPPUFE DIBSBDUFSJTUJD WBMVFTBSFOPUJOJUJBMJ[FEZFU 8SJUFJOJUJBMWBMVFTUPFBDIDIBSBDUFSJTUJDT CFGPSF3FBE
Problems %POPUGPSHFUlEJTDPOOFDUzGPSFSSPSGSFF EFWFMPQNFOU 5IFSFBSFGFXEFTDSJQUJPOTBCPVUCPOEJOH 5SZBOEFSSPS IUUQXXXTJMFYKQCMPHXJSFMFTT CMVFUPPUIIUNM
Summary 6TJOH#-&JTFBTZPO3FBDU/BUJWF 8FDBOVTFJ04"OESPJEBTQFSJQIFSBMT OPCMFJTBWBJMBCMFUPP IUUQTHJUIVCDPNTBOEFFQNJTUSZOPCMF -FU`THFUTUBSUFE
References IUUQTGBCLVSBHJUCPPLTJPCMFEPDTDPOUFOU NPEVMFIUNM IUUQTHJUIVCDPNJOOPWFJUSFBDUOBUJWFCMF NBOBHFS IUUQXXXTJMFYKQCMPHXJSFMFTT CMVFUPPUIIUNM