├── android └── android_iap │ ├── app │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ ├── colors.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── layout │ │ │ │ │ └── activity_main.xml │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── jt28 │ │ │ │ └── a6735 │ │ │ │ └── android_iap │ │ │ │ └── MainActivity.java │ │ ├── test │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── jt28 │ │ │ │ └── a6735 │ │ │ │ └── android_iap │ │ │ │ └── ExampleUnitTest.java │ │ └── androidTest │ │ │ └── java │ │ │ └── com │ │ │ └── jt28 │ │ │ └── a6735 │ │ │ └── android_iap │ │ │ └── ExampleInstrumentedTest.java │ ├── proguard-rules.pro │ └── build.gradle │ ├── ble │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ └── values │ │ │ │ │ └── strings.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── jt28 │ │ │ │ │ └── a6735 │ │ │ │ │ └── ble │ │ │ │ │ ├── callback │ │ │ │ │ ├── OnReceiverCallback.java │ │ │ │ │ ├── ConnectCallback.java │ │ │ │ │ ├── ScanCallback.java │ │ │ │ │ ├── OnWriteCallback.java │ │ │ │ │ └── BleDeviceScanCallback.java │ │ │ │ │ ├── request │ │ │ │ │ ├── IRequestQueue.java │ │ │ │ │ └── ReceiverRequestQueue.java │ │ │ │ │ └── BleController.java │ │ │ └── AndroidManifest.xml │ │ ├── test │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── jt28 │ │ │ │ └── a6735 │ │ │ │ └── ble │ │ │ │ └── ExampleUnitTest.java │ │ └── androidTest │ │ │ └── java │ │ │ └── com │ │ │ └── jt28 │ │ │ └── a6735 │ │ │ └── ble │ │ │ └── ExampleInstrumentedTest.java │ ├── build.gradle │ └── proguard-rules.pro │ ├── ymodem │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ └── values │ │ │ │ │ └── strings.xml │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── jt28 │ │ │ │ └── a6735 │ │ │ │ └── ymodem │ │ │ │ ├── YModemListener.java │ │ │ │ ├── TimeOutHelper.java │ │ │ │ ├── SourceScheme.java │ │ │ │ ├── InputStreamSource.java │ │ │ │ ├── L.java │ │ │ │ ├── CRC16.java │ │ │ │ ├── FileStreamThread.java │ │ │ │ ├── YModemUtil.java │ │ │ │ └── YModem.java │ │ ├── test │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── jt28 │ │ │ │ └── a6735 │ │ │ │ └── ymodem │ │ │ │ └── ExampleUnitTest.java │ │ └── androidTest │ │ │ └── java │ │ │ └── com │ │ │ └── jt28 │ │ │ └── a6735 │ │ │ └── ymodem │ │ │ └── ExampleInstrumentedTest.java │ ├── build.gradle │ └── proguard-rules.pro │ ├── settings.gradle │ ├── .idea │ ├── copyright │ │ └── profiles_settings.xml │ ├── encodings.xml │ ├── modules.xml │ ├── runConfigurations.xml │ ├── compiler.xml │ ├── gradle.xml │ └── misc.xml │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── .gitignore │ ├── build.gradle │ ├── gradle.properties │ ├── gradlew.bat │ └── gradlew └── README.md /android/android_iap/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/android_iap/ble/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/android_iap/ymodem/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # android-IAP-stm32 2 | android 读取hex文件 通过蓝牙下载到 stm32单片机 3 | -------------------------------------------------------------------------------- /android/android_iap/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':ymodem', ':ble' 2 | -------------------------------------------------------------------------------- /android/android_iap/ble/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ble 3 | 4 | -------------------------------------------------------------------------------- /android/android_iap/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /android/android_iap/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | android_iap 3 | 4 | -------------------------------------------------------------------------------- /android/android_iap/ymodem/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ymodem 3 | 4 | -------------------------------------------------------------------------------- /android/android_iap/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dh-linghaibin/android-IAP-stm32/HEAD/android/android_iap/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/android_iap/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /android/android_iap/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dh-linghaibin/android-IAP-stm32/HEAD/android/android_iap/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/android_iap/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dh-linghaibin/android-IAP-stm32/HEAD/android/android_iap/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/android_iap/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dh-linghaibin/android-IAP-stm32/HEAD/android/android_iap/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/android_iap/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dh-linghaibin/android-IAP-stm32/HEAD/android/android_iap/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/android_iap/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dh-linghaibin/android-IAP-stm32/HEAD/android/android_iap/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/android_iap/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dh-linghaibin/android-IAP-stm32/HEAD/android/android_iap/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/android_iap/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dh-linghaibin/android-IAP-stm32/HEAD/android/android_iap/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/android_iap/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dh-linghaibin/android-IAP-stm32/HEAD/android/android_iap/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/android_iap/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dh-linghaibin/android-IAP-stm32/HEAD/android/android_iap/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/android_iap/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dh-linghaibin/android-IAP-stm32/HEAD/android/android_iap/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/android_iap/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/android_iap/ble/src/main/java/com/jt28/a6735/ble/callback/OnReceiverCallback.java: -------------------------------------------------------------------------------- 1 | package com.jt28.a6735.ble.callback; 2 | 3 | /** 4 | * 描述:接收设备向手机发送的广播数据 5 | */ 6 | public interface OnReceiverCallback { 7 | 8 | void onRecive(byte[] value); 9 | } 10 | -------------------------------------------------------------------------------- /android/android_iap/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /android/android_iap/ble/src/main/java/com/jt28/a6735/ble/request/IRequestQueue.java: -------------------------------------------------------------------------------- 1 | package com.jt28.a6735.ble.request; 2 | 3 | /** 4 | * 描述:请求队列 5 | */ 6 | public interface IRequestQueue { 7 | 8 | void set(String key, T t); 9 | 10 | T get(String key); 11 | } 12 | -------------------------------------------------------------------------------- /android/android_iap/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Oct 30 14:12:44 CST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /android/android_iap/ble/src/main/java/com/jt28/a6735/ble/callback/ConnectCallback.java: -------------------------------------------------------------------------------- 1 | package com.jt28.a6735.ble.callback; 2 | 3 | /** 4 | * Description: 5 | * Author: Hansion 6 | * Time: 2016/10/11 12:11 7 | */ 8 | public interface ConnectCallback { 9 | /** 10 | * Notify之后的回调 11 | */ 12 | void onConnSuccess(); 13 | 14 | void onConnFailed(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /android/android_iap/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /android/android_iap/ble/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /android/android_iap/ble/src/test/java/com/jt28/a6735/ble/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.jt28.a6735.ble; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /android/android_iap/ymodem/src/test/java/com/jt28/a6735/ymodem/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.jt28.a6735.ymodem; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /android/android_iap/app/src/test/java/com/jt28/a6735/android_iap/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.jt28.a6735.android_iap; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /android/android_iap/ymodem/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /android/android_iap/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.3.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | 21 | task clean(type: Delete) { 22 | delete rootProject.buildDir 23 | } 24 | -------------------------------------------------------------------------------- /android/android_iap/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /android/android_iap/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /android/android_iap/ymodem/src/main/java/com/jt28/a6735/ymodem/YModemListener.java: -------------------------------------------------------------------------------- 1 | package com.jt28.a6735.ymodem; 2 | 3 | /** 4 | * Listener of the transmission process 5 | */ 6 | public interface YModemListener { 7 | 8 | /* the data package has been encapsulated */ 9 | void onDataReady(byte[] data); 10 | 11 | /*just the file data progress*/ 12 | void onProgress(int currentSent, int total); 13 | 14 | /* the file has been correctly sent to the terminal */ 15 | void onSuccess(); 16 | 17 | /* the task has failed with several remedial measures like retrying some times*/ 18 | void onFailed(String reason); 19 | 20 | } -------------------------------------------------------------------------------- /android/android_iap/ble/src/main/java/com/jt28/a6735/ble/callback/ScanCallback.java: -------------------------------------------------------------------------------- 1 | package com.jt28.a6735.ble.callback; 2 | 3 | import android.bluetooth.BluetoothDevice; 4 | 5 | /** 6 | * Description: 7 | * Author: Hansion 8 | * Time: 2016/10/11 12:11 9 | */ 10 | public interface ScanCallback { 11 | /** 12 | * 扫描完成,成功回调 13 | */ 14 | void onSuccess(); 15 | 16 | /** 17 | * 扫描过程中,每扫描到一个设备回调一次 18 | * 19 | * @param device 扫描到的设备 20 | * @param rssi 设备的信息强度 21 | * @param scanRecord 22 | */ 23 | void onScanning(final BluetoothDevice device, int rssi, byte[] scanRecord); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /android/android_iap/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 |