:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
» UI
: . , ID TextView. activity_main.xml layout, TextView id mainText
– .
id TextView
» MainActivity
MainActivity. , , Android Studio . - :
, Android- BLE; BLE-; Grove BLE ; ; ; , .
, . .
Class Level
, BLE, . Grove BLE v1 ( TI CC2540 – ) , :
CHARACTERISTIC_TX = "0000ffe1-0000-1000-8000-00805f9b34fb" CHARACTERISTIC_RX = "0000ffe1-0000-1000-8000-00805f9b34fb"
» Status helper
TextView, . - statusUpdate
– , . UI, .
» BLE-
() Bluetooth , BLE . Bluetooth (BluetoothManager) getSystemService
, – getAdapter()
. – getDefaultAdapter
Bluetooth Manager.
» BLE-
. Bluetooth- startLeScan
, .
API , , , LeScanCallback
. , . . .
@Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { … }
»
BLE- /. TI CC2540 Grove BLE ID «0000ffe0-0000-1000-8000-00805f9b34fb». .
. ( ), BluetoothGattCallback
, onConnectionStateChanged
onServicesDiscovered
.
onConnectionStateChanged
, , mBluetoothGatt.discoverServices()
. .
@Override public void onConnectionStateChange (BluetoothGatt gatt, int status, int newState) { … } @Override public void onServicesDiscovered (BluetoothGatt gatt, int status) { … }
, . .
»
- sendMessage
. UDID setValue
. , BluetoothGatt writeCharacteristic
, .
setValue
. ; , BLE- , .
Intel Edison.
Intel Edison, Grove BLE
. , Intel Edison Arduino.
Grove, «» Arduino. , Grove BLE v1 UART.
Intel Edison Grove Shield BLE
– Android Intel Edison. , . Serial Monitor, (IDE) Arduino.
GitHub .
IDE Intel Arduino . « SimpleSerial ». Arduino , Intel Edison . , Edison, Edison Grove BLE. UART microUSB, BLE UART Grove.
Intel Edison. setup()
, loop()
. .
»
Grove BLE 9600 , . . AT- Grove BLE . setup()
.
, «Serial» ( microUSB- UART), – «Serial1» (UART, Grove BLE).
»
– . read()
, , print()
.
Edison , 9600 .
Verify IDE Arduino ( ) . , Intel Edison ( ). – Android. Serial Monitor Arduino IDE ( ) – .
Android BLEConnect Intel Edison. Serial Monitor «Hello Grove BLE». - , , , Android. , , .
GitHub , Grove LCD. , Grove 5, LCD- I2C.
BLEConnect
Arduino IDE Serial Monitor BLEConnect-
Android, . Android BLE , UI . Arduino Time Library , . GitHub, – .
!
Source: https://habr.com/ru/post/252919/