@moshenguo/ms-data-sdk 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/MsDataSdk.types.d.ts +0 -1
- package/build/MsDataSdkModule.d.ts +0 -1
- package/build/MsDataSdkModule.web.d.ts +0 -1
- package/build/index.d.ts +0 -1
- package/build/sdk/bleConst.d.ts +0 -1
- package/build/sdk/bleSDK.d.ts +0 -1
- package/build/sdk/constants.d.ts +0 -1
- package/build/sdk/models.d.ts +0 -1
- package/build/sdk/resolveUtil.d.ts +0 -1
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.map +1 -0
- package/docs/classes/BleSDK.html +52 -52
- package/docs/classes/ResolveUtil.html +10 -10
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +2 -2
- package/docs/interfaces/MyAlarmClockV4.html +2 -2
- package/docs/interfaces/MyAutomaticHRMonitoring.html +10 -10
- package/docs/interfaces/MyDeviceInfo.html +2 -2
- package/docs/interfaces/MyPersonalInfo.html +2 -2
- package/docs/interfaces/MySedentaryReminderV4.html +10 -10
- package/docs/interfaces/MyWeeksV4.html +2 -2
- package/docs/modules.html +1 -1
- package/docs/variables/BleConst.html +1 -1
- package/docs/variables/DeviceKey.html +1 -1
- package/package.json +24 -17
- package/build/MsDataSdk.types.d.ts.map +0 -1
- package/build/MsDataSdk.types.js +0 -2
- package/build/MsDataSdk.types.js.map +0 -1
- package/build/MsDataSdkModule.d.ts.map +0 -1
- package/build/MsDataSdkModule.js +0 -4
- package/build/MsDataSdkModule.js.map +0 -1
- package/build/MsDataSdkModule.web.d.ts.map +0 -1
- package/build/MsDataSdkModule.web.js +0 -12
- package/build/MsDataSdkModule.web.js.map +0 -1
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -6
- package/build/index.js.map +0 -1
- package/build/sdk/bleConst.d.ts.map +0 -1
- package/build/sdk/bleConst.js +0 -287
- package/build/sdk/bleConst.js.map +0 -1
- package/build/sdk/bleSDK.d.ts.map +0 -1
- package/build/sdk/bleSDK.js +0 -1106
- package/build/sdk/bleSDK.js.map +0 -1
- package/build/sdk/constants.d.ts.map +0 -1
- package/build/sdk/constants.js +0 -20
- package/build/sdk/constants.js.map +0 -1
- package/build/sdk/models.d.ts.map +0 -1
- package/build/sdk/models.js +0 -2
- package/build/sdk/models.js.map +0 -1
- package/build/sdk/resolveUtil.d.ts.map +0 -1
- package/build/sdk/resolveUtil.js +0 -1448
- package/build/sdk/resolveUtil.js.map +0 -1
package/build/index.d.ts
CHANGED
package/build/sdk/bleConst.d.ts
CHANGED
package/build/sdk/bleSDK.d.ts
CHANGED
package/build/sdk/constants.d.ts
CHANGED
package/build/sdk/models.d.ts
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var t=1,e=65,a=2,n=66,r=3,i=4,c=5,o=9,s=11,u=75,h=19,l=34,g=39,d=18,S=46,D=54,y=61,f=62,v=42,p=43,m=35,I=77,B=81,T=82,_=83,V=84,E=96,M=102,x=85,C=87,b=92,A=86,G=100,H=25,k=24,P=71,R=56,w=6,L=7,W=32,O=22,F=16,K=131,N=170,U=171,Q=21,j=36,Y=20,q=68,z=40,J=23,X=52,Z=90,$=97,tt=254,et=98,at=101,nt=176,rt=156,it=113,ct=120,ot=28,st=30,ut=99,ht=136,lt=137,gt=138,dt=120,St=58,Dt=37,yt=38,ft={GetDeviceTime:"get_device_time",GetPersonalInfo:"get_personal_info",GetDeviceInfo:"get_device_info",RealTimeStep:"real_time_step",GetStepGoal:"get_step_goal",GetDeviceBatteryLevel:"get_device_battery_level",GetDeviceMacAddress:"get_device_mac_address",GetDeviceVersion:"get_device_version",CMD_Reset:"cmd_reset",CMD_MCUReset:"cmd_mcu_reset",Notify:"notify",GetDeviceName:"get_device_name",SetAlarmClockWithAllClock:"set_alarm_clock_with_all_clock",Gps:"GPS",GetPPIData:"GetPPIData",GetHrvTimeValue:"GetHrvTimeValue",CloseDevices:"CloseDevices",GetOffCheckStatus:"GetOffCheckStatus",GetAutomaticHRMonitoring:"GetAutomaticHRMonitoring",GetSedentaryReminder:"GetSedentaryReminder",GetTotalActivityData:"GetTotalActivityData",GetDetailActivityData:"GetDetailActivityData",GetDetailSleepData:"GetDetailSleepData",AutoBloodOxygen:"AutoBloodOxygen",GetDynamicHR:"GetDynamicHR",ECGdata:"ECGdata",GetWomenHealth:"GetWomenHealth",CMD_Set_TemperatureCorrection:"CMD_Set_TemperatureCorrection",GetStaticHR:"GetStaticHR",Blood_oxygen:"Blood_oxygen",GetHRVData:"GetHRVData",GetAxillaryTemperatureDataWithMode:"GetAxillaryTemperatureDataWithMode",EnterQrCode:"EnterQrCode",QrCodeBandBack:"QrCodeBandBack",ExitQrCode:"ExitQrCode",Temperature_history:"Temperature_history",GetActivityModeData:"GetActivityModeData",EnterActivityMode:"EnterActivityMode",SetDeviceTime:"SetDeviceTime",GetAlarmClock:"GetAlarmClock",EcgppGstatus:"EcgppGstatus",GetEcgPpgStatus:"GetEcgPpgStatus",ENTERECG:"ENTERECG",MeasurementHrvCallback:"MeasurementHrvCallback",MeasurementHeartCallback:"MeasurementHeartCallback",MeasurementOxygenCallback:"MeasurementOxygenCallback",MeasurementTempCallback:"MeasurementTempCallback",StopMeasurementHrvCallback:"StopMeasurementHrvCallback",StopMeasurementHeartCallback:"StopMeasurementHeartCallback",StopMeasurementOxygenCallback:"StopMeasurementOxygenCallback",StopMeasurementTempCallback:"StopMeasurementTempCallback",Braceletdial:"Braceletdial",Braceletdialok:"Braceletdialok",GetSportMode:"GetSportMode",GPSControlCommand:"GPSControlCommand",SocialdistanceGetting:"SocialdistanceGetting",EcgppG:"EcgppG",DeviceSendDataToAPP:"DeviceSendDataToAPP",SetNewDeviceInfo:"SetNewDeviceInfo",GetNewDeviceInfo:"GetNewDeviceInfo",BoolsugarStatus:"BoolsugarStatus",BoolsugarValue:"BoolsugarValue",GetPregnancyCycle:"GetPregnancyCycle",SetStepGoal:"SetStepGoal",SetPersonalInfo:"SetPersonalInfo",SetMotorVibrationWithTimes:"SetMotorVibrationWithTimes",SetDeviceInfo:"SetDeviceInfo",SetAutomaticHRMonitoring:"SetAutomaticHRMonitoring",SetSedentaryReminder:"SetSedentaryReminder",EnterPhotoMode:"EnterPhotoMode",BackHomeView:"BackHomeView",Weather:"Weather",SportMode:"SportMode",Clear_Bracelet_data:"Clear_Bracelet_data",SocialdistanceSetting:"SocialdistanceSetting",Sos:"Sos",SetPregnancyCycle:"SetPregnancyCycle",DeleteECGdata:"DeleteECGdata",ECG:"ECG",SetWomenHealth:"SetWomenHealth",ppgStartSucessed:"ppgStartSucessed",ppgResult:"ppgResult",ppgStop:"ppgStop",ppgMeasurementProgress:"ppgMeasurementProgress",ppgQuit:"ppgQuit",ppgStartFailed:"ppgStartFailed",CMD_Set_Mac:"CMD_Set_Mac",CloseECG:"CloseECG",GetAlarmClock_V4:"GetAlarmClock_V4",DeleteAllAlarmClock_V4:"DeleteAllAlarmClock_V4",SetAlarmClock_V4:"SetAlarmClock_V4",GetSedentaryReminder_V4:"GetSedentaryReminder_V4",SetSedentaryReminder_V4:"SetSedentaryReminder_V4"},vt={DeviceTime:"device_time",GPSTime:"gps_time",DataType:"data_type",End:"end",Data:"data",Gender:"gender",Age:"age",Height:"height",Weight:"weight",Stride:"stride",KUserDeviceId:"k_user_device_id",KClockLast:"k_clock_last",Step:"step",Calories:"calories",Distance:"distance",ExerciseMinutes:"exercise_minutes",HeartRate:"heart_rate",ActiveMinutes:"active_minutes",TempData:"temp_data",Blood_oxygen:"blood_oxygen",StepGoal:"step_goal",DistanceGoal:"distance_goal",CalorieGoal:"calorie_goal",SleepTimeGoal:"sleep_time_goal",BatteryLevel:"battery_level",MacAddress:"mac_address",DeviceVersion:"device_version",DeviceName:"device_name",Date:"date",Latitude:"latitude",Longitude:"longitude",TOTAL_ID:"totalId",PPI_ID:"ppiId",PPI_LIST:"ppiList",PPI_NUM:"ppiNum",HRV_TIME_MODE:"hrvTimeMode",HRV_TIME_Value:"hrvTimeValue",RESULT:"result",GET_OFF_TAG:"getOffTag",GET_OFF_STATE:"getOffState",DistanceUnit:"distance_unit",TimeUnit:"time_unit",StatusOfTheRaisedHandOnscreen:"status_of_the_raised_hand_onscreen",TempUnit:"temp_unit",NightMode:"night_mode",KBaseHeart:"k_base_heart",ScreenBrightness:"screen_brightness",Dialinterface:"dial_interface",SocialDistancedwitch:"social_distance_switch",ChineseOrEnglish:"chinese_or_english",WorkMode:"work_mode",StartTime:"start_time",KHeartStartMinter:"kheart_start_minter",EndTime:"end_time",KHeartEndMinter:"kheart_end_minter",Weeks:"weeks",IntervalTime:"interval_time",StartTimeHour:"StartTimeHour",StartTimeMin:"StartTimeMin",EndTimeHour:"EndTimeHour",EndTimeMin:"EndTimeMin",LeastSteps:"LeastSteps",Week:"week",Goal:"Goal",KDetailMinterStep:"KDetailMinterStep",ArraySteps:"ArraySteps",ArraySleep:"ArraySleep",sleepUnitLength:"sleepUnitLength",StaticHR:"StaticHR",WomenHealthPeriod:"WomenHealthPeriod",WomenHealthLength:"WomenHealthLength",TemperatureCorrectionValue:"TemperatureCorrectionValue",HRV:"HRV",ECGMoodValue:"ECGMoodValue",ECGValue:"ECGValue",ArrayDynamicHR:"ArrayDynamicHR",KAlarmId:"KAlarmId",OpenOrClose:"OpenOrClose",ClockType:"ClockType",ClockTime:"ClockTime",KAlarmMinter:"KAlarmMinter",KAlarmContent:"KAlarmContent",KAlarmLength:"KAlarmLength",axillaryTemperature:"axillaryTemperature",Band:"Band",temperature:"temperature",ActivityMode:"ActivityMode",Pace:"Pace",KPhoneDataLength:"KPhoneDataLength",VascularAging:"VascularAging",Stress:"Stress",highBP:"highBP",lowBP:"lowBP",EcgStatus:"ecgStatus",PPGValue:"ppgValue",ECGHrvValue:"ecgHrvValue",ECGAvBlockValue:"ecgAvBlockValue",ECGHrValue:"ecgHrValue",ECGStreesValue:"ecgStressValue",ECGhighBpValue:"ecgHighBpValue",ECGLowBpValue:"ecgLowBpValue",ECGBreathValue:"ecgBreathValue",KActivityLocationTime:"activityLocationTime",KActivityLocationLatitude:"activityLocationLatitude",KActivityLocationLongitude:"activityLocationLongitude",KActivityLocationCount:"activityLocationCount",DayOfWeek:"dayOfWeek",Text:"text",TextLength:"textLength",IsDeleteData:"isDeleteData"},pt=function(){function t(){}return t.crcValue=function(t){for(var e=0,a=0;a<t.length-1;a++)e+=t[a];t[t.length-1]=255&e},t.hexByte2Int=function(t,e){return(255&t)*Math.pow(256,e)},t.bcd2String=function(t){var e=15&t;return"".concat((240&t)>>4).concat(e)},t.intList2String=function(t){return t.map(function(t){return t.toString(16).padStart(2,"0").toUpperCase()}).join(" ")},t.intList3String=function(t){return t.map(function(t){return t.toString(16).padStart(2,"0").toLowerCase()}).join(" ")},t.setMacSuccessful=function(){var t;return(t={})[vt.DataType]=ft.CMD_Set_Mac,t[vt.End]=!0,t[vt.Data]={},t},t.intBitToDouble=function(t){var e=new ArrayBuffer(8),a=new DataView(e);return a.setInt32(0,t,!1),a.getFloat32(0,!1)},t.getDeviceTime=function(t){var e,a,n="20".concat(this.bcd2String(t[1]),"-").concat(this.bcd2String(t[2]),"-").concat(this.bcd2String(t[3])," ").concat(this.bcd2String(t[4]),":").concat(this.bcd2String(t[5]),":").concat(this.bcd2String(t[6])),r="".concat(this.bcd2String(t[9]),".").concat(this.bcd2String(t[10]),".").concat(this.bcd2String(t[11]));return(e={})[vt.DataType]=ft.GetDeviceTime,e[vt.End]=!0,e[vt.Data]=((a={})[vt.DeviceTime]=n,a[vt.GPSTime]=r,a),e},t.int2Ascll=function(t){if(t<0||t>255)throw new Error("Value must be between 0 and 255");return String.fromCharCode(t)},t.getGpsTime=function(t){return"".concat(this.bcd2String(t[9]),".").concat(this.bcd2String(t[10]),".").concat(this.bcd2String(t[11]))},t.getUserInfo=function(t){for(var e,a,n=new Array(6).fill(0),r=0;r<5;r++)n[r]=this.hexByte2Int(t[r+1],0);var i="";for(r=6;r<12;r++)0!==t[r]&&(i+=String.fromCharCode(this.hexByte2Int(t[r],0)));return(e={})[vt.DataType]=ft.GetPersonalInfo,e[vt.End]=!0,e[vt.Data]=((a={})[vt.Gender]=n[0],a[vt.Age]=n[1],a[vt.Height]=n[2],a[vt.Weight]=n[3],a[vt.Stride]=n[4],a[vt.KUserDeviceId]=i,a),e},t.getDeviceInfo=function(t){var e,a;return(e={})[vt.DataType]=ft.GetDeviceInfo,e[vt.End]=!0,e[vt.Data]=((a={})[vt.DistanceUnit]=this.hexByte2Int(t[1],0).toString(),a[vt.TimeUnit]=this.hexByte2Int(t[2],0).toString(),a[vt.StatusOfTheRaisedHandOnscreen]=this.hexByte2Int(t[3],0).toString(),a[vt.TempUnit]=this.hexByte2Int(t[4],0).toString(),a[vt.NightMode]=this.hexByte2Int(t[5],0).toString(),a[vt.KBaseHeart]=this.hexByte2Int(t[9],0).toString(),a[vt.ScreenBrightness]=this.hexByte2Int(t[11],0).toString(),a[vt.Dialinterface]=this.hexByte2Int(t[12],0).toString(),a[vt.SocialDistancedwitch]=this.hexByte2Int(t[13],0).toString(),a[vt.ChineseOrEnglish]=this.hexByte2Int(t[14],0).toString(),a),e},t.getActivityData=function(t){for(var e,a,n=0,r=0,i=0,c=0,o=0,s=1;s<5;s++)n+=this.hexByte2Int(t[s],s-1);for(s=5;s<9;s++)r+=this.hexByte2Int(t[s],s-5);for(s=9;s<13;s++)i+=this.hexByte2Int(t[s],s-9);for(s=13;s<17;s++)c+=this.hexByte2Int(t[s],s-13);for(s=17;s<21;s++)o+=this.hexByte2Int(t[s],s-17);var u=this.hexByte2Int(t[21],0),h=0,l=0;return t.length>22&&(h=this.hexByte2Int(t[22],0)+this.hexByte2Int(t[23],1),t.length>24&&(l=this.hexByte2Int(t[24],0))),(e={})[vt.DataType]=ft.RealTimeStep,e[vt.End]=!0,e[vt.Data]=((a={})[vt.Step]=n.toString(),a[vt.Calories]=(r/100).toFixed(1),a[vt.Distance]=(i/100).toFixed(1),a[vt.ExerciseMinutes]=(c/60).toString(),a[vt.HeartRate]=u.toString(),a[vt.ActiveMinutes]=o.toString(),a[vt.TempData]=h.toFixed(1),a[vt.Blood_oxygen]=l.toString(),a),e},t.getGoal=function(t){for(var e,a,n=0,r=0,i=0,c=0,o=0;o<4;o++)n+=this.hexByte2Int(t[o+1],o);for(o=0;o<=1;o++)r+=this.hexByte2Int(t[o+7],o);for(o=0;o<=1;o++)i+=this.hexByte2Int(t[o+9],o);for(o=0;o<=1;o++)c+=this.hexByte2Int(t[o+11],o);return(e={})[vt.DataType]=ft.GetStepGoal,e[vt.End]=!0,e[vt.Data]=((a={})[vt.StepGoal]=n.toString(),a[vt.DistanceGoal]=r.toString(),a[vt.CalorieGoal]=i.toString(),a[vt.SleepTimeGoal]=c.toString(),a),e},t.getDeviceBattery=function(t){var e,a,n=this.hexByte2Int(t[1],0);return(e={})[vt.DataType]=ft.GetDeviceBatteryLevel,e[vt.End]=!0,e[vt.Data]=((a={})[vt.BatteryLevel]=n.toString(),a),e},t.getDeviceAddress=function(t){var e,a;if(0===t.length)return{};for(var n=[],r=1;r<7;r++){var i=t[r].toString(16).padStart(2,"0");n.push(i)}var c=n.join(":");return(e={})[vt.DataType]=ft.GetDeviceMacAddress,e[vt.End]=!0,e[vt.Data]=((a={})[vt.MacAddress]=c,a),e},t.getDeviceVersion=function(t){var e,a;if(0===t.length)return{};for(var n=[],r=1;r<5;r++)n.push(t[r].toString(16));var i=n.join(".");return(e={})[vt.DataType]=ft.GetDeviceVersion,e[vt.End]=!0,e[vt.Data]=((a={})[vt.DeviceVersion]=i,a),e},t.Reset=function(){var t;return(t={})[vt.DataType]=ft.CMD_Reset,t[vt.End]=!0,t},t.MCUReset=function(){var t;return(t={})[vt.DataType]=ft.CMD_MCUReset,t[vt.End]=!0,t},t.Notify=function(){var t;return(t={})[vt.DataType]=ft.Notify,t[vt.End]=!0,t},t.getDeviceName=function(t){for(var e,a,n="",r=1;r<15;r++){var i=this.hexByte2Int(t[r],0);0===i||i>127||(n+=String.fromCharCode(i))}return(e={})[vt.DataType]=ft.GetDeviceName,e[vt.End]=!0,e[vt.Data]=((a={})[vt.DeviceName]=n,a),e},t.getAutoHeart=function(t){var e,a,n=this.hexByte2Int(t[7],0)+this.hexByte2Int(t[8],1);return(e={})[vt.DataType]=ft.GetAutomaticHRMonitoring,e[vt.End]=!0,e[vt.Data]=((a={})[vt.WorkMode]=this.hexByte2Int(t[1],0).toString(),a[vt.StartTime]=this.bcd2String(t[2]),a[vt.KHeartStartMinter]=this.bcd2String(t[3]),a[vt.EndTime]=this.bcd2String(t[4]),a[vt.KHeartEndMinter]=this.bcd2String(t[5]),a[vt.Weeks]=this.getByteString(t[6]),a[vt.IntervalTime]=n.toString(),a),e},t.getWeekInt=function(t){for(var e=0,a=0;a<t.length;a++)1===t[a]&&(e+=Math.pow(2,a));return e},t.getByteString=function(t){for(var e=new Array(8).fill(0),a=[],n=0;n<=6;n++)e[n]=1&t,t>>=1,a.push(e[n].toString());return a.join("-")},t.getByteArray=function(t){for(var e=new Array(8).fill(0),a="",n=0;n<=7;n++)e[n]=1&t,t>>=1,a+=e[n];return a},t._hexByte2Int=function(t,e){return t<<8*e},t._bcd2String=function(t){var e=15&t;return"".concat(t>>4&15).concat(e)},t.getActivityAlarm=function(t){var e,a,n=((e={})[vt.StartTimeHour]=this._bcd2String(t[1]),e[vt.StartTimeMin]=this._bcd2String(t[2]),e[vt.EndTimeHour]=this._bcd2String(t[3]),e[vt.EndTimeMin]=this._bcd2String(t[4]),e[vt.Week]=this.getByteString(t[5]),e[vt.IntervalTime]=this._hexByte2Int(t[6],0).toString(),e[vt.LeastSteps]=this._hexByte2Int(t[7],0).toString(),e[vt.OpenOrClose]=this._hexByte2Int(t[8],0).toString(),e);return(a={})[vt.DataType]=ft.GetSedentaryReminder,a[vt.End]=!0,a[vt.Data]=n,a},t.getTotalStepData=function(t){var e,a;console.log("total:",t);var n=((e={})[vt.DataType]=ft.GetTotalActivityData,e[vt.End]=!1,e[vt.Data]=[],e),r=27,i=t.length,c=Math.floor(i/r);if(0===c)return n[vt.End]=!0,n;for(var o=0;o<c;o++){var s=1+(o+1)*r;s<i&&255===t[s]&&(n[vt.End]=!0);for(var u="20".concat(this._bcd2String(t[2+o*r]),".").concat(this._bcd2String(t[3+o*r]),".").concat(this._bcd2String(t[4+o*r])),h=0,l=0;l<4;l++)h+=this._hexByte2Int(t[5+l+o*r],l);var g=0;for(l=0;l<4;l++)g+=this._hexByte2Int(t[9+l+o*r],l);var d=0;for(l=0;l<4;l++)d+=this._hexByte2Int(t[13+l+o*r],l);var S=0;for(l=0;l<4;l++)S+=this._hexByte2Int(t[17+l+o*r],l);var D=this._hexByte2Int(t[21+o*r],0)+this._hexByte2Int(t[22+o*r],1),y=0;for(l=0;l<4;l++)y+=this._hexByte2Int(t[23+l+o*r],l);n[vt.Data].push(((a={})[vt.Date]=u,a[vt.Step]=h.toString(),a[vt.ExerciseMinutes]=g.toString(),a[vt.Calories]=(S/100).toFixed(1),a[vt.Distance]=(d/100).toFixed(1),a[vt.Goal]=D.toString(),a[vt.ActiveMinutes]=y,a))}return n},t.getDetailData=function(t){var e,a,n=((e={})[vt.DataType]=ft.GetDetailActivityData,e[vt.End]=!1,e[vt.Data]=[],e),r=t.length,i=Math.floor(r/25);if(0===i)return n[vt.End]=!0,n;for(var c=0;c<i;c++){255===t[r-1]&&(n[vt.End]=!0);for(var o="20".concat(this._bcd2String(t[3+25*c]),".").concat(this._bcd2String(t[4+25*c]),".").concat(this._bcd2String(t[5+25*c])," ").concat(this._bcd2String(t[6+25*c]),":").concat(this._bcd2String(t[7+25*c]),":").concat(this._bcd2String(t[8+25*c])),s=0,u=0;u<2;u++)s+=this._hexByte2Int(t[9+u+25*c],u);var h=0;for(u=0;u<2;u++)h+=this._hexByte2Int(t[11+u+25*c],u);var l=0;for(u=0;u<2;u++)l+=this._hexByte2Int(t[13+u+25*c],u);var g=[];for(u=0;u<10;u++)g.push(this._hexByte2Int(t[15+u+25*c],0).toString());n[vt.Data].push(((a={})[vt.Date]=o,a[vt.KDetailMinterStep]=s.toString(),a[vt.Calories]=(h/100).toFixed(2),a[vt.Distance]=(l/100).toFixed(2),a[vt.ArraySteps]=g.join(" "),a))}return n},t.getSleepData=function(t){var e,a,n,r=t.length,i=((e={})[vt.DataType]=ft.GetDetailSleepData,e[vt.End]=!1,e[vt.Data]=[],e),c=255===t[t.length-1]&&t[t.length-2]===_;if(c&&(i[vt.End]=!0),130===r||c&&132===r){for(var o="20".concat(this._bcd2String(t[3]),"-").concat(this._bcd2String(t[4]),"-").concat(this._bcd2String(t[5])," ").concat(this._bcd2String(t[6]),":").concat(this._bcd2String(t[7]),":").concat(this._bcd2String(t[8])),s=this._hexByte2Int(t[9],0),u=[],h=0;h<s;h++)u.push(this._hexByte2Int(t[10+h],0).toString());i[vt.Data].push(((a={})[vt.Date]=o,a[vt.ArraySleep]=u.join(" "),a[vt.sleepUnitLength]="1",a))}else{var l=Math.floor(r/34);if(0===l)return i[vt.End]=!0,i;for(var g=0;g<l;g++){for(o="20".concat(this._bcd2String(t[3+34*g]),"-").concat(this._bcd2String(t[4+34*g]),"-").concat(this._bcd2String(t[5+34*g])," ").concat(this._bcd2String(t[6+34*g]),":").concat(this._bcd2String(t[7+34*g]),":").concat(this._bcd2String(t[8+34*g])),s=this._hexByte2Int(t[9+34*g],0),u=[],h=0;h<s;h++)u.push(this._hexByte2Int(t[10+h+34*g],0).toString());i[vt.Data].push(((n={})[vt.Date]=o,n[vt.ArraySleep]=u.join(" "),n[vt.sleepUnitLength]="5",n))}}return i},t.getAutoBloodOxygen=function(t){var e,a,n=((e={})[vt.DataType]=ft.AutoBloodOxygen,e[vt.End]=!1,e[vt.Data]=[],e),r=10,i=t.length,c=Math.floor(i/r);if(0===c)return n[vt.End]=!0,n;for(var o=0;o<c;o++){255===t[i-1]&&(n[vt.End]=!0);var s="20".concat(this._bcd2String(t[3+o*r]),".").concat(this._bcd2String(t[4+o*r]),".").concat(this._bcd2String(t[5+o*r])," ").concat(this._bcd2String(t[6+o*r]),":").concat(this._bcd2String(t[7+o*r]),":").concat(this._bcd2String(t[8+o*r])),u=this._hexByte2Int(t[9+10*o],0).toString();n[vt.Data].push(((a={})[vt.Date]=s,a[vt.Blood_oxygen]=u,a))}return n},t.getBloodoxygen=function(t){var e,a,n=((e={})[vt.DataType]=ft.Blood_oxygen,e[vt.End]=!1,e[vt.Data]=[],e),r=10,i=t.length,c=Math.floor(i/r);if(0===c)return n[vt.End]=!0,n;for(var o=0;o<c;o++){255===t[i-1]&&(n[vt.End]=!0);var s="20".concat(this._bcd2String(t[3+o*r]),".").concat(this._bcd2String(t[4+o*r]),".").concat(this._bcd2String(t[5+o*r])," ").concat(this._bcd2String(t[6+o*r]),":").concat(this._bcd2String(t[7+o*r]),":").concat(this._bcd2String(t[8+o*r])),u=this._hexByte2Int(t[9+10*o],0).toString();n[vt.Data].push(((a={})[vt.Date]=s,a[vt.Blood_oxygen]=u,a))}return n},t.getHeartData=function(t){var e,a,n=((e={})[vt.DataType]=ft.GetDynamicHR,e[vt.End]=!1,e[vt.Data]=[],e),r=24,i=t.length,c=Math.floor(i/r);if(0===c)return n[vt.End]=!0,n;for(var o=0;o<c;o++){255===t[i-1]&&(n[vt.End]=!0);for(var s="20".concat(this._bcd2String(t[3+o*r]),".").concat(this._bcd2String(t[4+o*r]),".").concat(this._bcd2String(t[5+o*r])," ").concat(this._bcd2String(t[6+o*r]),":").concat(this._bcd2String(t[7+o*r]),":").concat(this._bcd2String(t[8+o*r])),u=[],h=0;h<15;h++)u.push(this._hexByte2Int(t[9+h+o*r],0).toString());n[vt.Data].push(((a={})[vt.Date]=s,a[vt.ArrayDynamicHR]=u.join(" "),a))}return n},t.getOnceHeartData=function(t){var e,a,n=((e={})[vt.DataType]=ft.GetStaticHR,e[vt.End]=!1,e[vt.Data]=[],e),r=t.length,i=Math.floor(r/10);if(0===i||1===i&&153===t[1])return n[vt.End]=!0,n;for(var c=0;c<i;c++){255===t[r-1]&&(n[vt.End]=!0);var o="20".concat(this._bcd2String(t[3+10*c]),".").concat(this._bcd2String(t[4+10*c]),".").concat(this._bcd2String(t[5+10*c])," ").concat(this._bcd2String(t[6+10*c]),":").concat(this._bcd2String(t[7+10*c]),":").concat(this._bcd2String(t[8+10*c])),s=this._hexByte2Int(t[9+10*c],0).toString();n[vt.Data].push(((a={})[vt.Date]=o,a[vt.StaticHR]=s,a))}return n},t.getHrvTestData=function(t){var e,a,n=((e={})[vt.DataType]=ft.GetHRVData,e[vt.End]=!1,e[vt.Data]=[],e),r=15,i=t.length,c=Math.floor(i/r);if(0===c)return n[vt.End]=!0,n;255===t[t.length-1]&&(n[vt.End]=!0);for(var o=0;o<c;o++){var s="20".concat(this.bcd2String(t[3+o*r]),".").concat(this.bcd2String(t[4+o*r]),".").concat(this.bcd2String(t[5+o*r])," ").concat(this.bcd2String(t[6+o*r]),":").concat(this.bcd2String(t[7+o*r]),":").concat(this.bcd2String(t[8+o*r])),u=this.hexByte2Int(t[9+o*r],0).toString(),h=this.hexByte2Int(t[10+o*r],0).toString(),l=this.hexByte2Int(t[11+o*r],0).toString(),g=this.hexByte2Int(t[12+o*r],0).toString(),d=this.hexByte2Int(t[13+o*r],0).toString(),S=this.hexByte2Int(t[14+o*r],0).toString();n[vt.Data].push(((a={})[vt.Date]=s,a[vt.HRV]=u,a[vt.VascularAging]=h,a[vt.HeartRate]=l,a[vt.Stress]=g,a[vt.highBP]=d,a[vt.lowBP]=S,a))}return n},t.getClockData=function(t){var e,a;console.log("getClockData:",t);var n=((e={})[vt.DataType]=ft.GetAlarmClock,e[vt.End]=!1,e[vt.Data]=[],e),r=41,i=t.length,c=!1,o=Math.floor(i/r);if(0===o)return n[vt.End]=!0,n;153==t[1]&&16==i&&(c=!0),n[vt.IsDeleteData]=c;for(var s=0;s<o;s++){var u=1+(s+1)*r;u<i&&255===t[u]&&(n[vt.End]=!0);for(var h=this.hexByte2Int(t[4+s*r],0).toString(),l=this.hexByte2Int(t[5+s*r],0).toString(),g=this.hexByte2Int(t[6+s*r],0).toString(),d=this.bcd2String(t[7+s*r]),S=this.bcd2String(t[8+s*r]),D=this.hexByte2Int(t[9+s*r],0),y=this.hexByte2Int(t[10+s*r],0),f="",v=0;v<y;v++){var p=t[11+v+s*r];0!==p&&(f+=this.int2Ascll(this.hexByte2Int(p,0)))}n[vt.Data].push(((a={})[vt.KAlarmId]=h,a[vt.OpenOrClose]=l,a[vt.ClockType]=g,a[vt.ClockTime]=d,a[vt.KAlarmMinter]=S,a[vt.Week]=D,a[vt.KAlarmContent]=f,a[vt.KAlarmLength]=y.toString(),a))}return n},t.getTempDataer=function(t){var e,a,n=((e={})[vt.DataType]=ft.GetAxillaryTemperatureDataWithMode,e[vt.End]=!1,e[vt.Data]=[],e),r=11,i=t.length,c=Math.floor(i/r);if(0===c||255===t[i-1])return n[vt.End]=!0,n;for(var o=0;o<c;o++){255===t[i-1]&&(n[vt.End]=!0);var s="20".concat(this.bcd2String(t[3+o*r]),".").concat(this.bcd2String(t[4+o*r]),".").concat(this.bcd2String(t[5+o*r])," ").concat(this.bcd2String(t[6+o*r]),":").concat(this.bcd2String(t[7+o*r]),":").concat(this.bcd2String(t[8+o*r])),u=this.hexByte2Int(t[9+o*r],0)+this.hexByte2Int(t[10+o*r],1);n[vt.Data].push(((a={})[vt.Date]=s,a[vt.axillaryTemperature]=(.1*u).toFixed(1),a))}return n},t.getQrCode=function(t,e){var a,n,r,i;return e?((a={})[vt.DataType]=ft.EnterQrCode,a[vt.End]=!0,a[vt.Data]={},a):128===t[1]||129===t[1]?((n={})[vt.DataType]=ft.QrCodeBandBack,n[vt.End]=!0,n[vt.Data]=((r={})[vt.Band]=129===t[1]?"1":"0",r),n):((i={})[vt.DataType]=ft.ExitQrCode,i[vt.End]=!0,i[vt.Data]={},i)},t.getTempData=function(t){var e,a,n=((e={})[vt.DataType]=ft.Temperature_history,e[vt.End]=!1,e[vt.Data]=[],e),r=11,i=t.length,c=Math.floor(i/r);if(0===c||255===t[i-1]||1===c&&153===t[1])return n[vt.End]=!0,n;for(var o=0;o<c;o++){255===t[i-1]&&(n[vt.End]=!0);var s="20".concat(this.bcd2String(t[3+o*r]),".").concat(this.bcd2String(t[4+o*r]),".").concat(this.bcd2String(t[5+o*r])," ").concat(this.bcd2String(t[6+o*r]),":").concat(this.bcd2String(t[7+o*r]),":").concat(this.bcd2String(t[8+o*r])),u=this.hexByte2Int(t[9+o*r],0)+this.hexByte2Int(t[10+o*r],1);n[vt.Data].push(((a={})[vt.Date]=s,a[vt.temperature]=(.1*u).toFixed(1),a))}return n},t.getExerciseData=function(t){var e,a,n=((e={})[vt.DataType]=ft.GetActivityModeData,e[vt.End]=!1,e[vt.Data]=[],e),r=25,i=t.length,c=Math.floor(i/r);if(0===c)return n[vt.End]=!0,n;for(var o=0;o<c;o++){var s=1+(o+1)*r;s<i&&o===c-1&&255===t[s]&&(n[vt.End]=!0);for(var u="20".concat(this.bcd2String(t[3+o*r]),".").concat(this.bcd2String(t[4+o*r]),".").concat(this.bcd2String(t[5+o*r])," ").concat(this.bcd2String(t[6+o*r]),":").concat(this.bcd2String(t[7+o*r]),":").concat(this.bcd2String(t[8+o*r])),h=this.hexByte2Int(t[9+o*r],0).toString(),l=this.hexByte2Int(t[10+o*r],0).toString(),g=this.getData(2,11+o*r,t),d=this.getData(2,13+o*r,t),S=this.hexByte2Int(t[15+o*r],0),D=this.hexByte2Int(t[16+o*r],0),y=new Array(4).fill(0),f=0;f<4;f++)y[3-f]=t[17+f+o*r];var v=new Array(4).fill(0);for(f=0;f<4;f++)v[3-f]=t[21+f+o*r];var p=this.getFloat(y,0),m=this.getFloat(v,0);n[vt.Data].push(((a={})[vt.Date]=u,a[vt.ActivityMode]=h,a[vt.HeartRate]=l,a[vt.ActiveMinutes]=g.toString(),a[vt.Step]=d.toString(),a[vt.Pace]="".concat(S.toString(16),"'").concat(D.toString(16)),a[vt.Distance]=m.toFixed(2),a[vt.Calories]=p.toFixed(1),a))}return n},t.getActivityExerciseData=function(t){for(var e,a,n=0,r=0,i=new Array(4).fill(0),c=0;c<4;c++)n+=this.hexByte2Int(t[c+2],c),i[3-c]=t[c+6],r+=this.hexByte2Int(t[c+10],c);var o=this.hexByte2Int(t[1],0),s=this.getFloat(i,0);return(e={})[vt.DataType]=ft.EnterActivityMode,e[vt.End]=!0,e[vt.Data]=((a={})[vt.HeartRate]=o.toString(),a[vt.Step]=n.toString(),a[vt.Calories]=s.toFixed(1),a[vt.ActiveMinutes]=r.toString(),a),e},t.setTimeSuccessful=function(t){var e,a;return(e={})[vt.DataType]=ft.SetDeviceTime,e[vt.End]=!0,e[vt.Data]=((a={})[vt.KPhoneDataLength]=this.hexByte2Int(t[1],0).toString(),a),e},t.getData=function(t,e,a){for(var n=0,r=0;r<t;r++)n+=this.hexByte2Int(a[r+e],r);return n},t.getFloat=function(t,e){return this.intBitToDouble(this.getInt(t,e))},t.getInt=function(t,e){return(255&t[e])<<24|(255&t[e+1])<<16|(255&t[e+2])<<8|255&t[e+3]},t.setMethodSuccessful=function(t){var e;return(e={})[vt.DataType]=t,e[vt.End]=!0,e[vt.Data]={},e},t.getEcgHistoryData=function(t){var e,a=((e={})[vt.DataType]=ft.ECGdata,e[vt.End]=!1,e[vt.Data]={},e),n=t.length;if(3===n||113===t[n-3]&&255===t[n-2]&&255===t[n-1])return a[vt.End]=!0,a;var r=3;if(0===this.hexByte2Int(t[1],0)+this.hexByte2Int(t[2],1)){var i="20".concat(this.bcd2String(t[3]),"-").concat(this.bcd2String(t[4]),"-").concat(this.bcd2String(t[5])," ").concat(this.bcd2String(t[6]),":").concat(this.bcd2String(t[7]),":").concat(this.bcd2String(t[8])),c=this.hexByte2Int(t[11],0).toString(),o=this.hexByte2Int(t[12],0).toString(),s=this.hexByte2Int(t[13],0).toString();a[vt.Data][vt.Date]=i,a[vt.Data][vt.HRV]=c,a[vt.Data][vt.HeartRate]=o,a[vt.Data][vt.ECGMoodValue]=s,r=27}var u=t.slice(r,n),h=this.getEcgDataString(u);return a[vt.Data][vt.ECGValue]=h,a},t.getEcgDataString=function(t){for(var e=[],a=Math.floor(t.length/2)-1,n=0;n<a;n++){var r=this.hexByte2Int(t[2*n+1],1)+this.hexByte2Int(t[2*n+2],0);r>=32768&&(r-=65536),e.push(r.toString())}return e.join(",")},t.ecgData=function(t){var e,a,n=this.hexByte2Int(t[1],0);return(e={})[vt.DataType]=ft.EcgppGstatus,e[vt.End]=!0,e[vt.Data]=((a={})[vt.EcgStatus]=n.toString(),a),e},t.ppgData=function(t){var e,a;return(e={})[vt.DataType]=ft.EcgppGstatus,e[vt.End]=!0,e[vt.Data]=((a={})[vt.PPGValue]=t,a),e},t.ecgResult=function(t){var e,a,n=((e={})[vt.DataType]=ft.GetEcgPpgStatus,e[vt.End]=!0,e[vt.Data]={},e);if(3===this.hexByte2Int(t[1],0)){var r="20".concat(this.bcd2String(t[10]),".").concat(this.bcd2String(t[11]),".").concat(this.bcd2String(t[12])," ").concat(this.bcd2String(t[13]),":").concat(this.bcd2String(t[14]),":").concat(this.bcd2String(t[15]));n[vt.Data]=((a={})[vt.Date]=r,a[vt.ECGHrvValue]=this.hexByte2Int(t[2],0).toString(),a[vt.ECGAvBlockValue]=this.hexByte2Int(t[3],0).toString(),a[vt.ECGHrValue]=this.hexByte2Int(t[4],0).toString(),a[vt.ECGStreesValue]=this.hexByte2Int(t[5],0).toString(),a[vt.ECGhighBpValue]=this.hexByte2Int(t[6],0).toString(),a[vt.ECGLowBpValue]=this.hexByte2Int(t[7],0).toString(),a[vt.ECGMoodValue]=this.hexByte2Int(t[8],0).toString(),a[vt.ECGBreathValue]=this.hexByte2Int(t[9],0).toString(),a)}return n},t.enterEcg=function(t){var e;return(e={})[vt.DataType]=ft.ENTERECG,e[vt.End]=!0,e[vt.Data]={},e},t.measurementWithType=function(t,e){var a,n,r,i,c,o,s,u;if(t)switch(e[1]){case 1:return(a={})[vt.DataType]=ft.MeasurementHrvCallback,a[vt.End]=!0,a[vt.Data]=((n={})[vt.HRV]=this.hexByte2Int(e[4],0),n),a;case 2:return(r={})[vt.DataType]=ft.MeasurementHeartCallback,r[vt.End]=!0,r[vt.Data]=((i={})[vt.HeartRate]=this.hexByte2Int(e[2],0),i),r;case 3:return(c={})[vt.DataType]=ft.MeasurementOxygenCallback,c[vt.End]=!0,c[vt.Data]=((o={})[vt.Blood_oxygen]=this.hexByte2Int(e[3],0),o),c;case 4:var h=this.hexByte2Int(e[8],0)+this.hexByte2Int(e[9],1);return(s={})[vt.DataType]=ft.MeasurementTempCallback,s[vt.End]=!0,s[vt.Data]=((u={})[vt.temperature]=(.1*h).toFixed(1),u),s}else{var l={1:ft.StopMeasurementHrvCallback,2:ft.StopMeasurementHeartCallback,3:ft.StopMeasurementOxygenCallback,4:ft.StopMeasurementTempCallback};if(l[e[1]])return this.setMethodSuccessful(l[e[1]])}return{}},t.braceletdial=function(t,e){var a,n;return t?((a={})[vt.DataType]=ft.Braceletdial,a[vt.End]=!0,a):((n={})[vt.DataType]=ft.Braceletdialok,n[vt.End]=!0,n[vt.Data]={index:e[1].toString()},n)},t.getSportMode=function(t){for(var e,a=this.hexByte2Int(t[1],0),n=[],r=0;r<a;r++)n.push(this.hexByte2Int(t[r+2],0).toString());return(e={})[vt.DataType]=ft.GetSportMode,e[vt.End]=!0,e[vt.Data]=n.join(","),e},t.gPSControlCommand=function(t){for(var e,a,n="20".concat(this.bcd2String(t[1]),"-").concat(this.bcd2String(t[2]),"-").concat(this.bcd2String(t[3])," ").concat(this.bcd2String(t[4]),":").concat(this.bcd2String(t[5]),":").concat(this.bcd2String(t[6])),r=new Array(4).fill(0),i=new Array(4).fill(0),c=0;c<4;c++)r[3-c]=t[9+c],i[3-c]=t[14+c];var o=this.getFloat(r,0).toString(),s=this.getFloat(i,0).toString(),u=this.hexByte2Int(t[18],0);return(e={})[vt.DataType]=ft.GPSControlCommand,e[vt.End]=!0,e[vt.Data]=((a={})[vt.KActivityLocationTime]=n,a[vt.KActivityLocationLatitude]=o,a[vt.KActivityLocationLongitude]=s,a[vt.KActivityLocationCount]=u.toString(),a),e},t.setSocial=function(t){var e;return(e={})[vt.DataType]=ft.SocialdistanceGetting,e[vt.End]=!0,e[vt.Data]={scanInterval:this.hexByte2Int(t[2],0).toString(),scanTime:this.hexByte2Int(t[3],0).toString(),signalStrength:t[4].toString()},e},t.eCGQuality=function(t){var e;return(e={})[vt.DataType]=ft.EcgppG,e[vt.End]=!0,e[vt.Data]={heartValue:this.hexByte2Int(t[1],0).toString(),hrvValue:this.hexByte2Int(t[2],0).toString(),Quality:this.hexByte2Int(t[3],0).toString()},e},t.enterPhotoModeback=function(t){var e,a="";switch(t[1]){case 1:a=0===t[2]?"0":"1";break;case 2:a="2";break;case 3:switch(t[2]){case 1:a="3";break;case 2:a="4";break;case 3:a="5";break;case 4:a="6";break;case 5:a="7"}break;case 4:a="8"}return(e={})[vt.DataType]=ft.DeviceSendDataToAPP,e[vt.End]=!0,e[vt.Data]={type:a},e},t.setNewDeviceInfo=function(t){var e;return(e={})[vt.DataType]=ft.SetNewDeviceInfo,e[vt.End]=!0,e[vt.Data]={},e},t.getNewDeviceInfo=function(t){var e;return(e={})[vt.DataType]=ft.GetNewDeviceInfo,e[vt.End]=!0,e[vt.Data]={KEcg:this.hexByte2Int(t[1],0).toString()},e},t.updateClockSuccessful=function(t){var e,a;return console.log("updateClockSuccessful:",t),(e={})[vt.DataType]=ft.SetAlarmClockWithAllClock,e[vt.End]=!0,e[vt.Data]=((a={})[vt.KClockLast]=this.hexByte2Int(t[t.length-1],0).toString(),a),e},t.setBoolSugarStatus=function(t){var e,a;return(e={})[vt.DataType]=ft.BoolsugarStatus,e[vt.End]=!0,e[vt.Data]=((a={})[vt.EcgStatus]=this.hexByte2Int(t[2],0),a),e},t.setBoolSugarValue=function(t){for(var e,a=t.slice(3),n=[],r=0;r<Math.floor(a.length/3);r++){var i=this.hexByte2Int(a[3*r],2)+this.hexByte2Int(a[3*r+1],1)+this.hexByte2Int(a[3*r+2],0);n.push(i)}return(e={})[vt.DataType]=ft.BoolsugarValue,e[vt.End]=!0,e[vt.Data]={timestamp:Math.floor(Date.now()/1e3),ppg:n},e},t.setMethodError=function(t){var e;return(e={})[vt.DataType]=t,e[vt.End]=!1,e[vt.Data]={},e},t.readPregnancyCycle=function(t){var e,a;return(e={})[vt.DataType]=ft.GetPregnancyCycle,e[vt.End]=!0,e[vt.Data]=((a={})[vt.Date]="20".concat(this.bcd2String(t[3]),"-").concat(this.bcd2String(t[4]),"-").concat(this.bcd2String(t[5])),a[vt.Week]=this.hexByte2Int(t[1],0),a[vt.DayOfWeek]=this.hexByte2Int(t[2],0),a),e},t.readWomenHealth=function(t){var e,a;return(e={})[vt.DataType]=ft.GetWomenHealth,e[vt.End]=!0,e[vt.Data]=((a={})[vt.Date]="".concat(this.bcd2String(t[1]),"-").concat(this.bcd2String(t[2])),a[vt.WomenHealthPeriod]=this.hexByte2Int(t[3],0),a[vt.WomenHealthLength]=this.hexByte2Int(t[4],0),a),e},t.getTemperatureCorrectionValue=function(t){var e,a,n=[t[3],t[2]],r=this.byteArrayToInt(n);return(e={})[vt.DataType]=ft.CMD_Set_TemperatureCorrection,e[vt.End]=!0,e[vt.Data]=((a={})[vt.TemperatureCorrectionValue]=r.toString(),a),e},t.byteArrayToInt=function(t){return t[0]<<8&65280|255&t[1]},t.getHistoryGpsData=function(t){var e,a=[],n=((e={})[vt.DataType]=ft.Gps,e[vt.End]=!1,e),r=59,i=t.length,c=Math.floor(i/r);if(0===c)return n;255===t[t.length-1]&&90===t[t.length-2]&&(n[vt.End]=!0);for(var o=0;o<c;o++){for(var s={},u="20".concat(this.bcd2String(t[3+o*r]),".").concat(this.bcd2String(t[4+o*r]),".").concat(this.bcd2String(t[5+o*r])," ").concat(this.bcd2String(t[6+o*r]),":").concat(this.bcd2String(t[7+o*r]),":").concat(this.bcd2String(t[8+o*r])),h=[],l=[],g=0;g<6;g++){for(var d=new Array(4).fill(0),S=new Array(4).fill(0),D=0;D<4;D++)d[3-D]=t[9+D+o*r+8*g],S[3-D]=t[13+D+o*r+8*g];var y=this.getFloat(d,0).toString(),f=this.getFloat(S,0).toString();h.push(y),l.push(f)}s[vt.Date]=17===u.length?u:"2019.01.01 00:00:00",s[vt.Latitude]=h.join(","),s[vt.Longitude]=l.join(","),a.push(s)}return n[vt.Data]=a,n},t.getPPITestData=function(t){var e,a=((e={})[vt.DataType]=ft.GetPPIData,e[vt.End]=!1,e[vt.Data]=[],e),n=123,r=t.length,i=Math.floor(r/n);if(0===i)return a[vt.End]=!0,a;255===t[t.length-1]&&(a[vt.End]=!0);for(var c=0;c<i;c++){for(var o={},s=new Array(2).fill(0),u=0;u<2;u++)s[1-u]=t[1+u+c*n];for(var h=this.getInt(s,0),l="20".concat(this.bcd2String(t[3+c*n]),".").concat(this.bcd2String(t[4+c*n]),".").concat(this.bcd2String(t[5+c*n])," ").concat(this.bcd2String(t[6+c*n]),":").concat(this.bcd2String(t[7+c*n]),":").concat(this.bcd2String(t[8+c*n])),g=this.hexByte2Int(t[9+c*n],0),d=this.hexByte2Int(t[10+c*n],0).toString(),S=[],D=0;D<56;D++){for(var y=11+2*D,f=new Array(2).fill(0),v=0;v<2;v++)f[1-v]=t[y+v+c*n];var p=this.getFloat(f,0);if(0===p)break;S.push(p)}o[vt.TOTAL_ID]=g.toString(),o[vt.PPI_ID]=d,o[vt.DeviceTime]=l,o[vt.PPI_LIST]=S,o[vt.PPI_NUM]=h,a[vt.Data].push(o)}return a},t.getHrvTimeData=function(t){var e,a;return(e={})[vt.DataType]=ft.GetHrvTimeValue,e[vt.End]=!0,e[vt.Data]=((a={})[vt.HRV_TIME_MODE]=this.hexByte2Int(t[1],0),a[vt.HRV_TIME_Value]=this.hexByte2Int(t[2],0),a),e},t.closeDevices=function(t){var e,a;return(e={})[vt.DataType]=ft.CloseDevices,e[vt.End]=!0,e[vt.Data]=((a={})[vt.RESULT]=!0,a),e},t.getOffCheckStatus=function(t){var e,a;return(e={})[vt.DataType]=ft.GetOffCheckStatus,e[vt.End]=!0,e[vt.Data]=((a={})[vt.GET_OFF_TAG]=this.hexByte2Int(t[1],0),a[vt.GET_OFF_STATE]=this.hexByte2Int(t[2],0),a),e},t}();"function"==typeof SuppressedError&&SuppressedError;var mt=function(){function vt(){}return vt.generateValue=function(t){return new Array(t).fill(0)},vt.hexByte2Int=function(t,e){return(255&t)*Math.pow(256,e)},vt.generateInitValue=function(){return this.generateValue(16)},vt.arrayCopy=function(t,e,a,n,r){for(var i=0;i<r;i++)a[n+i]=t[e+i]},vt.crcValue=function(t){for(var e=0,a=0,n=t;a<n.length;a++){e+=n[a]}t[15]=255&e},vt.crcDynamicValue=function(t){for(var e=0,a=0,n=t;a<n.length;a++){e+=n[a]}t[t.length-1]=255&e},vt.getBcdValue=function(t){return 16*Math.floor(t/10)+t%10},vt.dataParsingWithData=function(P){if(!P||0===P.length)return pt.setMethodError("Empty data");switch(P[0]){case s:return pt.setMethodSuccessful(ft.SetStepGoal);case a:return pt.setMethodSuccessful(ft.SetPersonalInfo);case y:break;case D:return pt.setMethodSuccessful(ft.SetMotorVibrationWithTimes);case r:return pt.setMethodSuccessful(ft.SetDeviceInfo);case v:return pt.setMethodSuccessful(ft.SetAutomaticHRMonitoring);case Dt:return pt.setMethodSuccessful(ft.SetSedentaryReminder);case c:return pt.setMacSuccessful();case H:return pt.setMethodSuccessful(ft.EnterActivityMode);case R:return 0!==P[2]&&0!==P[3]?pt.getTemperatureCorrectionValue(P):pt.setMethodSuccessful(ft.CMD_Set_TemperatureCorrection);case k:return pt.getActivityExerciseData(P);case t:return pt.setTimeSuccessful(P);case b:return pt.getExerciseData(P);case e:return pt.getDeviceTime(P);case n:return pt.getUserInfo(P);case i:return pt.getDeviceInfo(P);case o:return pt.getActivityData(P);case u:return pt.getGoal(P);case h:return pt.getDeviceBattery(P);case l:return pt.getDeviceAddress(P);case g:return pt.getDeviceVersion(P);case f:return pt.getDeviceName(P);case p:return pt.getAutoHeart(P);case d:return pt.Reset();case S:return pt.MCUReset();case I:return pt.Notify();case yt:return pt.getActivityAlarm(P);case B:return pt.getTotalStepData(P);case T:return pt.getDetailData(P);case _:return pt.getSleepData(P);case V:return pt.getHeartData(P);case x:return pt.getOnceHeartData(P);case A:return pt.getHrvTestData(P);case C:return pt.getClockData(P);case m:return pt.updateClockSuccessful(P);case w:return pt.setNewDeviceInfo(P);case L:return pt.getNewDeviceInfo(P);case O:return pt.enterPhotoModeback(P);case W:return pt.setMethodSuccessful(ft.EnterPhotoMode);case F:return pt.setMethodSuccessful(ft.BackHomeView);case K:return pt.eCGQuality(P);case N:case U:break;case Q:return pt.setMethodSuccessful(ft.Weather);case j:return pt.braceletdial(!1,P);case Y:return pt.setMethodSuccessful(ft.SportMode);case q:return pt.getSportMode(P);case z:return pt.measurementWithType(!0,P);case X:return pt.gPSControlCommand(P);case Z:return pt.getHistoryGpsData(P);case $:return pt.setMethodSuccessful(ft.Clear_Bracelet_data);case M:return pt.getAutoBloodOxygen(P);case E:return pt.getBloodoxygen(P);case G:return pt.setMethodSuccessful(ft.SocialdistanceSetting);case tt:return pt.setMethodSuccessful(ft.Sos);case et:return pt.getTempData(P);case at:return pt.getTempDataer(P);case nt:return pt.getQrCode(P,!1);case dt:return pt.setBoolSugarStatus(P);case St:return pt.setBoolSugarValue(P);case rt:return pt.ecgResult(P);case st:return pt.readPregnancyCycle(P);case it:return pt.getEcgHistoryData(P);case ot:return 0===P[1]?pt.setMethodSuccessful(ft.SetWomenHealth):pt.readWomenHealth(P);case ct:switch(this.hexByte2Int(P[2],0)){case 1:return pt.setMethodSuccessful(ft.ppgStartSucessed);case 2:return pt.setMethodSuccessful(ft.ppgResult);case 3:return pt.setMethodSuccessful(ft.ppgStop);case 4:return pt.setMethodSuccessful(ft.ppgMeasurementProgress);case 5:return pt.setMethodSuccessful(ft.ppgQuit);default:return pt.setMethodSuccessful(ft.ppgStartFailed)}case ut:return pt.getPPITestData(P);case ht:return pt.getHrvTimeData(P);case lt:return pt.closeDevices(P);case gt:return pt.getOffCheckStatus(P)}return pt.setMethodError(this.getBcdValue(P[0]).toString())},vt.bloodsugarWithMode=function(t,e){var a=this.generateInitValue();return a[0]=ct,a[1]=t,2!==t&&4!==t||(a[2]=e),this.crcValue(a),a},vt.getDetailSleepDataWithMode=function(t){var e=this.generateInitValue();return e[0]=_,e[1]=99===t?153:t,this.crcValue(e),e},vt.insertDateValue=function(t,e){if(e&&!(e.length<=0)){var a=e.split(" "),n=a[0],r=a[1],i=n.split("-").map(Number),c=i[0],o=i[1],s=i[2],u=r.split(":").map(Number),h=u[0],l=u[1],g=u[2];t[4]=this.getBcdValue(c-2e3),t[5]=this.getBcdValue(o),t[6]=this.getBcdValue(s),t[7]=this.getBcdValue(h),t[8]=this.getBcdValue(l),t[9]=this.getBcdValue(g)}},vt.getHRVDataWithMode=function(t,e){var a=this.generateInitValue();return a[0]=A,a[1]=99===t?153:0===t?0:1===t?1:2,this.insertDateValue(a,e),this.crcValue(a),a},vt.getPPIDDataWithMode=function(t){var e=this.generateInitValue();return e[0]=ut,e[1]=99===t?153:0===t?0:1===t?1:2,this.crcValue(e),e},vt.getHrvTestTime=function(){var t=this.generateInitValue();return t[0]=ht,t[1]=0,this.crcValue(t),t},vt.setHrvTestTime=function(t){var e=this.generateInitValue();return e[0]=ht,e[1]=1,e[2]=t,this.crcValue(e),e},vt.closeBlueDevice=function(){var t=this.generateInitValue();return t[0]=lt,this.crcValue(t),t},vt.startBloodSugar=function(){var t=this.generateInitValue();return t[0]=dt,t[1]=1,this.crcValue(t),t},vt.progressBloodSugar=function(t){var e=this.generateInitValue();return e[0]=dt,e[1]=4,e[2]=t,this.crcValue(e),e},vt.endBloodSugar=function(){var t=this.generateInitValue();return t[0]=dt,t[1]=3,this.crcValue(t),t},vt.getTotalActivityDataWithMode=function(t){var e=this.generateInitValue();return e[0]=B,e[1]=99===t?153:0===t?0:1===t?1:2,this.crcValue(e),e},vt.getTotalActivityDataWithModeForTime=function(t,e){var a=this.generateInitValue();return a[0]=B,a[1]=99===t?153:0===t?0:1===t?1:2,this.insertDateValue(a,e),this.crcValue(a),a},vt.getDetailSleepDataWithModeForTime=function(t,e){var a=this.generateInitValue();return a[0]=_,a[1]=99===t?153:t,this.insertDateValue(a,e),this.crcValue(a),a},vt.getDetailActivityDataWithModeForTime=function(t,e){var a=this.generateInitValue();return a[0]=T,a[1]=99===t?153:t,this.insertDateValue(a,e),this.crcValue(a),a},vt.getTemperature_historyDataWithMode=function(t,e){var a=this.generateInitValue();return a[0]=et,a[1]=99===t?153:t,this.insertDateValue(a,e),this.crcValue(a),a},vt.getAxillaryTemperatureDataWithMode=function(t,e){var a=this.generateInitValue();return a[0]=at,a[1]=99===t?153:0===t?0:1===t?1:2,this.insertDateValue(a,e),this.crcValue(a),a},vt.enterActivityMode=function(t,e){var a=this.generateInitValue();return a[0]=H,a[1]=e,a[2]=t,this.crcValue(a),a},vt.sendHeartPackage=function(t,e,a){var n=this.generateInitValue(),r=255&Math.floor(e/60),i=e%60&255,c=new ArrayBuffer(4);new DataView(c).setFloat32(0,t,!0);var o=Array.from(new Uint8Array(c));return n[0]=J,this.arrayCopy(o,0,n,1,o.length),n[5]=r,n[6]=i,n[7]=255&a,this.crcValue(n),n},vt.realTimeStep=function(t,e){var a=this.generateInitValue();return a[0]=o,a[1]=t?1:0,a[2]=e?1:0,this.crcValue(a),a},vt.stopGo=function(){var t=this.generateInitValue();return t[0]=o,t[1]=0,this.crcValue(t),t},vt.setPersonalInfo=function(t){var e=this.generateInitValue();return e[0]=a,e[1]=t.sex,e[2]=t.age,e[3]=t.height,e[4]=t.weight,t.stepLength&&(e[5]=t.stepLength),this.crcValue(e),e},vt.getPersonalInfo=function(){var t=this.generateInitValue();return t[0]=n,this.crcValue(t),t},vt.enterOTA=function(){var t=this.generateInitValue();return t[0]=P,this.crcValue(t),t},vt.getDeviceVersion=function(){var t=this.generateInitValue();return t[0]=g,this.crcValue(t),t},vt.reset=function(){var t=this.generateInitValue();return t[0]=d,this.crcValue(t),t},vt.getDeviceMacAddress=function(){var t=this.generateInitValue();return t[0]=l,this.crcValue(t),t},vt.getDeviceBatteryLevel=function(){var t=this.generateInitValue();return t[0]=h,this.crcValue(t),t},vt.mcuReset=function(){var t=this.generateInitValue();return t[0]=S,this.crcValue(t),t},vt.setDeviceName=function(t){var e=this.generateInitValue(),a=Math.min(t.length,14);e[0]=y;for(var n=0;n<a;n++)e[n+1]=t.charCodeAt(n);for(n=a+1;n<6;n++)e[n]=0;return this.crcValue(e),e},vt.getDeviceName=function(){var t=this.generateInitValue();t[0]=f;for(var e=1;e<6;e++)t[e]=0;return this.crcValue(t),t},vt.setDeviceTime=function(e){var a=this.generateInitValue(),n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate(),c=e.getHours(),o=e.getMinutes(),s=e.getSeconds();return a[0]=t,a[1]=this.getBcdValue(n),a[2]=this.getBcdValue(r),a[3]=this.getBcdValue(i),a[4]=this.getBcdValue(c),a[5]=this.getBcdValue(o),a[6]=this.getBcdValue(s),this.crcValue(a),a},vt.getDeviceTime=function(){var t=this.generateInitValue();return t[0]=e,this.crcValue(t),t},vt.setDeviceInfo=function(t){var e=this.generateInitValue();return e[0]=r,e[1]=t.DistanceUnit?129:128,e[2]=t.is12Hour?129:128,e[3]=t.Hand_up_light_screen_switch?129:128,e[4]=t.Fahrenheit?128:129,e[5]=t.Nightmode?129:128,e[6]=128,e[9]=128+t.baseheart,e[11]=128+t.screenBrightness,e[12]=128+t.indexDial,e[14]=128+t.languages,this.crcValue(e),e},vt.healthMeasurementWithDataType=function(t,e){this.StartDeviceMeasurementWithType=e;var a=this.generateInitValue();return a[0]=z,a[1]=t,a[2]=e?1:0,this.crcValue(a),a},vt.setBraceletdial=function(t){this.isRuning=!0;var e=this.generateInitValue();return e[0]=j,e[1]=t,this.crcValue(e),e},vt.setAutomaticHRMonitoring=function(t){var e=this.generateInitValue(),a=t.time;return e[0]=v,e[1]=t.open,e[2]=this.getBcdValue(t.startHour),e[3]=this.getBcdValue(t.startMinute),e[4]=this.getBcdValue(t.endHour),e[5]=this.getBcdValue(t.endMinute),e[6]=t.week,e[7]=255&a,e[8]=a>>8&255,e[9]=t.type,this.crcValue(e),e},vt.getAutomaticHRMonitoring=function(t){var e=this.generateInitValue();return e[0]=p,e[1]=t,this.crcValue(e),e},vt.getActivityModeDataWithMode=function(t){var e=this.generateInitValue();return e[0]=b,e[1]=t,this.crcValue(e),e},vt.getStaticHRWithMode=function(t,e){var a=this.generateInitValue();return a[0]=x,a[1]=t,this.insertDateValue(a,e),this.crcValue(a),a},vt.getDynamicHRWithMode=function(t,e){var a=this.generateInitValue();return a[0]=V,a[1]=t,this.insertDateValue(a,e),this.crcValue(a),a},vt.getBloodOxygen=function(t,e){var a=this.generateInitValue();return a[0]=E,a[1]=t,this.insertDateValue(a,e),this.crcValue(a),a},vt.getAutoBloodOxygen=function(t,e){var a=this.generateInitValue();return a[0]=M,a[1]=t,this.insertDateValue(a,e),this.crcValue(a),a},vt.setStepGoal=function(t,e,a,n,r){var i=this.generateInitValue();return i[0]=s,i[4]=t>>24&255,i[3]=t>>16&255,i[2]=t>>8&255,i[1]=255&t,i[6]=e>>8&255,i[5]=255&e,i[8]=a>>8&255,i[7]=255&a,i[10]=n>>8&255,i[9]=255&n,i[12]=r>>8&255,i[11]=255&r,this.crcValue(i),i},vt.GetStepGoal=function(){var t=this.generateInitValue();return t[0]=u,this.crcValue(t),t},vt.getDeviceInfo=function(){var t=this.generateInitValue();return t[0]=i,this.crcValue(t),t},vt.sendHex=function(t,e){var a=function(t,e,a){if(a||2===arguments.length)for(var n,r=0,i=e.length;r<i;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))}([],t,!0);return e&&this.crcDynamicValue(a),a},vt.getAlarmClock=function(){var t=this.generateInitValue();return t[0]=C,this.crcValue(t),t},vt.deleteAllAlarmClock=function(){var t=this.generateInitValue();return t[0]=C,t[1]=153,this.crcValue(t),t},vt.setAlarmClock=function(t){var e=this,a=[],n=39*t.length+2;if(n>128)for(var r=Math.floor(128/39),i=Math.ceil(t.length/r),c=0;c<i;c++){for(var o=c===i-1,s=o?t.length-r*c:r,u=new Array(39*s+(o?2:0)).fill(0),h=0;h<s;h++){var l=t[r*c+h],g=l.openOrClose,d=l.clockType,S=l.clockTime,D=l.week,y=l.textLength,f=l.text,v=39*h;u[v]=35,u[v+1]=t.length,u[v+2]=r*c+h,u[v+3]=g,u[v+4]=d,u[v+5]=this.getBcdValue(S.substring(0,2)),u[v+6]=this.getBcdValue(S.substring(3,5)),u[v+7]=D,u[v+8]=y;for(var p=0;p<y;p++)u[v+9+p]=f.charCodeAt(p)||0}o&&(u[u.length-2]=35,u[u.length-1]=255),a.push(u)}else{var m=new Array(n).fill(0);t.forEach(function(a,n){var r=a.openOrClose,i=a.clockType,c=a.clockTime,o=a.week,s=a.textLength,u=a.text,h=39*n;m[h]=35,m[h+1]=t.length,m[h+2]=n,m[h+3]=r,m[h+4]=i,m[h+5]=e.getBcdValue(c.substring(0,2)),m[h+6]=e.getBcdValue(c.substring(3,5)),m[h+7]=o,m[h+8]=s;for(var l=0;l<s;l++)m[h+9+l]=u.charCodeAt(l)||0}),m[n-2]=35,m[n-1]=255,a.push(m)}return a},vt.getSedentaryReminder=function(){var t=this.generateInitValue();return t[0]=yt,this.crcValue(t),t},vt.setSedentaryReminder=function(t){var e=this.generateInitValue();e[0]=Dt,e[1]=this.getBcdValue(t.startTime_Hour),e[2]=this.getBcdValue(t.startTime_Minutes),e[3]=this.getBcdValue(t.endTime_Hour),e[4]=this.getBcdValue(t.endTime_Minutes);var a=(t.weeks.sunday?1:0)+(t.weeks.monday?2:0)+(t.weeks.Tuesday?4:0)+(t.weeks.Wednesday?8:0)+(t.weeks.Thursday?16:0)+(t.weeks.Friday?32:0)+(t.weeks.Saturday?64:0);return e[5]=a,e[6]=t.intervalTime,e[7]=t.leastSteps,e[8]=t.mode,this.crcValue(e),e},vt.DATA_READ_START=0,vt.DATA_READ_CONTINUE=2,vt.DATA_DELETE=99,vt.DistanceMode_MILE=129,vt.DistanceMode_KM=128,vt.TimeMode_12h=129,vt.TimeMode_24h=128,vt.WristOn_Enable=129,vt.WristOn_DisEnable=128,vt.TempUnit_C=128,vt.TempUnit_F=129,vt.TAG="BleSDK",vt.isRuning=!1,vt.ecgopen=!1,vt.read=!1,vt.pregnancyCycleRead=!1,vt.isSettingSocial=!1,vt.StartDeviceMeasurementWithType=!1,vt}();export{ft as BleConst,mt as BleSDK,vt as DeviceKey,pt as ResolveUtil};
|
|
2
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=1,e=65,a=2,n=66,r=3,i=4,c=5,o=9,s=11,u=75,h=19,l=34,g=39,d=18,S=46,D=54,y=61,f=62,v=42,p=43,m=35,I=77,B=81,T=82,_=83,V=84,E=96,M=102,x=85,C=87,b=92,A=86,G=100,H=25,k=24,P=71,R=56,w=6,L=7,W=32,O=22,F=16,K=131,N=170,U=171,Q=21,j=36,Y=20,q=68,z=40,J=23,X=52,Z=90,$=97,tt=254,et=98,at=101,nt=176,rt=156,it=113,ct=120,ot=28,st=30,ut=99,ht=136,lt=137,gt=138,dt=120,St=58,Dt=37,yt=38,ft={GetDeviceTime:"get_device_time",GetPersonalInfo:"get_personal_info",GetDeviceInfo:"get_device_info",RealTimeStep:"real_time_step",GetStepGoal:"get_step_goal",GetDeviceBatteryLevel:"get_device_battery_level",GetDeviceMacAddress:"get_device_mac_address",GetDeviceVersion:"get_device_version",CMD_Reset:"cmd_reset",CMD_MCUReset:"cmd_mcu_reset",Notify:"notify",GetDeviceName:"get_device_name",SetAlarmClockWithAllClock:"set_alarm_clock_with_all_clock",Gps:"GPS",GetPPIData:"GetPPIData",GetHrvTimeValue:"GetHrvTimeValue",CloseDevices:"CloseDevices",GetOffCheckStatus:"GetOffCheckStatus",GetAutomaticHRMonitoring:"GetAutomaticHRMonitoring",GetSedentaryReminder:"GetSedentaryReminder",GetTotalActivityData:"GetTotalActivityData",GetDetailActivityData:"GetDetailActivityData",GetDetailSleepData:"GetDetailSleepData",AutoBloodOxygen:"AutoBloodOxygen",GetDynamicHR:"GetDynamicHR",ECGdata:"ECGdata",GetWomenHealth:"GetWomenHealth",CMD_Set_TemperatureCorrection:"CMD_Set_TemperatureCorrection",GetStaticHR:"GetStaticHR",Blood_oxygen:"Blood_oxygen",GetHRVData:"GetHRVData",GetAxillaryTemperatureDataWithMode:"GetAxillaryTemperatureDataWithMode",EnterQrCode:"EnterQrCode",QrCodeBandBack:"QrCodeBandBack",ExitQrCode:"ExitQrCode",Temperature_history:"Temperature_history",GetActivityModeData:"GetActivityModeData",EnterActivityMode:"EnterActivityMode",SetDeviceTime:"SetDeviceTime",GetAlarmClock:"GetAlarmClock",EcgppGstatus:"EcgppGstatus",GetEcgPpgStatus:"GetEcgPpgStatus",ENTERECG:"ENTERECG",MeasurementHrvCallback:"MeasurementHrvCallback",MeasurementHeartCallback:"MeasurementHeartCallback",MeasurementOxygenCallback:"MeasurementOxygenCallback",MeasurementTempCallback:"MeasurementTempCallback",StopMeasurementHrvCallback:"StopMeasurementHrvCallback",StopMeasurementHeartCallback:"StopMeasurementHeartCallback",StopMeasurementOxygenCallback:"StopMeasurementOxygenCallback",StopMeasurementTempCallback:"StopMeasurementTempCallback",Braceletdial:"Braceletdial",Braceletdialok:"Braceletdialok",GetSportMode:"GetSportMode",GPSControlCommand:"GPSControlCommand",SocialdistanceGetting:"SocialdistanceGetting",EcgppG:"EcgppG",DeviceSendDataToAPP:"DeviceSendDataToAPP",SetNewDeviceInfo:"SetNewDeviceInfo",GetNewDeviceInfo:"GetNewDeviceInfo",BoolsugarStatus:"BoolsugarStatus",BoolsugarValue:"BoolsugarValue",GetPregnancyCycle:"GetPregnancyCycle",SetStepGoal:"SetStepGoal",SetPersonalInfo:"SetPersonalInfo",SetMotorVibrationWithTimes:"SetMotorVibrationWithTimes",SetDeviceInfo:"SetDeviceInfo",SetAutomaticHRMonitoring:"SetAutomaticHRMonitoring",SetSedentaryReminder:"SetSedentaryReminder",EnterPhotoMode:"EnterPhotoMode",BackHomeView:"BackHomeView",Weather:"Weather",SportMode:"SportMode",Clear_Bracelet_data:"Clear_Bracelet_data",SocialdistanceSetting:"SocialdistanceSetting",Sos:"Sos",SetPregnancyCycle:"SetPregnancyCycle",DeleteECGdata:"DeleteECGdata",ECG:"ECG",SetWomenHealth:"SetWomenHealth",ppgStartSucessed:"ppgStartSucessed",ppgResult:"ppgResult",ppgStop:"ppgStop",ppgMeasurementProgress:"ppgMeasurementProgress",ppgQuit:"ppgQuit",ppgStartFailed:"ppgStartFailed",CMD_Set_Mac:"CMD_Set_Mac",CloseECG:"CloseECG",GetAlarmClock_V4:"GetAlarmClock_V4",DeleteAllAlarmClock_V4:"DeleteAllAlarmClock_V4",SetAlarmClock_V4:"SetAlarmClock_V4",GetSedentaryReminder_V4:"GetSedentaryReminder_V4",SetSedentaryReminder_V4:"SetSedentaryReminder_V4"},vt={DeviceTime:"device_time",GPSTime:"gps_time",DataType:"data_type",End:"end",Data:"data",Gender:"gender",Age:"age",Height:"height",Weight:"weight",Stride:"stride",KUserDeviceId:"k_user_device_id",KClockLast:"k_clock_last",Step:"step",Calories:"calories",Distance:"distance",ExerciseMinutes:"exercise_minutes",HeartRate:"heart_rate",ActiveMinutes:"active_minutes",TempData:"temp_data",Blood_oxygen:"blood_oxygen",StepGoal:"step_goal",DistanceGoal:"distance_goal",CalorieGoal:"calorie_goal",SleepTimeGoal:"sleep_time_goal",BatteryLevel:"battery_level",MacAddress:"mac_address",DeviceVersion:"device_version",DeviceName:"device_name",Date:"date",Latitude:"latitude",Longitude:"longitude",TOTAL_ID:"totalId",PPI_ID:"ppiId",PPI_LIST:"ppiList",PPI_NUM:"ppiNum",HRV_TIME_MODE:"hrvTimeMode",HRV_TIME_Value:"hrvTimeValue",RESULT:"result",GET_OFF_TAG:"getOffTag",GET_OFF_STATE:"getOffState",DistanceUnit:"distance_unit",TimeUnit:"time_unit",StatusOfTheRaisedHandOnscreen:"status_of_the_raised_hand_onscreen",TempUnit:"temp_unit",NightMode:"night_mode",KBaseHeart:"k_base_heart",ScreenBrightness:"screen_brightness",Dialinterface:"dial_interface",SocialDistancedwitch:"social_distance_switch",ChineseOrEnglish:"chinese_or_english",WorkMode:"work_mode",StartTime:"start_time",KHeartStartMinter:"kheart_start_minter",EndTime:"end_time",KHeartEndMinter:"kheart_end_minter",Weeks:"weeks",IntervalTime:"interval_time",StartTimeHour:"StartTimeHour",StartTimeMin:"StartTimeMin",EndTimeHour:"EndTimeHour",EndTimeMin:"EndTimeMin",LeastSteps:"LeastSteps",Week:"week",Goal:"Goal",KDetailMinterStep:"KDetailMinterStep",ArraySteps:"ArraySteps",ArraySleep:"ArraySleep",sleepUnitLength:"sleepUnitLength",StaticHR:"StaticHR",WomenHealthPeriod:"WomenHealthPeriod",WomenHealthLength:"WomenHealthLength",TemperatureCorrectionValue:"TemperatureCorrectionValue",HRV:"HRV",ECGMoodValue:"ECGMoodValue",ECGValue:"ECGValue",ArrayDynamicHR:"ArrayDynamicHR",KAlarmId:"KAlarmId",OpenOrClose:"OpenOrClose",ClockType:"ClockType",ClockTime:"ClockTime",KAlarmMinter:"KAlarmMinter",KAlarmContent:"KAlarmContent",KAlarmLength:"KAlarmLength",axillaryTemperature:"axillaryTemperature",Band:"Band",temperature:"temperature",ActivityMode:"ActivityMode",Pace:"Pace",KPhoneDataLength:"KPhoneDataLength",VascularAging:"VascularAging",Stress:"Stress",highBP:"highBP",lowBP:"lowBP",EcgStatus:"ecgStatus",PPGValue:"ppgValue",ECGHrvValue:"ecgHrvValue",ECGAvBlockValue:"ecgAvBlockValue",ECGHrValue:"ecgHrValue",ECGStreesValue:"ecgStressValue",ECGhighBpValue:"ecgHighBpValue",ECGLowBpValue:"ecgLowBpValue",ECGBreathValue:"ecgBreathValue",KActivityLocationTime:"activityLocationTime",KActivityLocationLatitude:"activityLocationLatitude",KActivityLocationLongitude:"activityLocationLongitude",KActivityLocationCount:"activityLocationCount",DayOfWeek:"dayOfWeek",Text:"text",TextLength:"textLength",IsDeleteData:"isDeleteData"},pt=function(){function t(){}return t.crcValue=function(t){for(var e=0,a=0;a<t.length-1;a++)e+=t[a];t[t.length-1]=255&e},t.hexByte2Int=function(t,e){return(255&t)*Math.pow(256,e)},t.bcd2String=function(t){var e=15&t;return"".concat((240&t)>>4).concat(e)},t.intList2String=function(t){return t.map(function(t){return t.toString(16).padStart(2,"0").toUpperCase()}).join(" ")},t.intList3String=function(t){return t.map(function(t){return t.toString(16).padStart(2,"0").toLowerCase()}).join(" ")},t.setMacSuccessful=function(){var t;return(t={})[vt.DataType]=ft.CMD_Set_Mac,t[vt.End]=!0,t[vt.Data]={},t},t.intBitToDouble=function(t){var e=new ArrayBuffer(8),a=new DataView(e);return a.setInt32(0,t,!1),a.getFloat32(0,!1)},t.getDeviceTime=function(t){var e,a,n="20".concat(this.bcd2String(t[1]),"-").concat(this.bcd2String(t[2]),"-").concat(this.bcd2String(t[3])," ").concat(this.bcd2String(t[4]),":").concat(this.bcd2String(t[5]),":").concat(this.bcd2String(t[6])),r="".concat(this.bcd2String(t[9]),".").concat(this.bcd2String(t[10]),".").concat(this.bcd2String(t[11]));return(e={})[vt.DataType]=ft.GetDeviceTime,e[vt.End]=!0,e[vt.Data]=((a={})[vt.DeviceTime]=n,a[vt.GPSTime]=r,a),e},t.int2Ascll=function(t){if(t<0||t>255)throw new Error("Value must be between 0 and 255");return String.fromCharCode(t)},t.getGpsTime=function(t){return"".concat(this.bcd2String(t[9]),".").concat(this.bcd2String(t[10]),".").concat(this.bcd2String(t[11]))},t.getUserInfo=function(t){for(var e,a,n=new Array(6).fill(0),r=0;r<5;r++)n[r]=this.hexByte2Int(t[r+1],0);var i="";for(r=6;r<12;r++)0!==t[r]&&(i+=String.fromCharCode(this.hexByte2Int(t[r],0)));return(e={})[vt.DataType]=ft.GetPersonalInfo,e[vt.End]=!0,e[vt.Data]=((a={})[vt.Gender]=n[0],a[vt.Age]=n[1],a[vt.Height]=n[2],a[vt.Weight]=n[3],a[vt.Stride]=n[4],a[vt.KUserDeviceId]=i,a),e},t.getDeviceInfo=function(t){var e,a;return(e={})[vt.DataType]=ft.GetDeviceInfo,e[vt.End]=!0,e[vt.Data]=((a={})[vt.DistanceUnit]=this.hexByte2Int(t[1],0).toString(),a[vt.TimeUnit]=this.hexByte2Int(t[2],0).toString(),a[vt.StatusOfTheRaisedHandOnscreen]=this.hexByte2Int(t[3],0).toString(),a[vt.TempUnit]=this.hexByte2Int(t[4],0).toString(),a[vt.NightMode]=this.hexByte2Int(t[5],0).toString(),a[vt.KBaseHeart]=this.hexByte2Int(t[9],0).toString(),a[vt.ScreenBrightness]=this.hexByte2Int(t[11],0).toString(),a[vt.Dialinterface]=this.hexByte2Int(t[12],0).toString(),a[vt.SocialDistancedwitch]=this.hexByte2Int(t[13],0).toString(),a[vt.ChineseOrEnglish]=this.hexByte2Int(t[14],0).toString(),a),e},t.getActivityData=function(t){for(var e,a,n=0,r=0,i=0,c=0,o=0,s=1;s<5;s++)n+=this.hexByte2Int(t[s],s-1);for(s=5;s<9;s++)r+=this.hexByte2Int(t[s],s-5);for(s=9;s<13;s++)i+=this.hexByte2Int(t[s],s-9);for(s=13;s<17;s++)c+=this.hexByte2Int(t[s],s-13);for(s=17;s<21;s++)o+=this.hexByte2Int(t[s],s-17);var u=this.hexByte2Int(t[21],0),h=0,l=0;return t.length>22&&(h=this.hexByte2Int(t[22],0)+this.hexByte2Int(t[23],1),t.length>24&&(l=this.hexByte2Int(t[24],0))),(e={})[vt.DataType]=ft.RealTimeStep,e[vt.End]=!0,e[vt.Data]=((a={})[vt.Step]=n.toString(),a[vt.Calories]=(r/100).toFixed(1),a[vt.Distance]=(i/100).toFixed(1),a[vt.ExerciseMinutes]=(c/60).toString(),a[vt.HeartRate]=u.toString(),a[vt.ActiveMinutes]=o.toString(),a[vt.TempData]=h.toFixed(1),a[vt.Blood_oxygen]=l.toString(),a),e},t.getGoal=function(t){for(var e,a,n=0,r=0,i=0,c=0,o=0;o<4;o++)n+=this.hexByte2Int(t[o+1],o);for(o=0;o<=1;o++)r+=this.hexByte2Int(t[o+7],o);for(o=0;o<=1;o++)i+=this.hexByte2Int(t[o+9],o);for(o=0;o<=1;o++)c+=this.hexByte2Int(t[o+11],o);return(e={})[vt.DataType]=ft.GetStepGoal,e[vt.End]=!0,e[vt.Data]=((a={})[vt.StepGoal]=n.toString(),a[vt.DistanceGoal]=r.toString(),a[vt.CalorieGoal]=i.toString(),a[vt.SleepTimeGoal]=c.toString(),a),e},t.getDeviceBattery=function(t){var e,a,n=this.hexByte2Int(t[1],0);return(e={})[vt.DataType]=ft.GetDeviceBatteryLevel,e[vt.End]=!0,e[vt.Data]=((a={})[vt.BatteryLevel]=n.toString(),a),e},t.getDeviceAddress=function(t){var e,a;if(0===t.length)return{};for(var n=[],r=1;r<7;r++){var i=t[r].toString(16).padStart(2,"0");n.push(i)}var c=n.join(":");return(e={})[vt.DataType]=ft.GetDeviceMacAddress,e[vt.End]=!0,e[vt.Data]=((a={})[vt.MacAddress]=c,a),e},t.getDeviceVersion=function(t){var e,a;if(0===t.length)return{};for(var n=[],r=1;r<5;r++)n.push(t[r].toString(16));var i=n.join(".");return(e={})[vt.DataType]=ft.GetDeviceVersion,e[vt.End]=!0,e[vt.Data]=((a={})[vt.DeviceVersion]=i,a),e},t.Reset=function(){var t;return(t={})[vt.DataType]=ft.CMD_Reset,t[vt.End]=!0,t},t.MCUReset=function(){var t;return(t={})[vt.DataType]=ft.CMD_MCUReset,t[vt.End]=!0,t},t.Notify=function(){var t;return(t={})[vt.DataType]=ft.Notify,t[vt.End]=!0,t},t.getDeviceName=function(t){for(var e,a,n="",r=1;r<15;r++){var i=this.hexByte2Int(t[r],0);0===i||i>127||(n+=String.fromCharCode(i))}return(e={})[vt.DataType]=ft.GetDeviceName,e[vt.End]=!0,e[vt.Data]=((a={})[vt.DeviceName]=n,a),e},t.getAutoHeart=function(t){var e,a,n=this.hexByte2Int(t[7],0)+this.hexByte2Int(t[8],1);return(e={})[vt.DataType]=ft.GetAutomaticHRMonitoring,e[vt.End]=!0,e[vt.Data]=((a={})[vt.WorkMode]=this.hexByte2Int(t[1],0).toString(),a[vt.StartTime]=this.bcd2String(t[2]),a[vt.KHeartStartMinter]=this.bcd2String(t[3]),a[vt.EndTime]=this.bcd2String(t[4]),a[vt.KHeartEndMinter]=this.bcd2String(t[5]),a[vt.Weeks]=this.getByteString(t[6]),a[vt.IntervalTime]=n.toString(),a),e},t.getWeekInt=function(t){for(var e=0,a=0;a<t.length;a++)1===t[a]&&(e+=Math.pow(2,a));return e},t.getByteString=function(t){for(var e=new Array(8).fill(0),a=[],n=0;n<=6;n++)e[n]=1&t,t>>=1,a.push(e[n].toString());return a.join("-")},t.getByteArray=function(t){for(var e=new Array(8).fill(0),a="",n=0;n<=7;n++)e[n]=1&t,t>>=1,a+=e[n];return a},t._hexByte2Int=function(t,e){return t<<8*e},t._bcd2String=function(t){var e=15&t;return"".concat(t>>4&15).concat(e)},t.getActivityAlarm=function(t){var e,a,n=((e={})[vt.StartTimeHour]=this._bcd2String(t[1]),e[vt.StartTimeMin]=this._bcd2String(t[2]),e[vt.EndTimeHour]=this._bcd2String(t[3]),e[vt.EndTimeMin]=this._bcd2String(t[4]),e[vt.Week]=this.getByteString(t[5]),e[vt.IntervalTime]=this._hexByte2Int(t[6],0).toString(),e[vt.LeastSteps]=this._hexByte2Int(t[7],0).toString(),e[vt.OpenOrClose]=this._hexByte2Int(t[8],0).toString(),e);return(a={})[vt.DataType]=ft.GetSedentaryReminder,a[vt.End]=!0,a[vt.Data]=n,a},t.getTotalStepData=function(t){var e,a;console.log("total:",t);var n=((e={})[vt.DataType]=ft.GetTotalActivityData,e[vt.End]=!1,e[vt.Data]=[],e),r=27,i=t.length,c=Math.floor(i/r);if(0===c)return n[vt.End]=!0,n;for(var o=0;o<c;o++){var s=1+(o+1)*r;s<i&&255===t[s]&&(n[vt.End]=!0);for(var u="20".concat(this._bcd2String(t[2+o*r]),".").concat(this._bcd2String(t[3+o*r]),".").concat(this._bcd2String(t[4+o*r])),h=0,l=0;l<4;l++)h+=this._hexByte2Int(t[5+l+o*r],l);var g=0;for(l=0;l<4;l++)g+=this._hexByte2Int(t[9+l+o*r],l);var d=0;for(l=0;l<4;l++)d+=this._hexByte2Int(t[13+l+o*r],l);var S=0;for(l=0;l<4;l++)S+=this._hexByte2Int(t[17+l+o*r],l);var D=this._hexByte2Int(t[21+o*r],0)+this._hexByte2Int(t[22+o*r],1),y=0;for(l=0;l<4;l++)y+=this._hexByte2Int(t[23+l+o*r],l);n[vt.Data].push(((a={})[vt.Date]=u,a[vt.Step]=h.toString(),a[vt.ExerciseMinutes]=g.toString(),a[vt.Calories]=(S/100).toFixed(1),a[vt.Distance]=(d/100).toFixed(1),a[vt.Goal]=D.toString(),a[vt.ActiveMinutes]=y,a))}return n},t.getDetailData=function(t){var e,a,n=((e={})[vt.DataType]=ft.GetDetailActivityData,e[vt.End]=!1,e[vt.Data]=[],e),r=t.length,i=Math.floor(r/25);if(0===i)return n[vt.End]=!0,n;for(var c=0;c<i;c++){255===t[r-1]&&(n[vt.End]=!0);for(var o="20".concat(this._bcd2String(t[3+25*c]),".").concat(this._bcd2String(t[4+25*c]),".").concat(this._bcd2String(t[5+25*c])," ").concat(this._bcd2String(t[6+25*c]),":").concat(this._bcd2String(t[7+25*c]),":").concat(this._bcd2String(t[8+25*c])),s=0,u=0;u<2;u++)s+=this._hexByte2Int(t[9+u+25*c],u);var h=0;for(u=0;u<2;u++)h+=this._hexByte2Int(t[11+u+25*c],u);var l=0;for(u=0;u<2;u++)l+=this._hexByte2Int(t[13+u+25*c],u);var g=[];for(u=0;u<10;u++)g.push(this._hexByte2Int(t[15+u+25*c],0).toString());n[vt.Data].push(((a={})[vt.Date]=o,a[vt.KDetailMinterStep]=s.toString(),a[vt.Calories]=(h/100).toFixed(2),a[vt.Distance]=(l/100).toFixed(2),a[vt.ArraySteps]=g.join(" "),a))}return n},t.getSleepData=function(t){var e,a,n,r=t.length,i=((e={})[vt.DataType]=ft.GetDetailSleepData,e[vt.End]=!1,e[vt.Data]=[],e),c=255===t[t.length-1]&&t[t.length-2]===_;if(c&&(i[vt.End]=!0),130===r||c&&132===r){for(var o="20".concat(this._bcd2String(t[3]),"-").concat(this._bcd2String(t[4]),"-").concat(this._bcd2String(t[5])," ").concat(this._bcd2String(t[6]),":").concat(this._bcd2String(t[7]),":").concat(this._bcd2String(t[8])),s=this._hexByte2Int(t[9],0),u=[],h=0;h<s;h++)u.push(this._hexByte2Int(t[10+h],0).toString());i[vt.Data].push(((a={})[vt.Date]=o,a[vt.ArraySleep]=u.join(" "),a[vt.sleepUnitLength]="1",a))}else{var l=Math.floor(r/34);if(0===l)return i[vt.End]=!0,i;for(var g=0;g<l;g++){for(o="20".concat(this._bcd2String(t[3+34*g]),"-").concat(this._bcd2String(t[4+34*g]),"-").concat(this._bcd2String(t[5+34*g])," ").concat(this._bcd2String(t[6+34*g]),":").concat(this._bcd2String(t[7+34*g]),":").concat(this._bcd2String(t[8+34*g])),s=this._hexByte2Int(t[9+34*g],0),u=[],h=0;h<s;h++)u.push(this._hexByte2Int(t[10+h+34*g],0).toString());i[vt.Data].push(((n={})[vt.Date]=o,n[vt.ArraySleep]=u.join(" "),n[vt.sleepUnitLength]="5",n))}}return i},t.getAutoBloodOxygen=function(t){var e,a,n=((e={})[vt.DataType]=ft.AutoBloodOxygen,e[vt.End]=!1,e[vt.Data]=[],e),r=10,i=t.length,c=Math.floor(i/r);if(0===c)return n[vt.End]=!0,n;for(var o=0;o<c;o++){255===t[i-1]&&(n[vt.End]=!0);var s="20".concat(this._bcd2String(t[3+o*r]),".").concat(this._bcd2String(t[4+o*r]),".").concat(this._bcd2String(t[5+o*r])," ").concat(this._bcd2String(t[6+o*r]),":").concat(this._bcd2String(t[7+o*r]),":").concat(this._bcd2String(t[8+o*r])),u=this._hexByte2Int(t[9+10*o],0).toString();n[vt.Data].push(((a={})[vt.Date]=s,a[vt.Blood_oxygen]=u,a))}return n},t.getBloodoxygen=function(t){var e,a,n=((e={})[vt.DataType]=ft.Blood_oxygen,e[vt.End]=!1,e[vt.Data]=[],e),r=10,i=t.length,c=Math.floor(i/r);if(0===c)return n[vt.End]=!0,n;for(var o=0;o<c;o++){255===t[i-1]&&(n[vt.End]=!0);var s="20".concat(this._bcd2String(t[3+o*r]),".").concat(this._bcd2String(t[4+o*r]),".").concat(this._bcd2String(t[5+o*r])," ").concat(this._bcd2String(t[6+o*r]),":").concat(this._bcd2String(t[7+o*r]),":").concat(this._bcd2String(t[8+o*r])),u=this._hexByte2Int(t[9+10*o],0).toString();n[vt.Data].push(((a={})[vt.Date]=s,a[vt.Blood_oxygen]=u,a))}return n},t.getHeartData=function(t){var e,a,n=((e={})[vt.DataType]=ft.GetDynamicHR,e[vt.End]=!1,e[vt.Data]=[],e),r=24,i=t.length,c=Math.floor(i/r);if(0===c)return n[vt.End]=!0,n;for(var o=0;o<c;o++){255===t[i-1]&&(n[vt.End]=!0);for(var s="20".concat(this._bcd2String(t[3+o*r]),".").concat(this._bcd2String(t[4+o*r]),".").concat(this._bcd2String(t[5+o*r])," ").concat(this._bcd2String(t[6+o*r]),":").concat(this._bcd2String(t[7+o*r]),":").concat(this._bcd2String(t[8+o*r])),u=[],h=0;h<15;h++)u.push(this._hexByte2Int(t[9+h+o*r],0).toString());n[vt.Data].push(((a={})[vt.Date]=s,a[vt.ArrayDynamicHR]=u.join(" "),a))}return n},t.getOnceHeartData=function(t){var e,a,n=((e={})[vt.DataType]=ft.GetStaticHR,e[vt.End]=!1,e[vt.Data]=[],e),r=t.length,i=Math.floor(r/10);if(0===i||1===i&&153===t[1])return n[vt.End]=!0,n;for(var c=0;c<i;c++){255===t[r-1]&&(n[vt.End]=!0);var o="20".concat(this._bcd2String(t[3+10*c]),".").concat(this._bcd2String(t[4+10*c]),".").concat(this._bcd2String(t[5+10*c])," ").concat(this._bcd2String(t[6+10*c]),":").concat(this._bcd2String(t[7+10*c]),":").concat(this._bcd2String(t[8+10*c])),s=this._hexByte2Int(t[9+10*c],0).toString();n[vt.Data].push(((a={})[vt.Date]=o,a[vt.StaticHR]=s,a))}return n},t.getHrvTestData=function(t){var e,a,n=((e={})[vt.DataType]=ft.GetHRVData,e[vt.End]=!1,e[vt.Data]=[],e),r=15,i=t.length,c=Math.floor(i/r);if(0===c)return n[vt.End]=!0,n;255===t[t.length-1]&&(n[vt.End]=!0);for(var o=0;o<c;o++){var s="20".concat(this.bcd2String(t[3+o*r]),".").concat(this.bcd2String(t[4+o*r]),".").concat(this.bcd2String(t[5+o*r])," ").concat(this.bcd2String(t[6+o*r]),":").concat(this.bcd2String(t[7+o*r]),":").concat(this.bcd2String(t[8+o*r])),u=this.hexByte2Int(t[9+o*r],0).toString(),h=this.hexByte2Int(t[10+o*r],0).toString(),l=this.hexByte2Int(t[11+o*r],0).toString(),g=this.hexByte2Int(t[12+o*r],0).toString(),d=this.hexByte2Int(t[13+o*r],0).toString(),S=this.hexByte2Int(t[14+o*r],0).toString();n[vt.Data].push(((a={})[vt.Date]=s,a[vt.HRV]=u,a[vt.VascularAging]=h,a[vt.HeartRate]=l,a[vt.Stress]=g,a[vt.highBP]=d,a[vt.lowBP]=S,a))}return n},t.getClockData=function(t){var e,a;console.log("getClockData:",t);var n=((e={})[vt.DataType]=ft.GetAlarmClock,e[vt.End]=!1,e[vt.Data]=[],e),r=41,i=t.length,c=!1,o=Math.floor(i/r);if(0===o)return n[vt.End]=!0,n;153==t[1]&&16==i&&(c=!0),n[vt.IsDeleteData]=c;for(var s=0;s<o;s++){var u=1+(s+1)*r;u<i&&255===t[u]&&(n[vt.End]=!0);for(var h=this.hexByte2Int(t[4+s*r],0).toString(),l=this.hexByte2Int(t[5+s*r],0).toString(),g=this.hexByte2Int(t[6+s*r],0).toString(),d=this.bcd2String(t[7+s*r]),S=this.bcd2String(t[8+s*r]),D=this.hexByte2Int(t[9+s*r],0),y=this.hexByte2Int(t[10+s*r],0),f="",v=0;v<y;v++){var p=t[11+v+s*r];0!==p&&(f+=this.int2Ascll(this.hexByte2Int(p,0)))}n[vt.Data].push(((a={})[vt.KAlarmId]=h,a[vt.OpenOrClose]=l,a[vt.ClockType]=g,a[vt.ClockTime]=d,a[vt.KAlarmMinter]=S,a[vt.Week]=D,a[vt.KAlarmContent]=f,a[vt.KAlarmLength]=y.toString(),a))}return n},t.getTempDataer=function(t){var e,a,n=((e={})[vt.DataType]=ft.GetAxillaryTemperatureDataWithMode,e[vt.End]=!1,e[vt.Data]=[],e),r=11,i=t.length,c=Math.floor(i/r);if(0===c||255===t[i-1])return n[vt.End]=!0,n;for(var o=0;o<c;o++){255===t[i-1]&&(n[vt.End]=!0);var s="20".concat(this.bcd2String(t[3+o*r]),".").concat(this.bcd2String(t[4+o*r]),".").concat(this.bcd2String(t[5+o*r])," ").concat(this.bcd2String(t[6+o*r]),":").concat(this.bcd2String(t[7+o*r]),":").concat(this.bcd2String(t[8+o*r])),u=this.hexByte2Int(t[9+o*r],0)+this.hexByte2Int(t[10+o*r],1);n[vt.Data].push(((a={})[vt.Date]=s,a[vt.axillaryTemperature]=(.1*u).toFixed(1),a))}return n},t.getQrCode=function(t,e){var a,n,r,i;return e?((a={})[vt.DataType]=ft.EnterQrCode,a[vt.End]=!0,a[vt.Data]={},a):128===t[1]||129===t[1]?((n={})[vt.DataType]=ft.QrCodeBandBack,n[vt.End]=!0,n[vt.Data]=((r={})[vt.Band]=129===t[1]?"1":"0",r),n):((i={})[vt.DataType]=ft.ExitQrCode,i[vt.End]=!0,i[vt.Data]={},i)},t.getTempData=function(t){var e,a,n=((e={})[vt.DataType]=ft.Temperature_history,e[vt.End]=!1,e[vt.Data]=[],e),r=11,i=t.length,c=Math.floor(i/r);if(0===c||255===t[i-1]||1===c&&153===t[1])return n[vt.End]=!0,n;for(var o=0;o<c;o++){255===t[i-1]&&(n[vt.End]=!0);var s="20".concat(this.bcd2String(t[3+o*r]),".").concat(this.bcd2String(t[4+o*r]),".").concat(this.bcd2String(t[5+o*r])," ").concat(this.bcd2String(t[6+o*r]),":").concat(this.bcd2String(t[7+o*r]),":").concat(this.bcd2String(t[8+o*r])),u=this.hexByte2Int(t[9+o*r],0)+this.hexByte2Int(t[10+o*r],1);n[vt.Data].push(((a={})[vt.Date]=s,a[vt.temperature]=(.1*u).toFixed(1),a))}return n},t.getExerciseData=function(t){var e,a,n=((e={})[vt.DataType]=ft.GetActivityModeData,e[vt.End]=!1,e[vt.Data]=[],e),r=25,i=t.length,c=Math.floor(i/r);if(0===c)return n[vt.End]=!0,n;for(var o=0;o<c;o++){var s=1+(o+1)*r;s<i&&o===c-1&&255===t[s]&&(n[vt.End]=!0);for(var u="20".concat(this.bcd2String(t[3+o*r]),".").concat(this.bcd2String(t[4+o*r]),".").concat(this.bcd2String(t[5+o*r])," ").concat(this.bcd2String(t[6+o*r]),":").concat(this.bcd2String(t[7+o*r]),":").concat(this.bcd2String(t[8+o*r])),h=this.hexByte2Int(t[9+o*r],0).toString(),l=this.hexByte2Int(t[10+o*r],0).toString(),g=this.getData(2,11+o*r,t),d=this.getData(2,13+o*r,t),S=this.hexByte2Int(t[15+o*r],0),D=this.hexByte2Int(t[16+o*r],0),y=new Array(4).fill(0),f=0;f<4;f++)y[3-f]=t[17+f+o*r];var v=new Array(4).fill(0);for(f=0;f<4;f++)v[3-f]=t[21+f+o*r];var p=this.getFloat(y,0),m=this.getFloat(v,0);n[vt.Data].push(((a={})[vt.Date]=u,a[vt.ActivityMode]=h,a[vt.HeartRate]=l,a[vt.ActiveMinutes]=g.toString(),a[vt.Step]=d.toString(),a[vt.Pace]="".concat(S.toString(16),"'").concat(D.toString(16)),a[vt.Distance]=m.toFixed(2),a[vt.Calories]=p.toFixed(1),a))}return n},t.getActivityExerciseData=function(t){for(var e,a,n=0,r=0,i=new Array(4).fill(0),c=0;c<4;c++)n+=this.hexByte2Int(t[c+2],c),i[3-c]=t[c+6],r+=this.hexByte2Int(t[c+10],c);var o=this.hexByte2Int(t[1],0),s=this.getFloat(i,0);return(e={})[vt.DataType]=ft.EnterActivityMode,e[vt.End]=!0,e[vt.Data]=((a={})[vt.HeartRate]=o.toString(),a[vt.Step]=n.toString(),a[vt.Calories]=s.toFixed(1),a[vt.ActiveMinutes]=r.toString(),a),e},t.setTimeSuccessful=function(t){var e,a;return(e={})[vt.DataType]=ft.SetDeviceTime,e[vt.End]=!0,e[vt.Data]=((a={})[vt.KPhoneDataLength]=this.hexByte2Int(t[1],0).toString(),a),e},t.getData=function(t,e,a){for(var n=0,r=0;r<t;r++)n+=this.hexByte2Int(a[r+e],r);return n},t.getFloat=function(t,e){return this.intBitToDouble(this.getInt(t,e))},t.getInt=function(t,e){return(255&t[e])<<24|(255&t[e+1])<<16|(255&t[e+2])<<8|255&t[e+3]},t.setMethodSuccessful=function(t){var e;return(e={})[vt.DataType]=t,e[vt.End]=!0,e[vt.Data]={},e},t.getEcgHistoryData=function(t){var e,a=((e={})[vt.DataType]=ft.ECGdata,e[vt.End]=!1,e[vt.Data]={},e),n=t.length;if(3===n||113===t[n-3]&&255===t[n-2]&&255===t[n-1])return a[vt.End]=!0,a;var r=3;if(0===this.hexByte2Int(t[1],0)+this.hexByte2Int(t[2],1)){var i="20".concat(this.bcd2String(t[3]),"-").concat(this.bcd2String(t[4]),"-").concat(this.bcd2String(t[5])," ").concat(this.bcd2String(t[6]),":").concat(this.bcd2String(t[7]),":").concat(this.bcd2String(t[8])),c=this.hexByte2Int(t[11],0).toString(),o=this.hexByte2Int(t[12],0).toString(),s=this.hexByte2Int(t[13],0).toString();a[vt.Data][vt.Date]=i,a[vt.Data][vt.HRV]=c,a[vt.Data][vt.HeartRate]=o,a[vt.Data][vt.ECGMoodValue]=s,r=27}var u=t.slice(r,n),h=this.getEcgDataString(u);return a[vt.Data][vt.ECGValue]=h,a},t.getEcgDataString=function(t){for(var e=[],a=Math.floor(t.length/2)-1,n=0;n<a;n++){var r=this.hexByte2Int(t[2*n+1],1)+this.hexByte2Int(t[2*n+2],0);r>=32768&&(r-=65536),e.push(r.toString())}return e.join(",")},t.ecgData=function(t){var e,a,n=this.hexByte2Int(t[1],0);return(e={})[vt.DataType]=ft.EcgppGstatus,e[vt.End]=!0,e[vt.Data]=((a={})[vt.EcgStatus]=n.toString(),a),e},t.ppgData=function(t){var e,a;return(e={})[vt.DataType]=ft.EcgppGstatus,e[vt.End]=!0,e[vt.Data]=((a={})[vt.PPGValue]=t,a),e},t.ecgResult=function(t){var e,a,n=((e={})[vt.DataType]=ft.GetEcgPpgStatus,e[vt.End]=!0,e[vt.Data]={},e);if(3===this.hexByte2Int(t[1],0)){var r="20".concat(this.bcd2String(t[10]),".").concat(this.bcd2String(t[11]),".").concat(this.bcd2String(t[12])," ").concat(this.bcd2String(t[13]),":").concat(this.bcd2String(t[14]),":").concat(this.bcd2String(t[15]));n[vt.Data]=((a={})[vt.Date]=r,a[vt.ECGHrvValue]=this.hexByte2Int(t[2],0).toString(),a[vt.ECGAvBlockValue]=this.hexByte2Int(t[3],0).toString(),a[vt.ECGHrValue]=this.hexByte2Int(t[4],0).toString(),a[vt.ECGStreesValue]=this.hexByte2Int(t[5],0).toString(),a[vt.ECGhighBpValue]=this.hexByte2Int(t[6],0).toString(),a[vt.ECGLowBpValue]=this.hexByte2Int(t[7],0).toString(),a[vt.ECGMoodValue]=this.hexByte2Int(t[8],0).toString(),a[vt.ECGBreathValue]=this.hexByte2Int(t[9],0).toString(),a)}return n},t.enterEcg=function(t){var e;return(e={})[vt.DataType]=ft.ENTERECG,e[vt.End]=!0,e[vt.Data]={},e},t.measurementWithType=function(t,e){var a,n,r,i,c,o,s,u;if(t)switch(e[1]){case 1:return(a={})[vt.DataType]=ft.MeasurementHrvCallback,a[vt.End]=!0,a[vt.Data]=((n={})[vt.HRV]=this.hexByte2Int(e[4],0),n),a;case 2:return(r={})[vt.DataType]=ft.MeasurementHeartCallback,r[vt.End]=!0,r[vt.Data]=((i={})[vt.HeartRate]=this.hexByte2Int(e[2],0),i),r;case 3:return(c={})[vt.DataType]=ft.MeasurementOxygenCallback,c[vt.End]=!0,c[vt.Data]=((o={})[vt.Blood_oxygen]=this.hexByte2Int(e[3],0),o),c;case 4:var h=this.hexByte2Int(e[8],0)+this.hexByte2Int(e[9],1);return(s={})[vt.DataType]=ft.MeasurementTempCallback,s[vt.End]=!0,s[vt.Data]=((u={})[vt.temperature]=(.1*h).toFixed(1),u),s}else{var l={1:ft.StopMeasurementHrvCallback,2:ft.StopMeasurementHeartCallback,3:ft.StopMeasurementOxygenCallback,4:ft.StopMeasurementTempCallback};if(l[e[1]])return this.setMethodSuccessful(l[e[1]])}return{}},t.braceletdial=function(t,e){var a,n;return t?((a={})[vt.DataType]=ft.Braceletdial,a[vt.End]=!0,a):((n={})[vt.DataType]=ft.Braceletdialok,n[vt.End]=!0,n[vt.Data]={index:e[1].toString()},n)},t.getSportMode=function(t){for(var e,a=this.hexByte2Int(t[1],0),n=[],r=0;r<a;r++)n.push(this.hexByte2Int(t[r+2],0).toString());return(e={})[vt.DataType]=ft.GetSportMode,e[vt.End]=!0,e[vt.Data]=n.join(","),e},t.gPSControlCommand=function(t){for(var e,a,n="20".concat(this.bcd2String(t[1]),"-").concat(this.bcd2String(t[2]),"-").concat(this.bcd2String(t[3])," ").concat(this.bcd2String(t[4]),":").concat(this.bcd2String(t[5]),":").concat(this.bcd2String(t[6])),r=new Array(4).fill(0),i=new Array(4).fill(0),c=0;c<4;c++)r[3-c]=t[9+c],i[3-c]=t[14+c];var o=this.getFloat(r,0).toString(),s=this.getFloat(i,0).toString(),u=this.hexByte2Int(t[18],0);return(e={})[vt.DataType]=ft.GPSControlCommand,e[vt.End]=!0,e[vt.Data]=((a={})[vt.KActivityLocationTime]=n,a[vt.KActivityLocationLatitude]=o,a[vt.KActivityLocationLongitude]=s,a[vt.KActivityLocationCount]=u.toString(),a),e},t.setSocial=function(t){var e;return(e={})[vt.DataType]=ft.SocialdistanceGetting,e[vt.End]=!0,e[vt.Data]={scanInterval:this.hexByte2Int(t[2],0).toString(),scanTime:this.hexByte2Int(t[3],0).toString(),signalStrength:t[4].toString()},e},t.eCGQuality=function(t){var e;return(e={})[vt.DataType]=ft.EcgppG,e[vt.End]=!0,e[vt.Data]={heartValue:this.hexByte2Int(t[1],0).toString(),hrvValue:this.hexByte2Int(t[2],0).toString(),Quality:this.hexByte2Int(t[3],0).toString()},e},t.enterPhotoModeback=function(t){var e,a="";switch(t[1]){case 1:a=0===t[2]?"0":"1";break;case 2:a="2";break;case 3:switch(t[2]){case 1:a="3";break;case 2:a="4";break;case 3:a="5";break;case 4:a="6";break;case 5:a="7"}break;case 4:a="8"}return(e={})[vt.DataType]=ft.DeviceSendDataToAPP,e[vt.End]=!0,e[vt.Data]={type:a},e},t.setNewDeviceInfo=function(t){var e;return(e={})[vt.DataType]=ft.SetNewDeviceInfo,e[vt.End]=!0,e[vt.Data]={},e},t.getNewDeviceInfo=function(t){var e;return(e={})[vt.DataType]=ft.GetNewDeviceInfo,e[vt.End]=!0,e[vt.Data]={KEcg:this.hexByte2Int(t[1],0).toString()},e},t.updateClockSuccessful=function(t){var e,a;return console.log("updateClockSuccessful:",t),(e={})[vt.DataType]=ft.SetAlarmClockWithAllClock,e[vt.End]=!0,e[vt.Data]=((a={})[vt.KClockLast]=this.hexByte2Int(t[t.length-1],0).toString(),a),e},t.setBoolSugarStatus=function(t){var e,a;return(e={})[vt.DataType]=ft.BoolsugarStatus,e[vt.End]=!0,e[vt.Data]=((a={})[vt.EcgStatus]=this.hexByte2Int(t[2],0),a),e},t.setBoolSugarValue=function(t){for(var e,a=t.slice(3),n=[],r=0;r<Math.floor(a.length/3);r++){var i=this.hexByte2Int(a[3*r],2)+this.hexByte2Int(a[3*r+1],1)+this.hexByte2Int(a[3*r+2],0);n.push(i)}return(e={})[vt.DataType]=ft.BoolsugarValue,e[vt.End]=!0,e[vt.Data]={timestamp:Math.floor(Date.now()/1e3),ppg:n},e},t.setMethodError=function(t){var e;return(e={})[vt.DataType]=t,e[vt.End]=!1,e[vt.Data]={},e},t.readPregnancyCycle=function(t){var e,a;return(e={})[vt.DataType]=ft.GetPregnancyCycle,e[vt.End]=!0,e[vt.Data]=((a={})[vt.Date]="20".concat(this.bcd2String(t[3]),"-").concat(this.bcd2String(t[4]),"-").concat(this.bcd2String(t[5])),a[vt.Week]=this.hexByte2Int(t[1],0),a[vt.DayOfWeek]=this.hexByte2Int(t[2],0),a),e},t.readWomenHealth=function(t){var e,a;return(e={})[vt.DataType]=ft.GetWomenHealth,e[vt.End]=!0,e[vt.Data]=((a={})[vt.Date]="".concat(this.bcd2String(t[1]),"-").concat(this.bcd2String(t[2])),a[vt.WomenHealthPeriod]=this.hexByte2Int(t[3],0),a[vt.WomenHealthLength]=this.hexByte2Int(t[4],0),a),e},t.getTemperatureCorrectionValue=function(t){var e,a,n=[t[3],t[2]],r=this.byteArrayToInt(n);return(e={})[vt.DataType]=ft.CMD_Set_TemperatureCorrection,e[vt.End]=!0,e[vt.Data]=((a={})[vt.TemperatureCorrectionValue]=r.toString(),a),e},t.byteArrayToInt=function(t){return t[0]<<8&65280|255&t[1]},t.getHistoryGpsData=function(t){var e,a=[],n=((e={})[vt.DataType]=ft.Gps,e[vt.End]=!1,e),r=59,i=t.length,c=Math.floor(i/r);if(0===c)return n;255===t[t.length-1]&&90===t[t.length-2]&&(n[vt.End]=!0);for(var o=0;o<c;o++){for(var s={},u="20".concat(this.bcd2String(t[3+o*r]),".").concat(this.bcd2String(t[4+o*r]),".").concat(this.bcd2String(t[5+o*r])," ").concat(this.bcd2String(t[6+o*r]),":").concat(this.bcd2String(t[7+o*r]),":").concat(this.bcd2String(t[8+o*r])),h=[],l=[],g=0;g<6;g++){for(var d=new Array(4).fill(0),S=new Array(4).fill(0),D=0;D<4;D++)d[3-D]=t[9+D+o*r+8*g],S[3-D]=t[13+D+o*r+8*g];var y=this.getFloat(d,0).toString(),f=this.getFloat(S,0).toString();h.push(y),l.push(f)}s[vt.Date]=17===u.length?u:"2019.01.01 00:00:00",s[vt.Latitude]=h.join(","),s[vt.Longitude]=l.join(","),a.push(s)}return n[vt.Data]=a,n},t.getPPITestData=function(t){var e,a=((e={})[vt.DataType]=ft.GetPPIData,e[vt.End]=!1,e[vt.Data]=[],e),n=123,r=t.length,i=Math.floor(r/n);if(0===i)return a[vt.End]=!0,a;255===t[t.length-1]&&(a[vt.End]=!0);for(var c=0;c<i;c++){for(var o={},s=new Array(2).fill(0),u=0;u<2;u++)s[1-u]=t[1+u+c*n];for(var h=this.getInt(s,0),l="20".concat(this.bcd2String(t[3+c*n]),".").concat(this.bcd2String(t[4+c*n]),".").concat(this.bcd2String(t[5+c*n])," ").concat(this.bcd2String(t[6+c*n]),":").concat(this.bcd2String(t[7+c*n]),":").concat(this.bcd2String(t[8+c*n])),g=this.hexByte2Int(t[9+c*n],0),d=this.hexByte2Int(t[10+c*n],0).toString(),S=[],D=0;D<56;D++){for(var y=11+2*D,f=new Array(2).fill(0),v=0;v<2;v++)f[1-v]=t[y+v+c*n];var p=this.getFloat(f,0);if(0===p)break;S.push(p)}o[vt.TOTAL_ID]=g.toString(),o[vt.PPI_ID]=d,o[vt.DeviceTime]=l,o[vt.PPI_LIST]=S,o[vt.PPI_NUM]=h,a[vt.Data].push(o)}return a},t.getHrvTimeData=function(t){var e,a;return(e={})[vt.DataType]=ft.GetHrvTimeValue,e[vt.End]=!0,e[vt.Data]=((a={})[vt.HRV_TIME_MODE]=this.hexByte2Int(t[1],0),a[vt.HRV_TIME_Value]=this.hexByte2Int(t[2],0),a),e},t.closeDevices=function(t){var e,a;return(e={})[vt.DataType]=ft.CloseDevices,e[vt.End]=!0,e[vt.Data]=((a={})[vt.RESULT]=!0,a),e},t.getOffCheckStatus=function(t){var e,a;return(e={})[vt.DataType]=ft.GetOffCheckStatus,e[vt.End]=!0,e[vt.Data]=((a={})[vt.GET_OFF_TAG]=this.hexByte2Int(t[1],0),a[vt.GET_OFF_STATE]=this.hexByte2Int(t[2],0),a),e},t}();"function"==typeof SuppressedError&&SuppressedError;var mt=function(){function vt(){}return vt.generateValue=function(t){return new Array(t).fill(0)},vt.hexByte2Int=function(t,e){return(255&t)*Math.pow(256,e)},vt.generateInitValue=function(){return this.generateValue(16)},vt.arrayCopy=function(t,e,a,n,r){for(var i=0;i<r;i++)a[n+i]=t[e+i]},vt.crcValue=function(t){for(var e=0,a=0,n=t;a<n.length;a++){e+=n[a]}t[15]=255&e},vt.crcDynamicValue=function(t){for(var e=0,a=0,n=t;a<n.length;a++){e+=n[a]}t[t.length-1]=255&e},vt.getBcdValue=function(t){return 16*Math.floor(t/10)+t%10},vt.dataParsingWithData=function(P){if(!P||0===P.length)return pt.setMethodError("Empty data");switch(P[0]){case s:return pt.setMethodSuccessful(ft.SetStepGoal);case a:return pt.setMethodSuccessful(ft.SetPersonalInfo);case y:break;case D:return pt.setMethodSuccessful(ft.SetMotorVibrationWithTimes);case r:return pt.setMethodSuccessful(ft.SetDeviceInfo);case v:return pt.setMethodSuccessful(ft.SetAutomaticHRMonitoring);case Dt:return pt.setMethodSuccessful(ft.SetSedentaryReminder);case c:return pt.setMacSuccessful();case H:return pt.setMethodSuccessful(ft.EnterActivityMode);case R:return 0!==P[2]&&0!==P[3]?pt.getTemperatureCorrectionValue(P):pt.setMethodSuccessful(ft.CMD_Set_TemperatureCorrection);case k:return pt.getActivityExerciseData(P);case t:return pt.setTimeSuccessful(P);case b:return pt.getExerciseData(P);case e:return pt.getDeviceTime(P);case n:return pt.getUserInfo(P);case i:return pt.getDeviceInfo(P);case o:return pt.getActivityData(P);case u:return pt.getGoal(P);case h:return pt.getDeviceBattery(P);case l:return pt.getDeviceAddress(P);case g:return pt.getDeviceVersion(P);case f:return pt.getDeviceName(P);case p:return pt.getAutoHeart(P);case d:return pt.Reset();case S:return pt.MCUReset();case I:return pt.Notify();case yt:return pt.getActivityAlarm(P);case B:return pt.getTotalStepData(P);case T:return pt.getDetailData(P);case _:return pt.getSleepData(P);case V:return pt.getHeartData(P);case x:return pt.getOnceHeartData(P);case A:return pt.getHrvTestData(P);case C:return pt.getClockData(P);case m:return pt.updateClockSuccessful(P);case w:return pt.setNewDeviceInfo(P);case L:return pt.getNewDeviceInfo(P);case O:return pt.enterPhotoModeback(P);case W:return pt.setMethodSuccessful(ft.EnterPhotoMode);case F:return pt.setMethodSuccessful(ft.BackHomeView);case K:return pt.eCGQuality(P);case N:case U:break;case Q:return pt.setMethodSuccessful(ft.Weather);case j:return pt.braceletdial(!1,P);case Y:return pt.setMethodSuccessful(ft.SportMode);case q:return pt.getSportMode(P);case z:return pt.measurementWithType(!0,P);case X:return pt.gPSControlCommand(P);case Z:return pt.getHistoryGpsData(P);case $:return pt.setMethodSuccessful(ft.Clear_Bracelet_data);case M:return pt.getAutoBloodOxygen(P);case E:return pt.getBloodoxygen(P);case G:return pt.setMethodSuccessful(ft.SocialdistanceSetting);case tt:return pt.setMethodSuccessful(ft.Sos);case et:return pt.getTempData(P);case at:return pt.getTempDataer(P);case nt:return pt.getQrCode(P,!1);case dt:return pt.setBoolSugarStatus(P);case St:return pt.setBoolSugarValue(P);case rt:return pt.ecgResult(P);case st:return pt.readPregnancyCycle(P);case it:return pt.getEcgHistoryData(P);case ot:return 0===P[1]?pt.setMethodSuccessful(ft.SetWomenHealth):pt.readWomenHealth(P);case ct:switch(this.hexByte2Int(P[2],0)){case 1:return pt.setMethodSuccessful(ft.ppgStartSucessed);case 2:return pt.setMethodSuccessful(ft.ppgResult);case 3:return pt.setMethodSuccessful(ft.ppgStop);case 4:return pt.setMethodSuccessful(ft.ppgMeasurementProgress);case 5:return pt.setMethodSuccessful(ft.ppgQuit);default:return pt.setMethodSuccessful(ft.ppgStartFailed)}case ut:return pt.getPPITestData(P);case ht:return pt.getHrvTimeData(P);case lt:return pt.closeDevices(P);case gt:return pt.getOffCheckStatus(P)}return pt.setMethodError(this.getBcdValue(P[0]).toString())},vt.bloodsugarWithMode=function(t,e){var a=this.generateInitValue();return a[0]=ct,a[1]=t,2!==t&&4!==t||(a[2]=e),this.crcValue(a),a},vt.getDetailSleepDataWithMode=function(t){var e=this.generateInitValue();return e[0]=_,e[1]=99===t?153:t,this.crcValue(e),e},vt.insertDateValue=function(t,e){if(e&&!(e.length<=0)){var a=e.split(" "),n=a[0],r=a[1],i=n.split("-").map(Number),c=i[0],o=i[1],s=i[2],u=r.split(":").map(Number),h=u[0],l=u[1],g=u[2];t[4]=this.getBcdValue(c-2e3),t[5]=this.getBcdValue(o),t[6]=this.getBcdValue(s),t[7]=this.getBcdValue(h),t[8]=this.getBcdValue(l),t[9]=this.getBcdValue(g)}},vt.getHRVDataWithMode=function(t,e){var a=this.generateInitValue();return a[0]=A,a[1]=99===t?153:0===t?0:1===t?1:2,this.insertDateValue(a,e),this.crcValue(a),a},vt.getPPIDDataWithMode=function(t){var e=this.generateInitValue();return e[0]=ut,e[1]=99===t?153:0===t?0:1===t?1:2,this.crcValue(e),e},vt.getHrvTestTime=function(){var t=this.generateInitValue();return t[0]=ht,t[1]=0,this.crcValue(t),t},vt.setHrvTestTime=function(t){var e=this.generateInitValue();return e[0]=ht,e[1]=1,e[2]=t,this.crcValue(e),e},vt.closeBlueDevice=function(){var t=this.generateInitValue();return t[0]=lt,this.crcValue(t),t},vt.startBloodSugar=function(){var t=this.generateInitValue();return t[0]=dt,t[1]=1,this.crcValue(t),t},vt.progressBloodSugar=function(t){var e=this.generateInitValue();return e[0]=dt,e[1]=4,e[2]=t,this.crcValue(e),e},vt.endBloodSugar=function(){var t=this.generateInitValue();return t[0]=dt,t[1]=3,this.crcValue(t),t},vt.getTotalActivityDataWithMode=function(t){var e=this.generateInitValue();return e[0]=B,e[1]=99===t?153:0===t?0:1===t?1:2,this.crcValue(e),e},vt.getTotalActivityDataWithModeForTime=function(t,e){var a=this.generateInitValue();return a[0]=B,a[1]=99===t?153:0===t?0:1===t?1:2,this.insertDateValue(a,e),this.crcValue(a),a},vt.getDetailSleepDataWithModeForTime=function(t,e){var a=this.generateInitValue();return a[0]=_,a[1]=99===t?153:t,this.insertDateValue(a,e),this.crcValue(a),a},vt.getDetailActivityDataWithModeForTime=function(t,e){var a=this.generateInitValue();return a[0]=T,a[1]=99===t?153:t,this.insertDateValue(a,e),this.crcValue(a),a},vt.getTemperature_historyDataWithMode=function(t,e){var a=this.generateInitValue();return a[0]=et,a[1]=99===t?153:t,this.insertDateValue(a,e),this.crcValue(a),a},vt.getAxillaryTemperatureDataWithMode=function(t,e){var a=this.generateInitValue();return a[0]=at,a[1]=99===t?153:0===t?0:1===t?1:2,this.insertDateValue(a,e),this.crcValue(a),a},vt.enterActivityMode=function(t,e){var a=this.generateInitValue();return a[0]=H,a[1]=e,a[2]=t,this.crcValue(a),a},vt.sendHeartPackage=function(t,e,a){var n=this.generateInitValue(),r=255&Math.floor(e/60),i=e%60&255,c=new ArrayBuffer(4);new DataView(c).setFloat32(0,t,!0);var o=Array.from(new Uint8Array(c));return n[0]=J,this.arrayCopy(o,0,n,1,o.length),n[5]=r,n[6]=i,n[7]=255&a,this.crcValue(n),n},vt.realTimeStep=function(t,e){var a=this.generateInitValue();return a[0]=o,a[1]=t?1:0,a[2]=e?1:0,this.crcValue(a),a},vt.stopGo=function(){var t=this.generateInitValue();return t[0]=o,t[1]=0,this.crcValue(t),t},vt.setPersonalInfo=function(t){var e=this.generateInitValue();return e[0]=a,e[1]=t.sex,e[2]=t.age,e[3]=t.height,e[4]=t.weight,t.stepLength&&(e[5]=t.stepLength),this.crcValue(e),e},vt.getPersonalInfo=function(){var t=this.generateInitValue();return t[0]=n,this.crcValue(t),t},vt.enterOTA=function(){var t=this.generateInitValue();return t[0]=P,this.crcValue(t),t},vt.getDeviceVersion=function(){var t=this.generateInitValue();return t[0]=g,this.crcValue(t),t},vt.reset=function(){var t=this.generateInitValue();return t[0]=d,this.crcValue(t),t},vt.getDeviceMacAddress=function(){var t=this.generateInitValue();return t[0]=l,this.crcValue(t),t},vt.getDeviceBatteryLevel=function(){var t=this.generateInitValue();return t[0]=h,this.crcValue(t),t},vt.mcuReset=function(){var t=this.generateInitValue();return t[0]=S,this.crcValue(t),t},vt.setDeviceName=function(t){var e=this.generateInitValue(),a=Math.min(t.length,14);e[0]=y;for(var n=0;n<a;n++)e[n+1]=t.charCodeAt(n);for(n=a+1;n<6;n++)e[n]=0;return this.crcValue(e),e},vt.getDeviceName=function(){var t=this.generateInitValue();t[0]=f;for(var e=1;e<6;e++)t[e]=0;return this.crcValue(t),t},vt.setDeviceTime=function(e){var a=this.generateInitValue(),n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate(),c=e.getHours(),o=e.getMinutes(),s=e.getSeconds();return a[0]=t,a[1]=this.getBcdValue(n),a[2]=this.getBcdValue(r),a[3]=this.getBcdValue(i),a[4]=this.getBcdValue(c),a[5]=this.getBcdValue(o),a[6]=this.getBcdValue(s),this.crcValue(a),a},vt.getDeviceTime=function(){var t=this.generateInitValue();return t[0]=e,this.crcValue(t),t},vt.setDeviceInfo=function(t){var e=this.generateInitValue();return e[0]=r,e[1]=t.DistanceUnit?129:128,e[2]=t.is12Hour?129:128,e[3]=t.Hand_up_light_screen_switch?129:128,e[4]=t.Fahrenheit?128:129,e[5]=t.Nightmode?129:128,e[6]=128,e[9]=128+t.baseheart,e[11]=128+t.screenBrightness,e[12]=128+t.indexDial,e[14]=128+t.languages,this.crcValue(e),e},vt.healthMeasurementWithDataType=function(t,e){this.StartDeviceMeasurementWithType=e;var a=this.generateInitValue();return a[0]=z,a[1]=t,a[2]=e?1:0,this.crcValue(a),a},vt.setBraceletdial=function(t){this.isRuning=!0;var e=this.generateInitValue();return e[0]=j,e[1]=t,this.crcValue(e),e},vt.setAutomaticHRMonitoring=function(t){var e=this.generateInitValue(),a=t.time;return e[0]=v,e[1]=t.open,e[2]=this.getBcdValue(t.startHour),e[3]=this.getBcdValue(t.startMinute),e[4]=this.getBcdValue(t.endHour),e[5]=this.getBcdValue(t.endMinute),e[6]=t.week,e[7]=255&a,e[8]=a>>8&255,e[9]=t.type,this.crcValue(e),e},vt.getAutomaticHRMonitoring=function(t){var e=this.generateInitValue();return e[0]=p,e[1]=t,this.crcValue(e),e},vt.getActivityModeDataWithMode=function(t){var e=this.generateInitValue();return e[0]=b,e[1]=t,this.crcValue(e),e},vt.getStaticHRWithMode=function(t,e){var a=this.generateInitValue();return a[0]=x,a[1]=t,this.insertDateValue(a,e),this.crcValue(a),a},vt.getDynamicHRWithMode=function(t,e){var a=this.generateInitValue();return a[0]=V,a[1]=t,this.insertDateValue(a,e),this.crcValue(a),a},vt.getBloodOxygen=function(t,e){var a=this.generateInitValue();return a[0]=E,a[1]=t,this.insertDateValue(a,e),this.crcValue(a),a},vt.getAutoBloodOxygen=function(t,e){var a=this.generateInitValue();return a[0]=M,a[1]=t,this.insertDateValue(a,e),this.crcValue(a),a},vt.setStepGoal=function(t,e,a,n,r){var i=this.generateInitValue();return i[0]=s,i[4]=t>>24&255,i[3]=t>>16&255,i[2]=t>>8&255,i[1]=255&t,i[6]=e>>8&255,i[5]=255&e,i[8]=a>>8&255,i[7]=255&a,i[10]=n>>8&255,i[9]=255&n,i[12]=r>>8&255,i[11]=255&r,this.crcValue(i),i},vt.GetStepGoal=function(){var t=this.generateInitValue();return t[0]=u,this.crcValue(t),t},vt.getDeviceInfo=function(){var t=this.generateInitValue();return t[0]=i,this.crcValue(t),t},vt.sendHex=function(t,e){var a=function(t,e,a){if(a||2===arguments.length)for(var n,r=0,i=e.length;r<i;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))}([],t,!0);return e&&this.crcDynamicValue(a),a},vt.getAlarmClock=function(){var t=this.generateInitValue();return t[0]=C,this.crcValue(t),t},vt.deleteAllAlarmClock=function(){var t=this.generateInitValue();return t[0]=C,t[1]=153,this.crcValue(t),t},vt.setAlarmClock=function(t){var e=this,a=[],n=39*t.length+2;if(n>128)for(var r=Math.floor(128/39),i=Math.ceil(t.length/r),c=0;c<i;c++){for(var o=c===i-1,s=o?t.length-r*c:r,u=new Array(39*s+(o?2:0)).fill(0),h=0;h<s;h++){var l=t[r*c+h],g=l.openOrClose,d=l.clockType,S=l.clockTime,D=l.week,y=l.textLength,f=l.text,v=39*h;u[v]=35,u[v+1]=t.length,u[v+2]=r*c+h,u[v+3]=g,u[v+4]=d,u[v+5]=this.getBcdValue(S.substring(0,2)),u[v+6]=this.getBcdValue(S.substring(3,5)),u[v+7]=D,u[v+8]=y;for(var p=0;p<y;p++)u[v+9+p]=f.charCodeAt(p)||0}o&&(u[u.length-2]=35,u[u.length-1]=255),a.push(u)}else{var m=new Array(n).fill(0);t.forEach(function(a,n){var r=a.openOrClose,i=a.clockType,c=a.clockTime,o=a.week,s=a.textLength,u=a.text,h=39*n;m[h]=35,m[h+1]=t.length,m[h+2]=n,m[h+3]=r,m[h+4]=i,m[h+5]=e.getBcdValue(c.substring(0,2)),m[h+6]=e.getBcdValue(c.substring(3,5)),m[h+7]=o,m[h+8]=s;for(var l=0;l<s;l++)m[h+9+l]=u.charCodeAt(l)||0}),m[n-2]=35,m[n-1]=255,a.push(m)}return a},vt.getSedentaryReminder=function(){var t=this.generateInitValue();return t[0]=yt,this.crcValue(t),t},vt.setSedentaryReminder=function(t){var e=this.generateInitValue();e[0]=Dt,e[1]=this.getBcdValue(t.startTime_Hour),e[2]=this.getBcdValue(t.startTime_Minutes),e[3]=this.getBcdValue(t.endTime_Hour),e[4]=this.getBcdValue(t.endTime_Minutes);var a=(t.weeks.sunday?1:0)+(t.weeks.monday?2:0)+(t.weeks.Tuesday?4:0)+(t.weeks.Wednesday?8:0)+(t.weeks.Thursday?16:0)+(t.weeks.Friday?32:0)+(t.weeks.Saturday?64:0);return e[5]=a,e[6]=t.intervalTime,e[7]=t.leastSteps,e[8]=t.mode,this.crcValue(e),e},vt.DATA_READ_START=0,vt.DATA_READ_CONTINUE=2,vt.DATA_DELETE=99,vt.DistanceMode_MILE=129,vt.DistanceMode_KM=128,vt.TimeMode_12h=129,vt.TimeMode_24h=128,vt.WristOn_Enable=129,vt.WristOn_DisEnable=128,vt.TempUnit_C=128,vt.TempUnit_F=129,vt.TAG="BleSDK",vt.isRuning=!1,vt.ecgopen=!1,vt.read=!1,vt.pregnancyCycleRead=!1,vt.isSettingSocial=!1,vt.StartDeviceMeasurementWithType=!1,vt}();exports.BleConst=ft,exports.BleSDK=mt,exports.DeviceKey=vt,exports.ResolveUtil=pt;
|
|
2
|
+
//# sourceMappingURL=index.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.min.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|