From df1e87639ceadad399bc251a4acc6cb02a5faf4e Mon Sep 17 00:00:00 2001 From: Foxushka <135865149+Foxushka@users.noreply.github.com> Date: Sun, 27 Aug 2023 21:39:51 +0300 Subject: [PATCH 1/2] Change Chameleon Lite PID to 0x8787 --- firmware/application/src/sdk_config.h | 2 +- firmware/common/device_info.h | 2 ++ .../driver/79-chameleon-usb-device-blacklist-dialout.rules | 4 +++- resource/tools/enter_dfu.py | 2 +- software/script/chameleon_cli_unit.py | 4 ++-- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/firmware/application/src/sdk_config.h b/firmware/application/src/sdk_config.h index 3ee011fd..e1f3aa0b 100644 --- a/firmware/application/src/sdk_config.h +++ b/firmware/application/src/sdk_config.h @@ -6420,7 +6420,7 @@ // Selected Product ID #ifndef APP_USBD_PID -#define APP_USBD_PID 0x8686 +#define APP_USBD_PID DEVICE_PID #endif // APP_USBD_DEVICE_VER_MAJOR - Major device version <0-99> diff --git a/firmware/common/device_info.h b/firmware/common/device_info.h index 3de6c22e..9cc8d37e 100644 --- a/firmware/common/device_info.h +++ b/firmware/common/device_info.h @@ -5,9 +5,11 @@ #if defined(PROJECT_CHAMELEON_ULTRA) #define DEVICE_NAME_STR "ChameleonUltra" #define DEVICE_NAME_STR_SHORT "CU" +#define DEVICE_PID 0x8686 #elif defined(PROJECT_CHAMELEON_LITE) #define DEVICE_NAME_STR "ChameleonLite" #define DEVICE_NAME_STR_SHORT "CL" +#define DEVICE_PID 0x8787 #else #error "Unknown device name?" #endif diff --git a/resource/driver/79-chameleon-usb-device-blacklist-dialout.rules b/resource/driver/79-chameleon-usb-device-blacklist-dialout.rules index 67e3697a..a17eedc0 100644 --- a/resource/driver/79-chameleon-usb-device-blacklist-dialout.rules +++ b/resource/driver/79-chameleon-usb-device-blacklist-dialout.rules @@ -11,8 +11,10 @@ ACTION!="add|change", GOTO="chameleon_usb_device_blacklist_end" SUBSYSTEM!="tty", GOTO="chameleon_ignore" ATTRS{idVendor}=="6868" ATTRS{idProduct}=="8686", ENV{ID_MM_DEVICE_IGNORE}="1" SYMLINK+="ultra-%n" MODE="660" GROUP="dialout" +ATTRS{idVendor}=="6868" ATTRS{idProduct}=="8787", ENV{ID_MM_DEVICE_IGNORE}="1" SYMLINK+="lite-%n" MODE="660" GROUP="dialout" + LABEL="chameleon_ignore" ATTRS{idVendor}=="2d2d" ATTRS{idProduct}=="504d", ENV{ID_MM_DEVICE_IGNORE}="1" -LABEL="chameleon_usb_device_blacklist_end" \ No newline at end of file +LABEL="chameleon_usb_device_blacklist_end" diff --git a/resource/tools/enter_dfu.py b/resource/tools/enter_dfu.py index 2b11cb3a..c34dac0b 100755 --- a/resource/tools/enter_dfu.py +++ b/resource/tools/enter_dfu.py @@ -10,7 +10,7 @@ if comport.vid == 0x1915 and comport.pid == 0x521f: print("Chameleon already in DFU mode") exit(0) - if comport.vid == 0x6868 and comport.pid == 0x8686: + if comport.vid == 0x6868 and (comport.pid == 0x8686 or comport.pid == 0x8787): port = comport.device break diff --git a/software/script/chameleon_cli_unit.py b/software/script/chameleon_cli_unit.py index 28059baf..a6b99ccb 100644 --- a/software/script/chameleon_cli_unit.py +++ b/software/script/chameleon_cli_unit.py @@ -210,10 +210,10 @@ def on_exec(self, args: argparse.Namespace): break if PSHEXE: # process = subprocess.Popen([PSHEXE,"Get-CimInstance -ClassName Win32_serialport |" - # " Where-Object {$_.PNPDeviceID -like '*VID_6868&PID_8686*'} |" + # " Where-Object {$_.PNPDeviceID -like '*VID_6868&PID_*'} |" # " Select -expandproperty DeviceID"],stdout=subprocess.PIPE); process = subprocess.Popen([PSHEXE, "Get-PnPDevice -Class Ports -PresentOnly |" - " where {$_.DeviceID -like '*VID_6868&PID_8686*'} |" + " where {$_.DeviceID -like '*VID_6868&PID_*'} |" " Select-Object -First 1 FriendlyName |" " % FriendlyName |" " select-string COM\d+ |" From 8af5bcd22a634f3dc134dff1d484e023d916c43d Mon Sep 17 00:00:00 2001 From: Foxushka <135865149+Foxushka@users.noreply.github.com> Date: Sun, 27 Aug 2023 18:46:22 +0000 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bdd3e3ce..879f44af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] + - Changed Chameleon Lite PID to `0x8787` (@Foxushka) - Security BLE implemented (@xianglin1998) - Added `hw settings blekey` to get and set ble connect key (@xianglin1998) - Added `hw ble bonds clear` to delete all ble bonds (@xianglin1998)