@onekeyfe/hd-web-sdk 0.0.6 → 0.0.7

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.
@@ -5006,6 +5006,24 @@ const getDeviceType = features => {
5006
5006
  const serialNo = features.serial_no;
5007
5007
  const miniFlag = serialNo.slice(0, 2);
5008
5008
  if (miniFlag.toLowerCase() === 'mi') return 'mini';
5009
+ if (miniFlag.toLowerCase() === 'tc') return 'touch';
5010
+ return 'classic';
5011
+ };
5012
+
5013
+ const getDeviceTypeByBleName = name => {
5014
+ if (!name) return 'classic';
5015
+ if (name.startsWith('MI')) return 'mini';
5016
+ if (name.startsWith('T')) return 'touch';
5017
+ return 'classic';
5018
+ };
5019
+
5020
+ const getDeviceTypeByDeviceId = deviceId => {
5021
+ if (!deviceId) {
5022
+ return 'classic';
5023
+ }
5024
+
5025
+ const miniFlag = deviceId.slice(0, 2);
5026
+ if (miniFlag.toLowerCase() === 'mi') return 'mini';
5009
5027
  return 'classic';
5010
5028
  };
5011
5029
 
@@ -14837,10 +14855,14 @@ class SearchDevices extends BaseMethod {
14837
14855
  const env = DataManager.getSettings('env');
14838
14856
 
14839
14857
  if (env === 'react-native') {
14840
- return devicesDescriptor.map(device => Object.assign(Object.assign({}, device), {
14841
- connectId: device.id,
14842
- deviceType: 'classic'
14843
- }));
14858
+ return devicesDescriptor.map(device => {
14859
+ var _a;
14860
+
14861
+ return Object.assign(Object.assign({}, device), {
14862
+ connectId: device.id,
14863
+ deviceType: getDeviceTypeByBleName((_a = device.name) !== null && _a !== void 0 ? _a : '')
14864
+ });
14865
+ });
14844
14866
  }
14845
14867
 
14846
14868
  const devices = [];
@@ -17636,6 +17658,8 @@ exports.ZP = HardwareSdk;
17636
17658
  exports.yI = enableLog;
17637
17659
  __webpack_unused_export__ = getDeviceLabel;
17638
17660
  __webpack_unused_export__ = getDeviceType;
17661
+ __webpack_unused_export__ = getDeviceTypeByBleName;
17662
+ __webpack_unused_export__ = getDeviceTypeByDeviceId;
17639
17663
  __webpack_unused_export__ = getDeviceUUID;
17640
17664
  __webpack_unused_export__ = getEnv;
17641
17665
  __webpack_unused_export__ = getHDPath;
@@ -17895,6 +17919,7 @@ const MESSAGE_TOP_CHAR = 0x003f;
17895
17919
  const MESSAGE_HEADER_BYTE = 0x23;
17896
17920
  const HEADER_SIZE = 1 + 1 + 4 + 2;
17897
17921
  const BUFFER_SIZE = 63;
17922
+ const COMMON_HEADER_SIZE = 6;
17898
17923
 
17899
17924
  const readHeader = buffer => {
17900
17925
  const typeId = buffer.readUint16();
@@ -18663,6 +18688,7 @@ var index = {
18663
18688
  parseConfigure
18664
18689
  };
18665
18690
  exports.BUFFER_SIZE = BUFFER_SIZE;
18691
+ exports.COMMON_HEADER_SIZE = COMMON_HEADER_SIZE;
18666
18692
  exports.HEADER_SIZE = HEADER_SIZE;
18667
18693
  exports.MESSAGE_HEADER_BYTE = MESSAGE_HEADER_BYTE;
18668
18694
  exports.MESSAGE_TOP_CHAR = MESSAGE_TOP_CHAR;