새로운 '하트비트' 기능은 Android 9 및 이전 버전의 연결 문제를 해결합니다.
HDS가 수신할 수 있는 명령(v2.5.8)
03 0F TARE (체크섬 포함)
(하트비트 기능에 관한 위의 안내를 읽어 주시기 바랍니다)
03 0A 00 Turn off oled
03 0A 01 Turn on oled
(하트비트 기능에 관한 위의 안내를 읽어 주시기 바랍니다)
03 0A 02 Power off
03 0A 03 00 Exit power mode, normal oled brightness
03 0A 03 01 Enter power mode, lowest oled brightness
03 0B 00 Timer stop
03 0B 02 Timer reset
03 0B 03 Timer start
03 1A 00 Manual Calibration
03 1A 01 Smart Calibration
03 1B WiFi OTA
03 1D 00 Set sample to 1
03 1D 01 Set sample to 2
03 1D 02 Set sample to 4
03 1E 00 00 Hide Menu
03 1E 00 01 Show Menu
03 1E 01 00 Hide About info
03 1E 01 01 Show About info
03 1E 02 00 Hide debug info
03 1E 02 01 Show debug info
03 1F Reset
03 20 00 Disable Weight via USB
03 20 01 Enable Weight via USB
03 22 Send Battery voltage data once
data[0] = modelByte;
data[1] = 0xCE; // Type byte for weight stable
data[2] = weightByte1;
data[3] = weightByte2;
data[4] = 0x00;
data[5] = 0x00;
data[6] = calculateXOR(data, 6); // Last byte is XOR validation
data[0] = modelByte;
data[1] = 0xAA; // Type byte for weight stable
data[2] = buttonNumber;//1 for O button, 2 for ▢ button
data[3] = buttonShortPress;//1 for short press, 2 for long press
// Fill the rest with dummy data or real data as needed
data[4] = 0x00;
data[5] = 0x00;
data[6] = calculateXOR(data, 6); // Last byte is XOR validation
data[0] = modelByte;
data[1] = 0x2A;
data[2] = buttonNumber;
data[3] = buttonShortPress;
data[4] = 0x00;
data[5] = 0x00;
data[6] = calculateXOR(data, 6); // Last byte is XOR validation
data[0] = modelByte;
data[1] = 0x22;
data[2] = voltageByte1;
data[3] = voltageByte2;
data[4] = 0x00;
data[5] = 0x00;
data[6] = calculateXOR(data, 6); // Last byte is XOR validation
USBC 케이블을 연결하고 Serial과 같은 프로그램을 115200,8,N,1 설정으로 사용하시면 스케일의 작동 상태를 확인하실 수 있습니다. 이를 통해 디버깅이 매우 쉬워집니다.
#programmer #api #bluetooth #wifi #usb