2017-01-03 3 views
0

나는 블루투스로 내 전화에 보수계 시계를 연결하려고하고 있으며, 내가 만든 응용 프로그램으로 단계를 읽으 려합니다. 연결이 성공적으로 이루어졌으며 시계에서 데이터를 읽을 수는 있지만 해석 방법이 명확하지 않습니다.헥사 10 진수 해석

(1) all the eigenvalue content inside the endian order are small endian order. 

(2) current_pedometer_measurement 
    The value of the current_pedometer_measurement consists of four parts 
    Value type description 
    Flag Uint8 0x01: Number of Steps (Required) 
    0x02: Distance (optional) 
    0x04: Calories (optional) 
    Such as 0x05 that contains the number of steps and calories 
    StepCount Uint24 The number of steps 
    StepDistancer Uint24 How far, in meters 
    StepCalorie Uint24 calories 

    Description: 

    1. Distance and calories are optional, may or may not appear 
     If only the number of steps, then the value is: 01 (steps) 10 27 00 (1 million steps) 
     If there are steps and distances, then the value is: 03 (number of steps, distance) 10 27 00 (1 million steps) 70 17 00 (6 km) 
     Other cases and so on. 
    2. Time value to mobile phone time as the standard, that is, the moment the phone receives the data that is the time of this data. 

(3) target 

    The target value is 
    Value type description 
    Flag Uint8 0x01: Number of Steps (Required) 
    StepCount Uint24 The number of steps 

    Description: 
    1. If the target is 10,000 steps, then the value is: 01 (steps) 10 27 00 (1 million steps) 
    2. If the device writes to the target value, the device is updated. If the device updates the target value, notify the phone. 

내가 만보계 시계에서 얻고 읽기는 다음과 같습니다 :

[7, 64, 1, 0, 144, 0, 0, 24, 0, 0] 

사람은 내가 그것을 해석하는 데 도움하실 수 있습니다

고유치 내용, 문서입니다 ?

답변

1

데이터가 정확한 설명을 따르는 것으로 보입니다. 첫 번째 바이트는 플래그 필드이며이 경우 3 개의 측정 유형이 모두보고되었음을 나타냅니다. 또는 비트 1과 2와 3은 7입니다.

다음 9 바이트는 3 개의 24 비트 데이터 값입니다. 여기서 64,1,0은 단계이고, 144,0,0은 거리이며, 24,0 , 0은 칼로리입니다. 바이트를 어떻게 변환하는지 조금 혼란 스럽지만 리틀 엔디안 형식을 사용하고 10 진수로 출력한다고 가정하면이 값들은 의미가 있습니까? 당신의 예에서

Steps: 00 01 64 = 0x000140 = 320 
Distance: 00 00 144 = 0x000090 = 144 
Calories: 00 00 24 = 0x000018 = 24 
값은 진수에 아마 위 :

10 27 00 = 0x002710 = 10000 
70 17 00 = 0x001770 = 6000 

희망하는 데 도움이!

유예

+0

예 대상으로 설정 한 6000 단계였습니다. 나는 그것을 더 공부할 것이다. – Dev