Connected the SmartRing
parent
6cd410e2d9
commit
be294ae264
@ -0,0 +1,52 @@
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
|
||||
android {
|
||||
compileSdkVersion 33
|
||||
|
||||
lintOptions{
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
|
||||
minSdkVersion 18
|
||||
targetSdkVersion 33
|
||||
versionCode 3
|
||||
versionName "3.0"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
consumerProguardFiles 'proguard-rules.pro'
|
||||
}
|
||||
debug {
|
||||
minifyEnabled true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
consumerProguardFiles 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
task makejar(type: Jar) {
|
||||
from file('build/intermediates/javac/debug/classes')
|
||||
archiveName = '2301sdk' + defaultConfig.versionName + '.jar'
|
||||
destinationDir = file('build/libs')
|
||||
include "com/jstyle/blesdk2301/**"
|
||||
|
||||
|
||||
}
|
||||
makejar.dependsOn(build)
|
||||
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
}
|
||||
Binary file not shown.
@ -0,0 +1,26 @@
|
||||
package com.jstyle.blesdk2301;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.test.InstrumentationRegistry;
|
||||
import android.support.test.runner.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() throws Exception {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||
|
||||
assertEquals("com.jstyle.blesdk.test", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,10 @@
|
||||
package com.jstyle.blesdk2301.callback;
|
||||
|
||||
public interface BleConnectionListener {
|
||||
void BleStatus(int status,int newState);//蓝牙4.0连接状态 Bluetooth 4.0 connection status
|
||||
void ConnectionSucceeded();//连接设备成功 Successfully connected the device
|
||||
void Connecting();//设备连接中 Device is connected
|
||||
void ConnectionFailed();//设备连接失败 Device connection failed
|
||||
void OnReconnect();//重新连接中 Reconnecting
|
||||
void BluetoothSwitchIsTurnedOff();//蓝牙开关被关闭 Bluetooth switch is turned off
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package com.jstyle.blesdk2301.callback;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/4/10.
|
||||
*/
|
||||
|
||||
public interface DataListener2301 {
|
||||
void dataCallback(Map<String, Object> maps);
|
||||
void dataCallback(byte[] value);
|
||||
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package com.jstyle.blesdk2301.callback;
|
||||
|
||||
|
||||
import com.jstyle.blesdk2301.model.Device;
|
||||
|
||||
public interface OnScanResults {
|
||||
void Success(Device date);
|
||||
void Fail(int code);
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.jstyle.blesdk2301.cmdenum;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class YhDeviceData implements Serializable {
|
||||
int dataType;// is index
|
||||
String data="";//data object
|
||||
boolean dataEnd=false; //Is it over?
|
||||
|
||||
public boolean isDataEnd() {
|
||||
return dataEnd;
|
||||
}
|
||||
|
||||
public void setDataEnd(boolean dataEnd) {
|
||||
this.dataEnd = dataEnd;
|
||||
}
|
||||
|
||||
public int getDataType() {
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public void setDataType(int dataType) {
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
public String getData() {
|
||||
return data==null?"":data;
|
||||
}
|
||||
|
||||
public void setData(String data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "YhDeviceData{" +
|
||||
"dataType=" + dataType +
|
||||
", data=" + data +
|
||||
", dataEnd=" + dataEnd +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,135 @@
|
||||
package com.jstyle.blesdk2301.constant;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2020/4/9.
|
||||
*/
|
||||
|
||||
public class BleConst {
|
||||
public static final String GetDeviceTime="0";
|
||||
public static final String SetDeviceTime="1";
|
||||
public static final String GetPersonalInfo="2";
|
||||
public static final String SetPersonalInfo="3";
|
||||
public static final String GetDeviceInfo="4";
|
||||
public static final String SetDeviceInfo="5";//设置手环基本参数
|
||||
public static final String CMD_Set_Mac="6";
|
||||
public static final String GetStepGoal="7";
|
||||
public static final String SetStepGoal="8";
|
||||
public static final String GetDeviceBatteryLevel="9";
|
||||
public static final String GetDeviceMacAddress="10";
|
||||
public static final String GetDeviceVersion="11";
|
||||
public static final String CMD_Reset="12";
|
||||
public static final String CMD_MCUReset="13";
|
||||
public static final String SetMotorVibrationWithTimes ="14";
|
||||
public static final String GetDeviceName="15";
|
||||
public static final String GetAutomatic="16";
|
||||
public static final String SetAutomatic="17";
|
||||
public static final String GetAlarmClock="18";
|
||||
public static final String SetAlarmClockWithAllClock="19";
|
||||
public static final String Notify="20";
|
||||
public static final String GetSedentaryReminder="21";
|
||||
public static final String SetSedentaryReminder="22";
|
||||
public static final String RealTimeStep="23";
|
||||
public static final String GetTotalActivityData="24";
|
||||
public static final String GetDetailActivityData="25";
|
||||
public static final String GetDetailSleepData="26";
|
||||
public static final String GetDynamicHR="27";
|
||||
public static final String GetStaticHR="28";
|
||||
public static final String GetActivityModeData="29";
|
||||
public static final String EnterActivityMode="30";
|
||||
public static final String DeviceSendDataToAPP="31";
|
||||
public static final String BackHomeView="35";
|
||||
public static final String GetTempHistoryData="36";
|
||||
public static final String ECGDATA="37";
|
||||
public static final String EcgppGstatus="38";
|
||||
public static final String EcgppG="39";
|
||||
public static final String GPSControlCommand="40";
|
||||
public static final String Gps="41";//手环发送给app
|
||||
public static final String GetHRVData="42";
|
||||
public static final String CMD_Set_TemperatureCorrection="43";
|
||||
public static final String Weather="44";
|
||||
public static final String Braceletdial="45";
|
||||
public static final String Braceletdialok="46";
|
||||
public static final String SportMode="47";
|
||||
public static final String GetSportMode="48";
|
||||
public static final String CMD_Set_WorkOutReminder="49";
|
||||
public static final String CMD_Get_WorkOutReminder="50";
|
||||
public static final String ReadSerialNumber="51";
|
||||
public static final String ECG="53";
|
||||
public static final String Clear_Bracelet_data="54";
|
||||
public static final String Blood_oxygen="55";
|
||||
public static final String SocialdistanceGetting="56";
|
||||
public static final String SocialdistanceSetting="57";
|
||||
public static final String Sos="58";
|
||||
public static final String Temperature_history="59";
|
||||
public static final String SetDialinterface="60";
|
||||
public static final String HeartBeatpacket="61";
|
||||
public static final String GetAxillaryTemperatureDataWithMode="62";
|
||||
public static final String GetMAC="63";
|
||||
public static final String Getppg="64";
|
||||
public static final String CloseECGPPG="65";
|
||||
public static final String GetEcgPpgStatus="66";
|
||||
public static final String ECGdata="67";
|
||||
public static final String GetAutomaticSpo2Monitoring="68";
|
||||
public static final String SetSpo2="69";
|
||||
public static final String GEtSpo2="70";
|
||||
public static final String DeleteECGdata="71";
|
||||
public static final String DeleteHrv="72";
|
||||
public static final String MeasurementHrvCallback="73";
|
||||
public static final String MeasurementHeartCallback="74";
|
||||
public static final String MeasurementOxygenCallback="75";
|
||||
public static final String StopMeasurementHrvCallback="76";
|
||||
public static final String StopMeasurementHeartCallback="77";
|
||||
public static final String StopMeasurementOxygenCallback="78";
|
||||
public static final String ExitQRcode="79";
|
||||
public static final String EnterQRcode="80";
|
||||
public static final String QRcodebandBack="81";
|
||||
public static final String SportData="82";
|
||||
public static final String Delete_Obtain_The_data_of_manual_blood_oxygen_test="83";
|
||||
public static final String Delete_Blood_oxygen="84";
|
||||
public static final String Delete_GetTotalActivityData="85";
|
||||
public static final String Delete_AlarmClock="87";
|
||||
public static final String Delete_ActivityModeData="88";
|
||||
public static final String Delete_GetStaticHR="89";
|
||||
public static final String Delete_GetDynamicHR="90";
|
||||
public static final String deleteGetTemperature_historyDataWithMode="91";
|
||||
public static final String deleteGetAxillaryTemperatureDataWithMode="92";
|
||||
public static final String deleteGetDetailActivityDataWithMode="93";
|
||||
public static final String Delete_GetDetailSleepData="94";
|
||||
public static final String Enter_photo_mode="95";
|
||||
public static final String openRRInterval="96";
|
||||
public static final String closeRRInterval="97";
|
||||
public static final String realtimeRRIntervalData="98";
|
||||
public static final String realtimePPGData="99";
|
||||
public static final String realtimePPIData="100";
|
||||
|
||||
public static final String ppgWithMode="101";
|
||||
public static final String ppgStartSucessed="102";
|
||||
public static final String ppgStartFailed="103";
|
||||
public static final String ppgStop="104";
|
||||
public static final String ppgQuit="105";
|
||||
public static final String ppgMeasurementProgress="106";
|
||||
public static final String ppgResult="107";
|
||||
public static final String SetBloodpressure_calibration="108";
|
||||
public static final String GetBloodpressure_calibration="109";
|
||||
public static final String SetWomenHealth="110";
|
||||
public static final String GetWomenHealth="111";
|
||||
|
||||
public static final String SetPregnancyCycle="112";
|
||||
public static final String GetPregnancyCycle="113";
|
||||
public static final String Getpeisu="114";
|
||||
public static final String GetpeisuER="115";
|
||||
public static final String CMD_Set_Name="116";
|
||||
public static final String CMD_Get_Name="117";
|
||||
public static final String Blood_glucose_status="118";
|
||||
public static final String Blood_glucose_data="119";
|
||||
public static final String FindActivityMode="120";
|
||||
|
||||
|
||||
|
||||
public static final String FindMobilePhoneMode="FindMobilePhoneMode";
|
||||
public static final String RejectTelMode ="RejectTelMode";
|
||||
public static final String TelMode ="TelMode";
|
||||
public static final String ECGResult="ECGResult";
|
||||
public static final String ENTERECG="ENTERECG";
|
||||
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.jstyle.blesdk2301.constant;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/1/17.
|
||||
*/
|
||||
|
||||
public class DeviceConst {
|
||||
public static final byte CMD_SET_TIME = (byte)0x01;
|
||||
public static final byte CMD_GET_TIME = (byte)0x41;
|
||||
public static final byte CMD_Set_UseInfo = (byte)0x02;
|
||||
public static final byte CMD_GET_USERINFO = (byte) 0x42;
|
||||
public static final byte CMD_Set_DeviceID = (byte)0x05;
|
||||
public static final byte CMD_Enable_Activity = (byte)0x09;//
|
||||
public static final byte CMD_Get_BatteryLevel = (byte)0x13;//
|
||||
public static final byte CMD_Get_Address = (byte)0x22;
|
||||
public static final byte CMD_Get_Version = (byte)0x27;
|
||||
public static final byte CMD_Reset = (byte)0x12;
|
||||
public static final byte CMD_Mcu_Reset = (byte)0x2e;
|
||||
public static final byte CMD_Set_Auto = (byte)0x2a;
|
||||
public static final byte CMD_Get_Auto = (byte)0x2b;
|
||||
public static final byte CMD_Get_TotalData = (byte)0x51;//
|
||||
public static final byte CMD_Get_DetailData = (byte)0x52;
|
||||
public static final byte CMD_Get_SleepData = (byte)0x53;
|
||||
public static final byte CMD_Get_HeartData = (byte)0x54;
|
||||
public static final byte CMD_Get_OnceHeartData = (byte)0x55;
|
||||
public static final byte CMD_Get_HrvTestData = (byte)0x56;//
|
||||
public static final byte ReadTempHisrory= (byte)0x62;
|
||||
public static final byte MeasurementWithType= (byte)0x28;
|
||||
public static final byte Oxygen_data= (byte)0x66;
|
||||
|
||||
public static final byte CMD_Start_EXERCISE = (byte)0x19;
|
||||
public static final byte CMD_heart_package= (byte)0x17;
|
||||
public static final byte CMD_HeartPackageFromDevice = (byte)0x18;//
|
||||
public static final byte CMD_Set_Name = (byte)0x3d;
|
||||
public static final byte CMD_Get_Name = (byte)0x3e;
|
||||
|
||||
public static final byte CMD_Get_SPORTData = (byte)0x5C;
|
||||
|
||||
public static final byte CMD_Get_Bloodsugar = (byte)0x78;
|
||||
public static final byte Bloodsugar_data=(byte)0x3a;//血糖数据
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
package com.jstyle.blesdk2301.model;
|
||||
|
||||
public enum AutoMode {
|
||||
AutoHeartRate, AutoSpo2,AutoTemp,AutoHrv
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
package com.jstyle.blesdk2301.model;
|
||||
|
||||
public enum AutoTestMode {
|
||||
AutoHeartRate, AutoSpo2,
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
package com.jstyle.blesdk2301.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/1/16.
|
||||
*/
|
||||
|
||||
public class Clock extends SendData implements Serializable {
|
||||
|
||||
int number;
|
||||
int type;
|
||||
int hour;
|
||||
int minute;
|
||||
byte week;
|
||||
String content;
|
||||
boolean enable;
|
||||
|
||||
public boolean isEnable() {
|
||||
return enable;
|
||||
}
|
||||
|
||||
public void setEnable(boolean enable) {
|
||||
this.enable = enable;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public int getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(int number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getHour() {
|
||||
return hour;
|
||||
}
|
||||
|
||||
public void setHour(int hour) {
|
||||
this.hour = hour;
|
||||
}
|
||||
|
||||
public int getMinute() {
|
||||
return minute;
|
||||
}
|
||||
|
||||
public void setMinute(int minute) {
|
||||
this.minute = minute;
|
||||
}
|
||||
|
||||
public int getWeek() {
|
||||
return week;
|
||||
}
|
||||
|
||||
public void setWeek(byte week) {
|
||||
this.week = week;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Clock{" +
|
||||
"number=" + number +
|
||||
", type=" + type +
|
||||
", hour=" + hour +
|
||||
", minute=" + minute +
|
||||
", week=" + week +
|
||||
", content='" + content + '\'' +
|
||||
", enable=" + enable +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
package com.jstyle.blesdk2301.model;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
|
||||
|
||||
public class Device implements Serializable{
|
||||
String name;//设备名字
|
||||
String mac;//设备的mac
|
||||
int productID;//产品id,预留
|
||||
BluetoothDevice getBluetoothDevice;//蓝牙
|
||||
boolean isconted=false;//蓝牙是否连接
|
||||
boolean IsPaired=false;//是否是配对设备
|
||||
boolean isdfu=false;//是否直接升级
|
||||
int riss=100;
|
||||
|
||||
public int getRiss() {
|
||||
return riss;
|
||||
}
|
||||
|
||||
public void setRiss(int riss) {
|
||||
this.riss = riss;
|
||||
}
|
||||
|
||||
ScheduledThreadPoolExecutor time=null;//每一个设备轮询器
|
||||
|
||||
public boolean isIsdfu() {
|
||||
return isdfu;
|
||||
}
|
||||
|
||||
public void setIsdfu(boolean isdfu) {
|
||||
this.isdfu = isdfu;
|
||||
}
|
||||
|
||||
public ScheduledThreadPoolExecutor getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(ScheduledThreadPoolExecutor time) {
|
||||
this.time = time;
|
||||
}
|
||||
public boolean isPaired() {
|
||||
return IsPaired;
|
||||
}
|
||||
|
||||
public void setPaired(boolean paired) {
|
||||
IsPaired = paired;
|
||||
}
|
||||
|
||||
public boolean isIsconted() {
|
||||
return isconted;
|
||||
}
|
||||
|
||||
public void setIsconted(boolean isconted) {
|
||||
this.isconted = isconted;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name==null?"":this.name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getMac() {
|
||||
return mac==null?"":this.mac;
|
||||
}
|
||||
|
||||
public void setMac(String mac) {
|
||||
this.mac = mac;
|
||||
}
|
||||
|
||||
public int getProductID() {
|
||||
return productID;
|
||||
}
|
||||
|
||||
public void setProductID(int productID) {
|
||||
this.productID = productID;
|
||||
}
|
||||
|
||||
public BluetoothDevice getBluetoothDevice() {
|
||||
return getBluetoothDevice;
|
||||
}
|
||||
|
||||
public void setBluetoothDevice(BluetoothDevice bluetoothDevice) {
|
||||
this.getBluetoothDevice = bluetoothDevice;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Device{" +
|
||||
"name='" + name + '\'' +
|
||||
", mac='" + mac + '\'' +
|
||||
", productID=" + productID +
|
||||
", getBluetoothDevice=" + getBluetoothDevice +
|
||||
", isconted=" + isconted +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package com.jstyle.blesdk2301.model;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/4/28.
|
||||
*/
|
||||
|
||||
public class DeviceBean {
|
||||
List<Map<String,String>>dataList;
|
||||
boolean finish;
|
||||
|
||||
public List<Map<String, String>> getDataList() {
|
||||
return dataList;
|
||||
}
|
||||
|
||||
public void setDataList(List<Map<String, String>> dataList) {
|
||||
this.dataList = dataList;
|
||||
}
|
||||
|
||||
public boolean isFinish() {
|
||||
return finish;
|
||||
}
|
||||
|
||||
public void setFinish(boolean finish) {
|
||||
this.finish = finish;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.jstyle.blesdk2301.model;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/4/9.
|
||||
*/
|
||||
|
||||
public class DeviceName extends SendData{
|
||||
String name;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.jstyle.blesdk2301.model;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/8/2.
|
||||
*/
|
||||
|
||||
public class ExerciseMode extends SendData {
|
||||
public static final int Status_START=1;
|
||||
public static final int Status_PAUSE=2;
|
||||
public static final int Status_CONTUINE=3;
|
||||
public static final int Status_FINISH=4;
|
||||
|
||||
public static final int Mode_RUN=0;
|
||||
public static final int Mode_CYCLING=1;
|
||||
public static final int Mode_BADMINTON=2;
|
||||
public static final int Mode_FOOTBALL=3;
|
||||
public static final int Mode_TENNIS=4;
|
||||
public static final int Mode_YOGA=5;
|
||||
public static final int Mode_BREATH=6;
|
||||
public static final int Mode_DANCE=7;
|
||||
public static final int Mode_BASKETBALL=8;
|
||||
public static final int Mode_Walk=9;
|
||||
public static final int Mode_workout=10;
|
||||
public static final int Mode_Cricket=11;
|
||||
public static final int Mode_Hiking=12;
|
||||
public static final int Mode_Aerobics=13;
|
||||
public static final int Mode_PingPong=14;
|
||||
public static final int Mode_RopeJump=15;
|
||||
public static final int Mode_Situps=16;
|
||||
public static final int Volleyball=17;
|
||||
|
||||
|
||||
public static int[]modes=new int[]{Mode_RUN,Mode_CYCLING,Mode_BADMINTON,Mode_FOOTBALL,
|
||||
Mode_TENNIS,Mode_YOGA,Mode_BREATH,Mode_DANCE,Mode_BASKETBALL,Mode_Walk,Mode_workout
|
||||
,Mode_Cricket,Mode_Hiking,Mode_Aerobics,Mode_PingPong, Mode_RopeJump,Mode_Situps,Volleyball};
|
||||
int exerciseMode;
|
||||
int enableStatus;
|
||||
public int getExerciseMode(int position){
|
||||
return modes[position];
|
||||
}
|
||||
public int getExerciseMode() {
|
||||
return exerciseMode;
|
||||
}
|
||||
|
||||
public void setExerciseMode(int exerciseMode) {
|
||||
this.exerciseMode = exerciseMode;
|
||||
}
|
||||
|
||||
public int getEnableStatus() {
|
||||
return enableStatus;
|
||||
}
|
||||
|
||||
public void setEnableStatus(int enableStatus) {
|
||||
this.enableStatus = enableStatus;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Nordic Semiconductor
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package com.jstyle.blesdk2301.model;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
|
||||
|
||||
public class ExtendedBluetoothDevice {
|
||||
/* package */public static final int NO_RSSI = -1000;
|
||||
public final BluetoothDevice device;
|
||||
/** The name is not parsed by some Android devices, f.e. Sony Xperia Z1 with Android 4.3 (C6903). It needs to be parsed manually. */
|
||||
public String name;
|
||||
public int rssi;
|
||||
|
||||
|
||||
public ExtendedBluetoothDevice(BluetoothDevice device, String name, int rssi) {
|
||||
this.device = device;
|
||||
this.name = name;
|
||||
this.rssi=rssi;
|
||||
}
|
||||
|
||||
public ExtendedBluetoothDevice(final BluetoothDevice device) {
|
||||
this.device = device;
|
||||
this.name = device.getName();
|
||||
this.rssi = NO_RSSI;
|
||||
}
|
||||
|
||||
public boolean matches(final BluetoothDevice mdevice) {
|
||||
return device.getAddress().equals(mdevice.getAddress());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package com.jstyle.blesdk2301.model;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/1/16.
|
||||
*/
|
||||
|
||||
public class MyAutomaticHRMonitoring extends SendData{
|
||||
int open;//1 开启整个时间段都测量 2时间段内间隔测量 0关闭
|
||||
// 1. Enable measurement throughout the entire time period 2. Measure intervals within the time period 0. Close
|
||||
int startHour;//开始小时 Starting hours
|
||||
int startMinute;//开始分钟 Start minute
|
||||
int endHour;//结束小时 End Hour
|
||||
int endMinute;//结束分钟 End minute
|
||||
int week;//星期一到星期日 开启选择 Monday to Sunday open selection
|
||||
int time;//多少时间测试一次,单位是分钟。 How many times does it take to test, in minutes.
|
||||
|
||||
public int getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(int time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public int getOpen() {
|
||||
return open;
|
||||
}
|
||||
|
||||
public void setOpen(int open) {
|
||||
this.open = open;
|
||||
}
|
||||
|
||||
public int getStartHour() {
|
||||
return startHour;
|
||||
}
|
||||
|
||||
public void setStartHour(int startHour) {
|
||||
this.startHour = startHour;
|
||||
}
|
||||
|
||||
public int getStartMinute() {
|
||||
return startMinute;
|
||||
}
|
||||
|
||||
public void setStartMinute(int startMinute) {
|
||||
this.startMinute = startMinute;
|
||||
}
|
||||
|
||||
public int getEndHour() {
|
||||
return endHour;
|
||||
}
|
||||
|
||||
public void setEndHour(int endHour) {
|
||||
this.endHour = endHour;
|
||||
}
|
||||
|
||||
public int getEndMinute() {
|
||||
return endMinute;
|
||||
}
|
||||
|
||||
public void setEndMinute(int endMinute) {
|
||||
this.endMinute = endMinute;
|
||||
}
|
||||
|
||||
public int getWeek() {
|
||||
return week;
|
||||
}
|
||||
|
||||
public void setWeek(int week) {
|
||||
this.week = week;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MyAutomaticHRMonitoring{" +
|
||||
"open=" + open +
|
||||
", startHour=" + startHour +
|
||||
", startMinute=" + startMinute +
|
||||
", endHour=" + endHour +
|
||||
", endMinute=" + endMinute +
|
||||
", week=" + week +
|
||||
", time=" + time +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,86 @@
|
||||
package com.jstyle.blesdk2301.model;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/1/16.
|
||||
*/
|
||||
|
||||
public class MyDeviceTime extends SendData{
|
||||
int year;
|
||||
int month;
|
||||
int day;
|
||||
int hour;
|
||||
int minute;
|
||||
int second;
|
||||
|
||||
public MyDeviceTime() {
|
||||
Calendar calendar=Calendar.getInstance();
|
||||
this.year=calendar.get(Calendar.YEAR);
|
||||
this.month=calendar.get(Calendar.MONTH)+1;
|
||||
this.day=calendar.get(Calendar.DAY_OF_MONTH);
|
||||
this.hour=calendar.get(Calendar.HOUR_OF_DAY);
|
||||
this.minute=calendar.get(Calendar.MINUTE);
|
||||
this.second=calendar.get(Calendar.SECOND);
|
||||
}
|
||||
|
||||
public int getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
public void setYear(int year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
public int getMonth() {
|
||||
return month;
|
||||
}
|
||||
|
||||
public void setMonth(int month) {
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
public int getDay() {
|
||||
return day;
|
||||
}
|
||||
|
||||
public void setDay(int day) {
|
||||
this.day = day;
|
||||
}
|
||||
|
||||
public int getHour() {
|
||||
return hour;
|
||||
}
|
||||
|
||||
public void setHour(int hour) {
|
||||
this.hour = hour;
|
||||
}
|
||||
|
||||
public int getMinute() {
|
||||
return minute;
|
||||
}
|
||||
|
||||
public void setMinute(int minute) {
|
||||
this.minute = minute;
|
||||
}
|
||||
|
||||
public int getSecond() {
|
||||
return second;
|
||||
}
|
||||
|
||||
public void setSecond(int second) {
|
||||
this.second = second;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MyDeviceTime{" +
|
||||
"year=" + year +
|
||||
", month=" + month +
|
||||
", day=" + day +
|
||||
", hour=" + hour +
|
||||
", minute=" + minute +
|
||||
", second=" + second +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package com.jstyle.blesdk2301.model;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/1/16.
|
||||
*/
|
||||
|
||||
public class MyPersonalInfo extends SendData{
|
||||
int sex;//1 male,0female
|
||||
int age;
|
||||
int height;
|
||||
int weight;
|
||||
int stepLength=70;
|
||||
|
||||
|
||||
|
||||
public int getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(int sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public int getAge() {
|
||||
return age;
|
||||
}
|
||||
|
||||
public void setAge(int age) {
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(int height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public int getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(int weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public int getStepLength() {
|
||||
return stepLength;
|
||||
}
|
||||
|
||||
public void setStepLength(int stepLength) {
|
||||
this.stepLength = stepLength;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MyPersonalInfo{" +
|
||||
"sex=" + sex +
|
||||
", age=" + age +
|
||||
", height=" + height +
|
||||
", weight=" + weight +
|
||||
", stepLength=" + stepLength +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package com.jstyle.blesdk2301.model;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/1/16.
|
||||
*/
|
||||
|
||||
public class MySedentaryReminder extends SendData{
|
||||
int startHour;
|
||||
int startMinute;
|
||||
int endHour;
|
||||
int endMinute;
|
||||
int week;
|
||||
int intervalTime;
|
||||
int leastStep;
|
||||
boolean enable;
|
||||
|
||||
public boolean isEnable() {
|
||||
return enable;
|
||||
}
|
||||
|
||||
public void setEnable(boolean enable) {
|
||||
this.enable = enable;
|
||||
}
|
||||
|
||||
public int getStartHour() {
|
||||
return startHour;
|
||||
}
|
||||
|
||||
public void setStartHour(int startHour) {
|
||||
this.startHour = startHour;
|
||||
}
|
||||
|
||||
public int getStartMinute() {
|
||||
return startMinute;
|
||||
}
|
||||
|
||||
public void setStartMinute(int startMinute) {
|
||||
this.startMinute = startMinute;
|
||||
}
|
||||
|
||||
public int getEndHour() {
|
||||
return endHour;
|
||||
}
|
||||
|
||||
public void setEndHour(int endHour) {
|
||||
this.endHour = endHour;
|
||||
}
|
||||
|
||||
public int getEndMinute() {
|
||||
return endMinute;
|
||||
}
|
||||
|
||||
public void setEndMinute(int endMinute) {
|
||||
this.endMinute = endMinute;
|
||||
}
|
||||
|
||||
public int getWeek() {
|
||||
return week;
|
||||
}
|
||||
|
||||
public void setWeek(int week) {
|
||||
this.week = week;
|
||||
}
|
||||
|
||||
public int getIntervalTime() {
|
||||
return intervalTime;
|
||||
}
|
||||
|
||||
public void setIntervalTime(int intervalTime) {
|
||||
this.intervalTime = intervalTime;
|
||||
}
|
||||
|
||||
public int getLeastStep() {
|
||||
return leastStep;
|
||||
}
|
||||
|
||||
public void setLeastStep(int leastStep) {
|
||||
this.leastStep = leastStep;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MySedentaryReminder{" +
|
||||
"startHour=" + startHour +
|
||||
", startMinute=" + startMinute +
|
||||
", endHour=" + endHour +
|
||||
", endMinute=" + endMinute +
|
||||
", week=" + week +
|
||||
", intervalTime=" + intervalTime +
|
||||
", leastStep=" + leastStep +
|
||||
", enable=" + enable +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package com.jstyle.blesdk2301.model;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/1/16.
|
||||
*/
|
||||
|
||||
public class Notifier extends SendData{
|
||||
public static final int Data_Tel=0;
|
||||
public static final int Data_Sms=1;
|
||||
public static final int Data_WeChat=2;
|
||||
public static final int Data_Facebook=3;
|
||||
public static final int Data_Instagram=4;
|
||||
public static final int Data_Skype=5;
|
||||
public static final int Data_Telegram=6;
|
||||
public static final int Data_Twitter=7;
|
||||
public static final int Data_Vkclient=8;
|
||||
public static final int Data_WhatApp=9;
|
||||
public static final int Data_QQ=10;
|
||||
public static final int Data_IN=11;
|
||||
public static final int Data_Stop_Tel=0xff;
|
||||
|
||||
int type;
|
||||
String info="";
|
||||
String title="";
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
public void setInfo(String info) {
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Notifier{" +
|
||||
"type=" + type +
|
||||
", info='" + info + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package com.jstyle.blesdk2301.model;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/4/8.
|
||||
*/
|
||||
|
||||
public class SendData {
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
package com.jstyle.blesdk2301.model;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/1/16.
|
||||
*/
|
||||
|
||||
public class SportPeriod extends SendData {
|
||||
int startHour;
|
||||
int startMinute;
|
||||
int endHour;
|
||||
int endMinute;
|
||||
int week;
|
||||
int days;
|
||||
int intervalTime;
|
||||
int leastStep;
|
||||
boolean enable;
|
||||
|
||||
public boolean isEnable() {
|
||||
return enable;
|
||||
}
|
||||
|
||||
public void setEnable(boolean enable) {
|
||||
this.enable = enable;
|
||||
}
|
||||
|
||||
public int getStartHour() {
|
||||
return startHour;
|
||||
}
|
||||
|
||||
public void setStartHour(int startHour) {
|
||||
this.startHour = startHour;
|
||||
}
|
||||
|
||||
public int getStartMinute() {
|
||||
return startMinute;
|
||||
}
|
||||
|
||||
public void setStartMinute(int startMinute) {
|
||||
this.startMinute = startMinute;
|
||||
}
|
||||
|
||||
public int getEndHour() {
|
||||
return endHour;
|
||||
}
|
||||
|
||||
public void setEndHour(int endHour) {
|
||||
this.endHour = endHour;
|
||||
}
|
||||
|
||||
public int getEndMinute() {
|
||||
return endMinute;
|
||||
}
|
||||
|
||||
public void setEndMinute(int endMinute) {
|
||||
this.endMinute = endMinute;
|
||||
}
|
||||
|
||||
public int getWeek() {
|
||||
return week;
|
||||
}
|
||||
|
||||
public void setWeek(int week) {
|
||||
this.week = week;
|
||||
}
|
||||
|
||||
public int getIntervalTime() {
|
||||
return intervalTime;
|
||||
}
|
||||
|
||||
public void setIntervalTime(int intervalTime) {
|
||||
this.intervalTime = intervalTime;
|
||||
}
|
||||
|
||||
public int getLeastStep() {
|
||||
return leastStep;
|
||||
}
|
||||
|
||||
public void setLeastStep(int leastStep) {
|
||||
this.leastStep = leastStep;
|
||||
}
|
||||
|
||||
public int getDays() {
|
||||
return days;
|
||||
}
|
||||
|
||||
public void setDays(int days) {
|
||||
this.days = days;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package com.jstyle.blesdk2301.model;
|
||||
|
||||
public class WeatherData {
|
||||
int tempNow;
|
||||
int tempHigh;
|
||||
int tempLow;
|
||||
String cityName="";
|
||||
int weatherId;
|
||||
|
||||
public int getTempNow() {
|
||||
return tempNow;
|
||||
}
|
||||
|
||||
public void setTempNow(int tempNow) {
|
||||
this.tempNow = tempNow;
|
||||
}
|
||||
|
||||
public int getTempHigh() {
|
||||
return tempHigh;
|
||||
}
|
||||
|
||||
public void setTempHigh(int tempHigh) {
|
||||
this.tempHigh = tempHigh;
|
||||
}
|
||||
|
||||
public int getTempLow() {
|
||||
return tempLow;
|
||||
}
|
||||
|
||||
public void setTempLow(int tempLow) {
|
||||
this.tempLow = tempLow;
|
||||
}
|
||||
|
||||
public String getCityName() {
|
||||
return cityName;
|
||||
}
|
||||
|
||||
public void setCityName(String cityName) {
|
||||
this.cityName = cityName;
|
||||
}
|
||||
|
||||
public int getWeatherId() {
|
||||
return weatherId;
|
||||
}
|
||||
|
||||
public void setWeatherId(int weatherId) {
|
||||
this.weatherId = weatherId;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,17 @@
|
||||
package com.jstyle.blesdk2301;
|
||||
|
||||
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() throws Exception {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue