From 7d90093c39198314987d4e745478811eb3b1346f Mon Sep 17 00:00:00 2001 From: Michael Pohl Date: Sat, 9 Jul 2022 11:14:50 +0200 Subject: [PATCH] add more unknown devices + unknwn distributor --- src/Device/CycplusDeviceTrait.php | 22 +++++++++ src/Device/CycplusM1.php | 32 +++++++++++++ src/Device/CycplusM2.php | 32 +++++++++++++ src/Device/DabuziduoDeviceTrait.php | 22 +++++++++ src/Device/DabuziduoXossGN3.php | 32 +++++++++++++ src/Device/DabuziduoXossGN4.php | 32 +++++++++++++ src/Device/DeviceProfile.php | 30 ++++++++++++ src/Device/FitcareBC200.php | 33 +++++++++++++ src/Device/FitcareDeviceTrait.php | 22 +++++++++ src/Device/GarminD2DeltaS.php | 27 +++++++++++ src/Device/GarminForerunner255.php | 27 +++++++++++ src/Device/GarminForerunner255S.php | 27 +++++++++++ .../GarminInstinct2SolarOnePieceLuffy.php | 32 +++++++++++++ src/Device/SuuntoD4I.php | 27 +++++++++++ src/Distributor/Cycplus.php | 31 +++++++++++++ src/Distributor/Dabuziduo.php | 31 +++++++++++++ src/Distributor/DistributorProfile.php | 9 ++++ src/Mapping/CycplusFitSdkMapping.php | 46 +++++++++++++++++++ src/Mapping/DabuziduoFitSdkMapping.php | 46 +++++++++++++++++++ src/Mapping/FitMapping.php | 12 +++++ src/Mapping/FitcareFitSdkMapping.php | 45 ++++++++++++++++++ src/Mapping/GarminFitSdkMapping.php | 5 ++ src/Mapping/HammerheadFitSdkMapping.php | 45 ++++++++++++++++++ src/Mapping/PolarFitSdkMapping.php | 10 ++++ src/Mapping/SuuntoFitSdkMapping.php | 1 + 25 files changed, 678 insertions(+) create mode 100644 src/Device/CycplusDeviceTrait.php create mode 100644 src/Device/CycplusM1.php create mode 100644 src/Device/CycplusM2.php create mode 100644 src/Device/DabuziduoDeviceTrait.php create mode 100644 src/Device/DabuziduoXossGN3.php create mode 100644 src/Device/DabuziduoXossGN4.php create mode 100644 src/Device/FitcareBC200.php create mode 100644 src/Device/FitcareDeviceTrait.php create mode 100644 src/Device/GarminD2DeltaS.php create mode 100644 src/Device/GarminForerunner255.php create mode 100644 src/Device/GarminForerunner255S.php create mode 100644 src/Device/GarminInstinct2SolarOnePieceLuffy.php create mode 100644 src/Device/SuuntoD4I.php create mode 100644 src/Distributor/Cycplus.php create mode 100644 src/Distributor/Dabuziduo.php create mode 100644 src/Mapping/CycplusFitSdkMapping.php create mode 100644 src/Mapping/DabuziduoFitSdkMapping.php create mode 100644 src/Mapping/FitcareFitSdkMapping.php create mode 100644 src/Mapping/HammerheadFitSdkMapping.php diff --git a/src/Device/CycplusDeviceTrait.php b/src/Device/CycplusDeviceTrait.php new file mode 100644 index 0000000..2967db0 --- /dev/null +++ b/src/Device/CycplusDeviceTrait.php @@ -0,0 +1,22 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +use Runalyze\Devices\Distributor\DistributorProfile; + +trait CycplusDeviceTrait +{ + public function getDistributorEnum() + { + return DistributorProfile::CYCPLUS; + } +} diff --git a/src/Device/CycplusM1.php b/src/Device/CycplusM1.php new file mode 100644 index 0000000..2def78b --- /dev/null +++ b/src/Device/CycplusM1.php @@ -0,0 +1,32 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +class CycplusM1 extends AbstractDevice +{ + use BrytonDeviceTrait; + + public function getEnum() + { + return DeviceProfile::CYCPLUS_M1; + } + + public function getName() + { + return 'M1'; + } + + public function hasBarometer() + { + return true; + } +} diff --git a/src/Device/CycplusM2.php b/src/Device/CycplusM2.php new file mode 100644 index 0000000..cb5a5e4 --- /dev/null +++ b/src/Device/CycplusM2.php @@ -0,0 +1,32 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +class CycplusM2 extends AbstractDevice +{ + use BrytonDeviceTrait; + + public function getEnum() + { + return DeviceProfile::CYCPLUS_M2; + } + + public function getName() + { + return 'M2'; + } + + public function hasBarometer() + { + return true; + } +} diff --git a/src/Device/DabuziduoDeviceTrait.php b/src/Device/DabuziduoDeviceTrait.php new file mode 100644 index 0000000..3cbec68 --- /dev/null +++ b/src/Device/DabuziduoDeviceTrait.php @@ -0,0 +1,22 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +use Runalyze\Devices\Distributor\DistributorProfile; + +trait DabuziduoDeviceTrait +{ + public function getDistributorEnum() + { + return DistributorProfile::DABUZIDUO; + } +} diff --git a/src/Device/DabuziduoXossGN3.php b/src/Device/DabuziduoXossGN3.php new file mode 100644 index 0000000..2359598 --- /dev/null +++ b/src/Device/DabuziduoXossGN3.php @@ -0,0 +1,32 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +class DabuziduoXossGN3 extends AbstractDevice +{ + use DabuziduoDeviceTrait; + + public function getEnum() + { + return DeviceProfile::DABUZIDUO_XOSS_G_N_3; + } + + public function getName() + { + return 'XOSS G N3'; + } + + public function hasBarometer() + { + return true; + } +} diff --git a/src/Device/DabuziduoXossGN4.php b/src/Device/DabuziduoXossGN4.php new file mode 100644 index 0000000..b3bc07e --- /dev/null +++ b/src/Device/DabuziduoXossGN4.php @@ -0,0 +1,32 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +class DabuziduoXossGN4 extends AbstractDevice +{ + use DabuziduoDeviceTrait; + + public function getEnum() + { + return DeviceProfile::DABUZIDUO_XOSS_G_N_4; + } + + public function getName() + { + return 'XOSS G N4'; + } + + public function hasBarometer() + { + return true; + } +} diff --git a/src/Device/DeviceProfile.php b/src/Device/DeviceProfile.php index 4d5a1e2..00a579a 100644 --- a/src/Device/DeviceProfile.php +++ b/src/Device/DeviceProfile.php @@ -1673,4 +1673,34 @@ class DeviceProfile extends AbstractEnum /** @var int */ const GARMIN_EDGE_1040_SOLAR = 550; + + /** @var int */ + const GARMIN_FORERUNNER_255 = 551; + + /** @var int */ + const GARMIN_FORERUNNER_255_S = 552; + + /** @var int */ + const GARMIN_INSTINCT_2_SOLAR_ONE_PIECE_LUFFY = 553; + + /** @var int */ + const CYCPLUS_M1 = 554; + + /** @var int */ + const CYCPLUS_M2 = 555; + + /** @var int */ + const DABUZIDUO_XOSS_G_N_3 = 556; + + /** @var int */ + const DABUZIDUO_XOSS_G_N_4 = 557; + + /** @var int */ + const SUUNTO_D_4_I = 558; + + /** @var int */ + const FITCARE_B_C_200 = 559; + + /** @var int */ + const GARMIN_D_2_DELTA_S = 560; } diff --git a/src/Device/FitcareBC200.php b/src/Device/FitcareBC200.php new file mode 100644 index 0000000..74e9503 --- /dev/null +++ b/src/Device/FitcareBC200.php @@ -0,0 +1,33 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +class FitcareBC200 extends AbstractDevice +{ + use FitcareDeviceTrait; + + public function getEnum() + { + return DeviceProfile::FITCARE_B_C_200; + } + + public function getName() + { + return 'BC200'; + } + + public function hasBarometer() + { + //Not sure + return false; + } +} diff --git a/src/Device/FitcareDeviceTrait.php b/src/Device/FitcareDeviceTrait.php new file mode 100644 index 0000000..bbf2621 --- /dev/null +++ b/src/Device/FitcareDeviceTrait.php @@ -0,0 +1,22 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +use Runalyze\Devices\Distributor\DistributorProfile; + +trait FitcareDeviceTrait +{ + public function getDistributorEnum() + { + return DistributorProfile::FITCARE; + } +} diff --git a/src/Device/GarminD2DeltaS.php b/src/Device/GarminD2DeltaS.php new file mode 100644 index 0000000..4f74810 --- /dev/null +++ b/src/Device/GarminD2DeltaS.php @@ -0,0 +1,27 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +class GarminD2DeltaS extends AbstractDevice +{ + use GarminDeviceTrait; + + public function getEnum() + { + return DeviceProfile::GARMIN_D_2_DELTA_S; + } + + public function getName() + { + return 'D2 Delta S'; + } +} diff --git a/src/Device/GarminForerunner255.php b/src/Device/GarminForerunner255.php new file mode 100644 index 0000000..7cd1319 --- /dev/null +++ b/src/Device/GarminForerunner255.php @@ -0,0 +1,27 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +class GarminForerunner255 extends AbstractDevice +{ + use GarminDeviceTrait; + + public function getEnum() + { + return DeviceProfile::GARMIN_FORERUNNER_255; + } + + public function getName() + { + return 'Forerunner 255'; + } +} diff --git a/src/Device/GarminForerunner255S.php b/src/Device/GarminForerunner255S.php new file mode 100644 index 0000000..1767ff5 --- /dev/null +++ b/src/Device/GarminForerunner255S.php @@ -0,0 +1,27 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +class GarminForerunner255S extends AbstractDevice +{ + use GarminDeviceTrait; + + public function getEnum() + { + return DeviceProfile::GARMIN_FORERUNNER_255_S; + } + + public function getName() + { + return 'Forerunner 255S'; + } +} diff --git a/src/Device/GarminInstinct2SolarOnePieceLuffy.php b/src/Device/GarminInstinct2SolarOnePieceLuffy.php new file mode 100644 index 0000000..8a7f21a --- /dev/null +++ b/src/Device/GarminInstinct2SolarOnePieceLuffy.php @@ -0,0 +1,32 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +class GarminInstinct2SolarOnePieceLuffy extends AbstractDevice +{ + use GarminDeviceTrait; + + public function getEnum() + { + return DeviceProfile::GARMIN_INSTINCT_2_SOLAR_ONE_PIECE_LUFFY; + } + + public function getName() + { + return 'Instinct Solar'; + } + + public function hasBarometer() + { + return true; + } +} diff --git a/src/Device/SuuntoD4I.php b/src/Device/SuuntoD4I.php new file mode 100644 index 0000000..2569b6a --- /dev/null +++ b/src/Device/SuuntoD4I.php @@ -0,0 +1,27 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Device; + +class SuuntoD4I extends AbstractDevice +{ + use SuuntoDeviceTrait; + + public function getEnum() + { + return DeviceProfile::SUUNTO_D_4_I; + } + + public function getName() + { + return 'D4i'; + } +} diff --git a/src/Distributor/Cycplus.php b/src/Distributor/Cycplus.php new file mode 100644 index 0000000..c0fb66b --- /dev/null +++ b/src/Distributor/Cycplus.php @@ -0,0 +1,31 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Distributor; + +class Cycplus extends AbstractDistributor +{ + public function getEnum() + { + return DistributorProfile::CYCPLUS; + } + + public function getName() + { + return 'Cycplus'; + } + + public function getDeviceEnumList() + { + return [ + ]; + } +} diff --git a/src/Distributor/Dabuziduo.php b/src/Distributor/Dabuziduo.php new file mode 100644 index 0000000..f04cb99 --- /dev/null +++ b/src/Distributor/Dabuziduo.php @@ -0,0 +1,31 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Distributor; + +class Dabuziduo extends AbstractDistributor +{ + public function getEnum() + { + return DistributorProfile::DABUZIDUO; + } + + public function getName() + { + return 'Dabuziduo'; + } + + public function getDeviceEnumList() + { + return [ + ]; + } +} diff --git a/src/Distributor/DistributorProfile.php b/src/Distributor/DistributorProfile.php index 6fa8bac..c1969ee 100644 --- a/src/Distributor/DistributorProfile.php +++ b/src/Distributor/DistributorProfile.php @@ -125,4 +125,13 @@ class DistributorProfile extends AbstractEnum /** @var int */ const KIPRUN = 38; + + /** @var int */ + const CYCPLUS = 39; + + /** @var int */ + const DABUZIDUO = 40; + + /** @var int */ + const FITCARE = 41; } diff --git a/src/Mapping/CycplusFitSdkMapping.php b/src/Mapping/CycplusFitSdkMapping.php new file mode 100644 index 0000000..a54101a --- /dev/null +++ b/src/Mapping/CycplusFitSdkMapping.php @@ -0,0 +1,46 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Mapping; + +use Runalyze\Devices\Device\DeviceProfile; + +class CycplusFitSdkMapping +{ + /** @var int[]|string[] */ + protected $Mapping = []; + + protected function getMapping() + { + return [ + 1711 => DeviceProfile::CYCPLUS_M1, + 2104 => DeviceProfile::CYCPLUS_M2, + ]; + } + + public function __construct() + { + $this->Mapping = $this->getMapping(); + } + + /** + * @param int|string $value + * @return int|string + */ + public function toInternal($value) + { + if (isset($this->Mapping[$value])) { + return $this->Mapping[$value]; + } + + return; + } +} diff --git a/src/Mapping/DabuziduoFitSdkMapping.php b/src/Mapping/DabuziduoFitSdkMapping.php new file mode 100644 index 0000000..587c592 --- /dev/null +++ b/src/Mapping/DabuziduoFitSdkMapping.php @@ -0,0 +1,46 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Mapping; + +use Runalyze\Devices\Device\DeviceProfile; + +class DabuziduoFitSdkMapping +{ + /** @var int[]|string[] */ + protected $Mapping = []; + + protected function getMapping() + { + return [ + 11 => DeviceProfile::DABUZIDUO_XOSS_G_N_3, + 10 => DeviceProfile::DABUZIDUO_XOSS_G_N_4, + ]; + } + + public function __construct() + { + $this->Mapping = $this->getMapping(); + } + + /** + * @param int|string $value + * @return int|string + */ + public function toInternal($value) + { + if (isset($this->Mapping[$value])) { + return $this->Mapping[$value]; + } + + return; + } +} diff --git a/src/Mapping/FitMapping.php b/src/Mapping/FitMapping.php index 6e82b11..aceb21b 100644 --- a/src/Mapping/FitMapping.php +++ b/src/Mapping/FitMapping.php @@ -27,6 +27,9 @@ public static function guessDevice($manufactorId, $productId) case 294: return (new CorosFitSdkMapping())->toInternal($productId); break; + case 289: + return (new HammerheadFitSdkMapping())->toInternal($productId); + break; case 32: return (new WahooFitSdkMapping())->toInternal($productId); break; @@ -87,6 +90,15 @@ public static function guessDevice($manufactorId, $productId) case 123: return (new PolarFitSdkMapping())->toInternal($productId); break; + case 292: + return (new DabuziduoFitSdkMapping())->toInternal($productId); + break; + case 106: + return (new FitcareFitSdkMapping())->toInternal($productId); + break; + case 132: + return (new CycplusFitSdkMapping())->toInternal($productId); + break; case 309: return DeviceProfile::FORM_SMART_SWIM_GOGGLES; break; diff --git a/src/Mapping/FitcareFitSdkMapping.php b/src/Mapping/FitcareFitSdkMapping.php new file mode 100644 index 0000000..20a7cf8 --- /dev/null +++ b/src/Mapping/FitcareFitSdkMapping.php @@ -0,0 +1,45 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Mapping; + +use Runalyze\Devices\Device\DeviceProfile; + +class FitcareFitSdkMapping +{ + /** @var int[]|string[] */ + protected $Mapping = []; + + protected function getMapping() + { + return [ + 51422 => DeviceProfile::FITCARE_B_C_200, + ]; + } + + public function __construct() + { + $this->Mapping = $this->getMapping(); + } + + /** + * @param int|string $value + * @return int|string + */ + public function toInternal($value) + { + if (isset($this->Mapping[$value])) { + return $this->Mapping[$value]; + } + + return; + } +} diff --git a/src/Mapping/GarminFitSdkMapping.php b/src/Mapping/GarminFitSdkMapping.php index 47dad7a..a50bdba 100644 --- a/src/Mapping/GarminFitSdkMapping.php +++ b/src/Mapping/GarminFitSdkMapping.php @@ -43,6 +43,7 @@ protected function getMapping() 4005 => DeviceProfile::GARMIN_DESCENT_G_1, 2187 => DeviceProfile::GARMIN_D_2_AIR, 3198 => DeviceProfile::GARMIN_D_2_DELTA_P_X, + 3196 => DeviceProfile::GARMIN_D_2_DELTA_S, 2262 => DeviceProfile::GARMIN_D_2_BRAVO, 2547 => DeviceProfile::GARMIN_D_2_BRAVO_TITANIUM, 2819 => DeviceProfile::GARMIN_D_2_CHARLIE, @@ -216,6 +217,8 @@ protected function getMapping() 3321 => DeviceProfile::GARMIN_FORERUNNER_245_MUSIC, 3077 => DeviceProfile::GARMIN_FORERUNNER_245_MUSIC, 3913 => DeviceProfile::GARMIN_FORERUNNER_245_MUSIC, + 3992 => DeviceProfile::GARMIN_FORERUNNER_255, + 3993 => DeviceProfile::GARMIN_FORERUNNER_255_S, 473 => DeviceProfile::GARMIN_FORERUNNER_301, 474 => DeviceProfile::GARMIN_FORERUNNER_301, 475 => DeviceProfile::GARMIN_FORERUNNER_301, @@ -264,8 +267,10 @@ protected function getMapping() 4024 => DeviceProfile::GARMIN_FORERUNNER_955_SOLAR, 3126 => DeviceProfile::GARMIN_INSTINCT, 3889 => DeviceProfile::GARMIN_INSTINCT_2_S, + 4091 => DeviceProfile::GARMIN_INSTINCT_2_S, 3466 => DeviceProfile::GARMIN_INSTINCT_SOLAR, 3778 => DeviceProfile::GARMIN_INSTINCT_SOLAR, + 4071 => DeviceProfile::GARMIN_INSTINCT_2_SOLAR_ONE_PIECE_LUFFY, 3498 => DeviceProfile::GARMIN_LEGACY_SAGA_REY, 3499 => DeviceProfile::GARMIN_LEGACY_SAGA_DARTH_VADER, 3809 => DeviceProfile::GARMIN_LILY, diff --git a/src/Mapping/HammerheadFitSdkMapping.php b/src/Mapping/HammerheadFitSdkMapping.php new file mode 100644 index 0000000..15891e1 --- /dev/null +++ b/src/Mapping/HammerheadFitSdkMapping.php @@ -0,0 +1,45 @@ + + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace Runalyze\Devices\Mapping; + +use Runalyze\Devices\Device\DeviceProfile; + +class HammerheadFitSdkMapping +{ + /** @var int[]|string[] */ + protected $Mapping = []; + + protected function getMapping() + { + return [ + 2 => DeviceProfile::HAMMERHEAD_KAROO_2, + ]; + } + + public function __construct() + { + $this->Mapping = $this->getMapping(); + } + + /** + * @param int|string $value + * @return int|string + */ + public function toInternal($value) + { + if (isset($this->Mapping[$value])) { + return $this->Mapping[$value]; + } + + return; + } +} diff --git a/src/Mapping/PolarFitSdkMapping.php b/src/Mapping/PolarFitSdkMapping.php index ad70e40..285d20a 100644 --- a/src/Mapping/PolarFitSdkMapping.php +++ b/src/Mapping/PolarFitSdkMapping.php @@ -22,12 +22,21 @@ protected function getMapping() { return [ 13 => DeviceProfile::POLAR_V_800, + 19 => DeviceProfile::POLAR_V_650, 22 => DeviceProfile::POLAR_M_400, + 85 => DeviceProfile::POLAR_A_300, + 91 => DeviceProfile::POLAR_PACER_PRO, + 106 => DeviceProfile::POLAR_M_450, + 110 => DeviceProfile::POLAR_A_360, + 122 => DeviceProfile::POLAR_M_600, + 123 => DeviceProfile::POLAR_M_200, 151 => DeviceProfile::POLAR_O_H_1, 163 => DeviceProfile::POLAR_M_430, + 166 => DeviceProfile::POLAR_A_370, 172 => DeviceProfile::POLAR_M_460, 203 => DeviceProfile::POLAR_VANTAGE_V, 209 => DeviceProfile::POLAR_VANTAGE_M, + 216 => DeviceProfile::POLAR_IGNITE, 217 => DeviceProfile::POLAR_GRIT_X, 225 => DeviceProfile::POLAR_UNITE, 230 => DeviceProfile::POLAR_VANTAGE_V_2, @@ -35,6 +44,7 @@ protected function getMapping() 236 => DeviceProfile::POLAR_VANTAGE_M_2, 241 => DeviceProfile::POLAR_IGNITE_2, 251 => DeviceProfile::POLAR_GRIT_X_PRO, + 256 => DeviceProfile::POLAR_PACER, 261 => DeviceProfile::POLAR_PACER_PRO, ]; } diff --git a/src/Mapping/SuuntoFitSdkMapping.php b/src/Mapping/SuuntoFitSdkMapping.php index bcfe0bd..5bb33ba 100644 --- a/src/Mapping/SuuntoFitSdkMapping.php +++ b/src/Mapping/SuuntoFitSdkMapping.php @@ -64,6 +64,7 @@ protected function getMapping() 40 => DeviceProfile::SUUNTO_7, 41 => DeviceProfile::SUUNTO_EON_STEEL, 42 => DeviceProfile::SUUNTO_9_PEAK, + 46 => DeviceProfile::SUUNTO_D_4_I, 52 => DeviceProfile::SUUNTO_VYPER_NOVO, 53 => DeviceProfile::SUUNTO_ZOOP_NOVO, 56 => DeviceProfile::SUUNTO_5_PEAK,