본문 바로가기
블루투스/Link Manager

LMP Opcode - Parameter 설명 추가

by 테크쟁이 2023. 1. 14.
반응형

참고자료: https://www.bluetooth.com/specifications/specs/core-specification-5-3/

참고자료: https://www.bluetooth.com/specifications/assigned-numbers/

* Parameter 설명이 없는, LMP opcode 요약본은 "LMP Opcode" 참고

 

LMP PDU (LMP Opcode)
LMP PDU Length Opcode Parameter Payload
Position
LMP_name_req 2 1 Name_Offset

uint8

(byte)
2
LMP_name_res 17 2 Name_Offset

uint8

(byte)
2
Name_Length

uint8

(byte)
3
Name_Fragment
- UTF-8 character

utf8s{14z}
4~17
LMP_accepted
- opcode
의 길이가 7비트일 때 사용
2 3 Opcode

uint8
2
LMP_not_accepted
- opcode
의 길이가 7비트일 때 사용
3 4 Opcode

uint8
2
Error_Code
- "Controller Error Code"
참고

uint8
3
LMP_clkoffset_req 1 5 No Parameter  
LMP_clkoffset_res 3 6 Clock_Offset
- (CLKN
16~2 Peripheral-CLKN16~2 Central) mod 215

uint15 (1.25 ms)
2~3
LMP_detach 2 7 Error_Code
- "Controller Error Code"
참고

uint8
2
LMP_in_rand 17 8 Random_Number

multiple bytes
2~17
LMP_comb_key 17 9 Random_Number

multiple bytes
2~17
LMP_unit_key 17 10 Key

multiple bytes
2~17
LMP_au_rand 17 11 Random_Number

multiple bytes
2~17
LMP_sres 5 12 Authentication_Rsp

multiple bytes
2~5
LMP_temp_rand 17 13 Random_Number

multiple bytes
2~17
LMP_temp_key 17 14 Key

multiple bytes
 
LMP_encryption_mode_req 2 15 Encryption_Mode

uint8


- 0: no encryption
- 1: encryption
- 2: previously used
- 3~255: RFU
2
LMP_encryption_key_size_req 2 16 Key_Size

uint8

(byte)
2
LMP_start_encryption_req 17 17 Random_Number

multiple bytes
2~17
LMP_stop_encryption_req 1 18 No Parameter  
LMP_switch_req 5 19 Switch_Instant
- Central's clock
27:1 bits
-
짝수값만 유효

uint32

(slot)
2~5
LMP_hold 7 20 Hold_Time
- supervisionTO * 0.999
이하 값

uint16 (slot)


- 0x0014~0x8000
2~3
Hold_Instant
- Central's clock
27:1 bits
-
짝수값만 유효

uint32

(slot)
4~7
LMP_hold_req 7 21 Hold_Time
- supervisionTO * 0.999
이하 값

uint16 (slot)


- 0x0014~0x8000
2~3
Hold_Instant
- Central's clock
27:1 bits
-
짝수값만 유효

uint32

(slot)
4~7
LMP_sniff NA 22    NA  
LMP_sniff_req 10 23 Timing_Control_Flags

uint8


- [0]=0: no timing change
- [0]=1: timing change
- [1]=0: initialization 1
사용
- [1]=1: initialization 2
사용
- [2]=0: access window
- [2]=1: no access window
- [3]~[7]: RFU
2
Dsniff
- Tsniff 보다 작은 짝수값만 유효

uint16

(slot)
3~4
Tsniff
- supervisionTO * 0.999 이하 값
- 짝수값만 유효

uint16

(slot)
- 0x0006~0x0540
5~6
Timing_Control_Flags

uint8


- [0]=0: no timing change
- [0]=1: timing change
- [1]=0: initialization 1
사용
- [1]=1: initialization 2
사용
- [2]=0: access window
- [2]=1: no access window
- [3]~[7]: RFU
7~8
Sniff_Timeout

uint16

(received slots)
-  0~0x0028
9~10
LMP_unsniff_req 1 24 No Parameter  
LMP_park_req NA 25 NA  
LMP_park NA 26 NA  
LMP_set_broadcast_scan_window NA 27 NA  
LMP_modify_beacon NA 28 NA  
LMP_unpark_BD_ADDR_req NA 29 NA  
LMP_unpark_PM_ADDR_req NA 30 NA  
LMP_incr_power_req 2 31 Reserved
- Reserved for future use

uint8
2
LMP_decr_power_req 2 32 Reserved
- Reserved for future use

uint8
2
LMP_max_power 1 33 No Parameter  
LMP_min_power 1 34 No Parameter  
LMP_auto_rate 1 35 No Parameter  
LMP_preferred_rate 2 36 Data_Rate

uint8

값 (Basic Rate mode) 
- [0]=0: FEC
- [0]=1: No FEC
- [1~2]=0: no preference
- [1~2]=1: 1-slot
- [1~2]=2: 3-slot
- [1~2]=3: 5-slot packet

값 (Enhanced Data Rate mode)
- [3~4]=0: DM1
- [3~4]=1: 2 Mb/s
- [3~4]=2: 3Mb/s packet
- [3~4]=3: RFU
- [5~6]=0: no preference
- [5~6]=1: 1-slot
- [5~6]=2: 3-slot
- [5~6]=3: 5-slot packet
- [7]: RFU
2
LMP_version_req 6 37 Version

uint8

(UUID)
- "Core version UUID"
 참고
2
Company_Identifier

uint16

(UUID)
- "Company Identifiers UUID"
참고
3~4
Subversion
-
company에서 정의

uint16
5~6
LMP_version_res 6 38 Version

uint8

(UUID)
- "Core version UUID" 참고
2
Company_Identifier

uint16

(UUID)
- "Company Identifiers UUID" 참고
3~4
Subversion
-
company에서 정의

uint16
5~6
LMP_features_req 9 39 Features
- n
번째 LMP feature mask
- LMP feature mask
page 0

uint1 [64]


- "
LMP feature mask" 참고
2~9
LMP_features_res 9 40 Features
- n
번째 LMP feature mask
- LMP feature mask
page 0

uint1 [64]


- "
LMP feature mask" 참고
2~9
LMP_quality_of_service 4 41 Poll_Interval
-
짝수값만 유효

uint16

(slot)
- 0x0006~0x1000
2~3
NBC
- APB broadcast packet을 전송해야 하는 최소 횟수

uint8
4
LMP_quality_of_service_req 4 42 Poll_Interval
-
짝수값만 유효

uint16

(slot)
- 0x0006~0x1000
2~3
NBC
- APB broadcast packet을 전송해야 하는 최소 횟수

uint8
4
LMP_SCO_link_req 7 43 SCO_Handle

uint8
2
Timing_Control_Flags

uint8


- [0]=0: no timing change
- [0]=1: timing change
- [1]=0: initialization 1
사용
- [1]=1: initialization 2
사용
- [2]=0: access window
- [2]=1: no access window
- [3]~[7]: RFU
3
Dsco
- Tsco 보다 작은 짝수값만 유효

uint8

(slot)
4
Tsco
- 짝수값만 유효

uint8

(slot)
- 2~6
5
SCO_Packet

uint8


- 0: HV1
- 1: HV2
- 2: HV3
- 3~255: RFU
6
Air_Mode

uint8


- 0: µ-law log
- 1: A-law log
- 2: CVSD
- 3: transparent data
- 4-255: RFU
7
LMP_remove_SCO_link_req 4 44 SCO_Handle

uint8
3
Error_Code
- "Controller Error Code"
참고

uint8
4
LMP_max_slot 2 45 Max_Slots

uint8

(slot)
2
LMP_max_slot_req 2 46 Max_Slots

uint8

(slot)
2
LMP_timing_accuracy_req 1 47 No Parameter  
LMP_timing_accuracy_res 3 48 Drift

uint8

(ppm)
2
Jitter

uint8

(µs)
3
LMP_setup_complete 1 49 No Parameter  
LMP_use_semi_permanent_key 1 50 No Parameter  
LMP_host_connection_req 1 51 No Parameter  
LMP_slot_offset 9 52 Slot_Offset

uint16

(µs)
- 0~1249
2~3
BD_ADDR
-
송신 측 Bluetooth Device Address

multiple bytes
4~9
LMP_page_mode_req 3 53 Paging_Scheme

uint8


- 0: mandatory scheme
- 1~255: RFU
2
Paging_Scheme_Settings
- mandatory scheme


uint8


- 0: R0
- 1: R1
- 2: R2
- 3~255: RFU
3
LMP_Page_scan_mode_req 3 54 Paging_Scheme

uint8


- 0: mandatory scheme
- 1-255: RFU
2
Paging_Scheme_Settings
- mandatory scheme


uint8


- 0: R0
- 1: R1
- 2: R2
- 3~255: RFU
3
LMP_supervision_timeout 3 55 Supervision_Timeout

uint16

(slot)
- 0: timeout
없음
- 0x0190~0xFFFF
2~3
LMP_test_activate 1 56 No Parameter  
LMP_test_control 10 57 Test_Scenario 2
Hopping_Mode 3
Tx_Frequency 4
Rx_Frequency 5
Power_Mode 6
Poll_Period 7
Packet_Type 8
Test_Data_Length 9~10
LMP_encryption_key_size_mask_req 1 58 No Parameter  
LMP_encryption_key_size_mask_res 3 59 Key_Size_Mask
-
지원하는 broadcast encryption key size
- [0]: key size 1
지원여부
- [1]: key size 2
지원여부

- [15]: key size 16
지원여부

uint1 [16]


- 0: key size
미지원
- 1: key size
지원
2~3
LMP_set_AFH 16 60 AFH_Instant
- Hop sequence
를 전환할 때, Central clock
-
짝수값만 유효하다

uint32


- 27:1 bits
사용
2~5
AFH_Mode

uint8


- 0: disabled
- 1: enabled
- 2~255: RFU
6
AFH_Channel_Map
- [0]: 0
번 채널 사용여부
- [1]: 1
번 채널 사용여부
- ...
- [78]: 78
번 채널 사용여부
- [79]: RFU

uint1 [80]

채널 사용여부 값
- 0:
미사용
- 1:
사용중
7~16
LMP_encapsulated_header 4 61 Encap_Major_Type
- Major Type, Minor Type, Payload Leng
의 조합으로 사용

uint8


- 1: P-192 Public Key
또는
- 1: P-256 Public Key
2
Encap_Minor_Type
- Major Type, Minor Type, Payload Leng
의 조합으로 사용

uint8


- 1: P-192 Public Key
- 2: P-256 Public Key
3
Encap_Payload_Length
- Major Type, Minor Type, Payload Leng
의 조합으로 사용

uint8


- 48: P-192 Public Key
- 64: P-256 Public Key
4
LMP_encapsulated_payload 17 62 Encap_Data
- 16 byte
보다 작으면, MSB 부터 zero padding
- Little-endian
포맷

Multiple bytes
2~17
LMP_simple_pairing_confirm 17 63 Commitment_Value

uint128
2~17
LMP_simple_pairing_number 17 64 Nonce_Value
- Little-endian
포맷

Multiple bytes
2~17
LMP_DHkey_check 17 65 Confirmation_Value

uint128
2~17
LMP_pause_encryption_aes_req 17 66 Random_Number

multiple bytes
2~17
LMP_accepted_ext
- opcode
의 길이가 15비트일 때 사용
4 (127<<8) | 1 Escape_Opcode
- ACK
을 보낸 Escape_Opcode

uint8


- 124~127
3
Extended_Opcode
- ACK
을 보낸 Extended_Opcode

uint8
4
LMP_not_accepted_ext
-opcode
의 길이가 15비트일 때 사용
5 (127<<8) | 2 Escape_Opcode
- ACK
을 보낸 Escape_Opcode

uint8


- 124~127
3
Extended_Opcode
- ACK
을 보낸 Extended_Opcode

uint8
4
Error_Code
- "
Controller Error Code" 참고

uint8
5
LMP_features_req_ext 12 (127<<8) | 3 Features_Page
-
요청된 Page

uint8


- 0: standard feature (page 0)
- 1~255:
다른 feature page
3
Max_Supported_Page
-
해당 디바이스에서 0이 아닌 feature가 있는 최대 page
 
uint8


- 1~255
4
Extended_Features
- n
번째 LMP feature mask
- 64 * Features_Page +n

uint1 [64]


- "
LMP feature mask" 참고
5~12
LMP_features_res_ext 12 (127<<8) | 4 Features_Page
-
요청된 Page

uint8


- 0: standard feature (page 0)
- 1~255:
다른 feature page
3
Max_Supported_Page
-
해당 디바이스에서 0이 아닌 feature가 있는 최대 page
 
uint8


- 1~255
4
Extended_Features
- n
번째 LMP feature mask
- 64 * Features_Page +n

uint1 [64]


-
"LMP feature mask" 참고
5~12
LMP_clk_adj 15 (127<<8) | 5 Clk_Adj_ID
- Central
에서 Coarse Clock Adjustment event를 구분하는 handle로 사용

uint8
3
Clk_Adj_Instant
-
조정하기 전, time_base_offset를 기반으로 한, Coarse Clock Adjustment 할 때의 CLKold[27:1]

uint32

(slot)
4~7
Clk_Adj_Offset
- old slot
new slot의 경계

sint16

(µs)
- -624~+624
8~9
Clk_Adj_Slots
- clocks adjustment instant
차이
- CLK
new[27:1] - CLKold[27:1]

uint8

(slot)
10
Clk_Adj_Mode

uint8


- 0: Before Instant
- 1: After Instant
- 2-255: RFU
11
Clk_Adj_Clk
- PDU
전송 시 CLK[27:2]

uint32

(slot pair)
12~15
LMP_clk_adj_ack 3 (127<<8) | 6 Clk_Adj_ID
- Central
에서 Coarse Clock Adjustment event를 구분하는 handle로 사용

uint8
3
LMP_clk_adj_req 6 (127<<8) | 7 Clk_Adj_Offset
- old slot
new slot의 경계

sint16

(µs)
- -624~+624
3~4
Clk_Adj_Slots
- clocks adjustment instant
차이
- CLK
new[27:1] - CLKold[27:1]

uint8

(slot)
5
Clk_Adj_Period
-
이 값의 정수 배만큼 Clk_Adj_Slots에 더하면, 동일하게 적절한 조정이 된다고, Central에게 알려주는 값

uint8

(slot)
- 0
또는,
- Clk_Adj_Slots
보다 큰 짝수
6
LMP_packet_type_table 3 (127<<8) | 11 Packet_Type_Table

uint8


- 0: 1 Mb/s only
- 1: 2/3 Mb/s
- 2~255: RFU
3
LMP_eSCO_link_req 16 (127<<8) | 12 eSCO_Handle

uint8
3
eSCO_LT_ADDR
- eSCO
Logical transport address

uint3


- 1~7
4
Timing_Control_Flags

uint8


- [0]=0: no timing change
- [0]=1: timing change
- [1]=0: initialization 1
사용
- [1]=1: initialization 2
사용
- [2]=0: access window
- [2]=1: no access window
- [3]~[7]: RFU
5
DeSCO
- TeSCO 보다 작은 짝수값만 유효

uint8

(slot)
6
TeSCO
- 짝수값만 유효

uint8

(slot)
- 4~254
7
WeSCO
- Retransmission window slot 개수
-
짝수값만 유효

uint8

(slot)
- 0~254
8
eSCO_Packet_Type CP

uint8


- 0x00 (C
P): POLL
- 0x07: EV3
- 0x0C: EV4
- 0x0D: EV5
- 0x26: 2-EV3
- 0x2C: 2-EV5
- 0x37: 3-EV3
- 0x3D: 3-EV5
-
나머지 값: RFU
9
eSCO_Packet_Type PC

uint8


- 0x00 (P
C): NULL
- 0x07: EV3
- 0x0C: EV4
- 0x0D: EV5
- 0x26: 2-EV3
- 0x2C: 2-EV5
- 0x37: 3-EV3
- 0x3D: 3-EV5
-
나머지 값: RFU
10
Packet_Length CP
- eSCO payload length

uint16

(byte)
- 0: POLL/NULL
- 1~30: EV3
- 1~120: EV4
- 1~180: EV5
- 1~60: 2-EV3
- 1~360: 2-EV5
- 1~90: 3-EV3
- 1~540: 3-EV5
-
나머지 값: Invalid Value
11~12
Packet_Length PC
- eSCO payload length

uint16

(byte)
- 0: POLL/NULL
- 1~30: EV3
- 1~120: EV4
- 1~180: EV5
- 1~60: 2-EV3
- 1~360: 2-EV5
- 1~90: 3-EV3
- 1~540: 3-EV5
-
나머지 값: Invalid Value
13~14
Air_Mode

uint8


- 0: µ-law log
- 1: A-law log
- 2: CVSD
- 3: transparent data
- 4-255: RFU
15
Negotiation_State

uint8


- 0: negotiation
시작
- 1:
최근에 수신된 것보다, 해당  parameter가 더 선호된다.
- 2:
최근에 수신된 parameterreserved slot violation이 발생
- 3:
최근에 수신된 parameterlatency violation이 발생
- 4:
최근에 수신된 parameter는 지원하지 않음
-
나머지 값: RFU
16
LMP_remove_eSCO_link_req 4 (127<<8) | 13 eSCO_Handle

uint8
3
Error_Code
- "Controller Error Code"
참고

uint8
4
LMP_channel_classification_req 7 (127<<8) | 16 AFH_Reporting_Mode

uint8


- 0: disabled
- 1: enabled
- 2-255:RFU
3
AFH_Min_Interval

-
범위: 1~30s (0x0640~0xBB80)
-
짝수값만 유효

uint16
4~5
AFH_Max_Interval
-
범위: 1~30s (0x0640~0xBB80)
-
짝수값만 유효

uint16
6~7
LMP_channel_classification 12 (127<<8) | 17 AFH_Channel_Classification

uint2 [40]: 2n, 2n+1
채널상태
- [0]: 0
, 1번 채널상태
- [1]: 2
, 3번 채널상태
- ...
- [39]: 78
번 채널상태

채널상태 값
- 0: unknown
- 1: good
- 2: RFU
- 3: bad
3~12
LMP_sniff_subrating_req 9 (127<<8) | 21 Max_Sniff_Subrate

uint8

(subrate)
- 1~255
3
Min_Sniff_Mode_Timeout
-
짝수값만 유효

uint16

(slot)
4~5
Sniff_Subrating_Instant
- Central clock
27:1 bits
-
짝수값만 유효

uint32

(slot)
6~9
LMP_sniff_subrating_res 9 (127<<8) | 22 Max_Sniff_Subrate

uint8

(subrate)
- 1~255
3
Min_Sniff_Mode_Timeout
-
짝수값만 유효

uint16

(slot)
4~5
Sniff_Subrating_Instant
- Central clock
27:1 bits
-
짝수값만 유효

uint32

(slot)
6~9
LMP_pause_encryption_req 2 (127<<8) | 23 No Parameter  
LMP_resume_encryption_req 2 (127<<8) | 24 No Parameter  
LMP_IO_capability_req 5 (127<<8) | 25 IO_Capabilities

uint8


- 0: Display only
- 1: Display YesNo
- 2: KeyboardOnly
- 3: NoInputNoOutput
- 4~255: RFU
3
OOB_Auth_Data

uint8


- 0: No OOB Authentication Data
received
- 1: OOB Authentication Data
received
- 2-255: RFU
4
Authentication_Requirements

uint8


- 0x00: MITM Protection Not
Required (No Bonding)
- 0x01: MITM Protection
Required (No Bonding)
- 0x02: MITM Protection Not
Required (Dedicated Bonding)
- 0x03: MITM Protection
Required (Dedicated Bonding)
- 0x04: MITM Protection Not
Required (General Bonding)
- 0x05: MITM Protection
Required (General Bonding)
- 0x06~0xFF: RFU
5
LMP_IO_capability_res 5 (127<<8) | 26 IO_Capabilities

uint8


- 0: Display only
- 1: Display YesNo
- 2: KeyboardOnly
- 3: NoInputNoOutput
- 4~255: RFU
3
OOB_Auth_Data

uint8


- 0: No OOB Authentication Data
received
- 1: OOB Authentication Data
received
- 2-255: RFU
4
Authentication_Requirements

uint8


- 0x00: MITM Protection Not
Required (No Bonding)
- 0x01: MITM Protection
Required (No Bonding)
- 0x02: MITM Protection Not
Required (Dedicated Bonding)
- 0x03: MITM Protection
Required (Dedicated Bonding)
- 0x04: MITM Protection Not
Required (General Bonding)
- 0x05: MITM Protection
Required (General Bonding)
- 0x06~0xFF: RFU
5
LMP_numeric_comparision_failed 2 (127<<8) | 27 No Parameter  
LMP_passkey_failed 2 (127<<8) | 28 No Parameter  
LMP_oob_failed 2 (127<<8) | 29 No Parameter  
LMP_keypress_notification 3 (127<<8) | 30 Notification_Type

uint8


- 0=passkey entry started
- 1=passkey digit entered
- 2=passkey digit erased
- 3=passkey cleared
- 4=passkey entry completed
- 5~255: RFU
2
LMP_power_control_req 3 (127<<8) | 31 Power_Adj_Req

uint8


- 0: power
1단계 감소
- 1: power
1단계 증가
- 2:
최대 power까지 증가
- 3~255: RFU
3
LMP_power_control_res 3 (127<<8) | 32 Power_Adj_Rsp
- [0]: GFSK
- [1]:
π/4-DQPSK
- [2]: 8DPSK
- [3]: RFU

uint2 [4]


- 0:
미지원
- 1: 1
단계 변경됨
- 2:
최대 power 단계
- 3:
최소 power 단계
3
LMP_ping_req 2 (127<<8) | 33 No Parameter  
LMP_ping_res 2 (127<<8) | 34 No Parameter  
LMP_SAM_SET_TYPE0 17 (127<<8) | 35 Update_Mode

uint8


- 0: type 0 submap
을 가진 SAM slot maps 무효
- 1: type 0 submap
즉시 적용
- 2:
다음 sub-interval에서 type 0 submap 적용
-
나머지 값: RFU
3
SAM_Type0_Submap
- n
slot slot type

uint2 [56]


- 0: Slot
송신불가능, 수신불가능
- 1: Slot
송신가능, 수신불가능
- 2: Slot
송신불가능, 수신가능
- 3: Slot
송신가능, 수신가능
4~17
LMP_SAM_DEFINE_MAP 17 (127<<8) | 36 SAM_Index
- SAM slot map
index

uint8


- 0, 1, 2, 0xFF
3
TSAM_SM
-
SAM submap length

uint8

(Slot)
- 2~56
4
NSAM_SM
- SAM slot map에서 submaps의 개수

uint8

(submaps)
- 0~48
5
SAM_Submaps
- SAM slot map
에서 n번째 submap type
- N
SAM_SM 값 만큼만 유효

uint2 [48]


- 0:
설정한 대로 slot  사용가능
- 1:
모든 slot 사용 가능
- 2:
모든 slot 사용 불가능
- 3: RFU
6~17
LMP_SAM_SWITCH 9 (127<<8) | 37 SAM_Index
- SAM slot map
index

uint8


- 0, 1, 2, 0xFF
3
Timing_Control_Flags

uint8


- [0]=0: no timing change
- [0]=1: timing change
- [1]=0: initialization 1
사용
- [1]=1: initialization 2
사용
- [2]=0: access window
- [2]=1: no access window
- [3]~[7]: RFU
4
DSAM
- TSAM 보다 작은 짝수값만 유효

uint8

(slot)
5
SAM_Instant
- SAM slot map
activate될 때 CLK[27:1]
-
짝수값만 유효

uint32

(slot)
6~9

 

반응형

'블루투스 > Link Manager' 카테고리의 다른 글

LMP packet format (LMP PDU)  (0) 2023.01.25
Bluetooth Device Name  (0) 2023.01.16
LMP feature mask  (0) 2023.01.13
Controller Error Code  (0) 2023.01.13
LMP Opcode  (0) 2023.01.11