瀏覽代碼

仅使用蓝牙链接,移除logo

cc12458 3 月之前
父節點
當前提交
49a6d760d8

+ 2 - 1
.gitignore

@@ -14,4 +14,5 @@
 .cxx
 local.properties
 .kotlin/
-**/build/**
+**/build/**
+app/libs/ble-release-debug.aar

+ 6 - 0
.idea/AndroidProjectSystem.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="AndroidProjectSystem">
+    <option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
+  </component>
+</project>

+ 10 - 0
.idea/deploymentTargetSelector.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="deploymentTargetSelector">
+    <selectionStates>
+      <SelectionState runConfigName="app">
+        <option name="selectionMode" value="DROPDOWN" />
+      </SelectionState>
+    </selectionStates>
+  </component>
+</project>

+ 2 - 3
.idea/gradle.xml

@@ -4,11 +4,10 @@
   <component name="GradleSettings">
     <option name="linkedExternalProjectsSettings">
       <GradleProjectSettings>
-        <option name="testRunner" value="GRADLE" />
-        <option name="distributionType" value="DEFAULT_WRAPPED" />
+        <option name="testRunner" value="CHOOSE_PER_TEST" />
         <option name="externalProjectPath" value="$PROJECT_DIR$" />
         <option name="gradleHome" value="$PROJECT_DIR$/../../../Cache/.gradle/wrapper/dists/gradle-7.0.2-bin/857tjihv64xamwrf0h14cai3r/gradle-7.0.2" />
-        <option name="gradleJvm" value="corretto-11" />
+        <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
         <option name="modules">
           <set>
             <option value="$PROJECT_DIR$" />

+ 10 - 0
.idea/migrations.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectMigrations">
+    <option name="MigrateToGradleLocalJavaHome">
+      <set>
+        <option value="$PROJECT_DIR$" />
+      </set>
+    </option>
+  </component>
+</project>

+ 17 - 0
.idea/runConfigurations.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RunConfigurationProducerService">
+    <option name="ignoredProducers">
+      <set>
+        <option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
+        <option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
+        <option value="com.intellij.execution.junit.PatternConfigurationProducer" />
+        <option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
+        <option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
+        <option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
+        <option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
+        <option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
+      </set>
+    </option>
+  </component>
+</project>

+ 0 - 26
TYUsbSDK/src/androidTest/java/com/taiyi/tyusbsdk/ExampleInstrumentedTest.java

@@ -1,26 +0,0 @@
-package com.taiyi.tyusbsdk;
-
-import android.content.Context;
-
-import androidx.test.platform.app.InstrumentationRegistry;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.*;
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-@RunWith(AndroidJUnit4.class)
-public class ExampleInstrumentedTest {
-    @Test
-    public void useAppContext() {
-        // Context of the app under test.
-        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
-        assertEquals("com.taiyi.tyusbsdk.test", appContext.getPackageName());
-    }
-}

二進制
TYUsbSDK/src/main/res/drawable/device_7.png


+ 0 - 17
TYUsbSDK/src/test/java/com/taiyi/tyusbsdk/ExampleUnitTest.java

@@ -1,17 +0,0 @@
-package com.taiyi.tyusbsdk;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-public class ExampleUnitTest {
-    @Test
-    public void addition_isCorrect() {
-        assertEquals(4, 2 + 2);
-    }
-}

+ 1 - 1
app/build.gradle

@@ -42,7 +42,7 @@ dependencies {
     androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
     implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
 //    implementation project(path: ':ble')
-    implementation files('libs/ble-release.aar')
+    implementation files('libs/ble-release-debug.aar')
     implementation 'com.umeng.umsdk:common:9.4.4' //(必选)
     implementation 'com.umeng.umsdk:asms:1.4.1' // asms包依赖(必选)
     implementation 'com.umeng.umsdk:apm:1.5.2' // U-APM包依赖(必选)

二進制
app/libs/ble-release-1.aar


+ 0 - 26
app/src/androidTest/java/com/taiyi/usbmaidemo/ExampleInstrumentedTest.java

@@ -1,26 +0,0 @@
-package com.taiyi.usbmaidemo;
-
-import android.content.Context;
-
-import androidx.test.platform.app.InstrumentationRegistry;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.*;
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-@RunWith(AndroidJUnit4.class)
-public class ExampleInstrumentedTest {
-    @Test
-    public void useAppContext() {
-        // Context of the app under test.
-        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
-        assertEquals("com.taiyi.usbmaidemo", appContext.getPackageName());
-    }
-}

+ 0 - 17
app/src/test/java/com/taiyi/usbmaidemo/ExampleUnitTest.java

@@ -1,17 +0,0 @@
-package com.taiyi.usbmaidemo;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-public class ExampleUnitTest {
-    @Test
-    public void addition_isCorrect() {
-        assertEquals(4, 2 + 2);
-    }
-}

+ 2 - 2
ble/build.gradle

@@ -5,11 +5,11 @@ plugins {
 
 android {
     namespace 'com.taiyi.zhimai'
-    compileSdk 33
+    compileSdk 31
 
     defaultConfig {
         minSdk 21
-        targetSdk 33
+        targetSdk 31
 
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         consumerProguardFiles "consumer-rules.pro"

+ 0 - 25
ble/src/androidTest/java/com/taiyi/zhimai/ExampleInstrumentedTest.java

@@ -1,25 +0,0 @@
-package com.taiyi.zhimai;
-
-import android.content.Context;
-
-import androidx.test.platform.app.InstrumentationRegistry;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.*;
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-@RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest {
-    @Test
-    public void useAppContext() {
-        // Context of the app under test.
-        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
-        assertEquals("com.taiyi.zhimai.test", appContext.getPackageName());
-    }
-}

+ 7 - 5
ble/src/main/java/com/taiyi/zhimai/ui/activity/MeasureMainActivity.java

@@ -129,8 +129,7 @@ public class MeasureMainActivity extends BleStateActivity implements ResultListe
     @Override
     protected void init() {
         initViews();
-        initTab();
-
+        // initTab();
 
         getToken();
 
@@ -138,13 +137,16 @@ public class MeasureMainActivity extends BleStateActivity implements ResultListe
         setDeviceStatusListener();
 
         resetToMeasure();
+
+        connect_mode = CONNECT_MODE_BLE;
+        doConnect();
     }
 
 
     private void initViews() {
         ivBack = findViewById(R.id.iv_back);
-        mTl = findViewById(R.id.tl);
-        mVp = findViewById(R.id.vp);
+//        mTl = findViewById(R.id.tl);
+//        mVp = findViewById(R.id.vp);
         mIvDevice = findViewById(R.id.iv_device);
         mTvOtg = findViewById(R.id.tv_otg);
         mTvScan = findViewById(R.id.tv_scan);
@@ -494,7 +496,7 @@ public class MeasureMainActivity extends BleStateActivity implements ResultListe
             });
 
 
-            setDialogData(mDeviceSAdapter, -1, new DialogTipsUtil.DeviceSelectCallback() {
+            setDialogData(mDeviceSAdapter, 0, new DialogTipsUtil.DeviceSelectCallback() {
                 @Override
                 public void onSuccess(BleDevice bleDevice) {
                     BleManager.getInstance().cancelScan();

二進制
ble/src/main/res/drawable/device_7.png


二進制
ble/src/main/res/drawable/device_7_tiyi.png


+ 4 - 4
ble/src/main/res/layout/activity_measure_main.xml

@@ -45,7 +45,7 @@
 
                 </RelativeLayout>
 
-                <com.google.android.material.tabs.TabLayout
+                <!--<com.google.android.material.tabs.TabLayout
                     android:background="@color/trans_pure"
                     android:id="@+id/tl"
                     android:layout_width="match_parent"
@@ -81,7 +81,7 @@
                         android:text="@string/device_usb" />
 
 
-                </com.google.android.material.tabs.TabLayout>
+                </com.google.android.material.tabs.TabLayout>-->
 
 
                 <androidx.constraintlayout.widget.Guideline
@@ -98,7 +98,7 @@
                     android:orientation="vertical"
                     app:layout_constraintGuide_percent="0.95" />
 
-                <androidx.viewpager.widget.ViewPager
+                <!--<androidx.viewpager.widget.ViewPager
                     android:id="@+id/vp"
                     android:layout_width="0dp"
                     android:layout_height="0dp"
@@ -106,7 +106,7 @@
                     app:layout_constraintBottom_toTopOf="@+id/gd_vp"
                     app:layout_constraintLeft_toLeftOf="@id/gd_vp_l"
                     app:layout_constraintRight_toRightOf="@id/gd_vp_r"
-                    app:layout_constraintTop_toBottomOf="@id/tl" />
+                    app:layout_constraintTop_toBottomOf="@id/tl" />-->
 
                 <TextView
                     android:id="@+id/tv_scan"

+ 0 - 17
ble/src/test/java/com/taiyi/zhimai/ExampleUnitTest.java

@@ -1,17 +0,0 @@
-package com.taiyi.zhimai;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-public class ExampleUnitTest {
-    @Test
-    public void addition_isCorrect() {
-        assertEquals(4, 2 + 2);
-    }
-}