File tree 2 files changed +68
-4
lines changed
2 files changed +68
-4
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ typedef enum {
64
64
65
65
/// BdName
66
66
typedef struct {
67
- u8 name [0x20 ]; ///< Name string.
67
+ char name [0x20 ]; ///< Name string.
68
68
} BtmBdName ;
69
69
70
70
/// ClassOfDevice
@@ -91,9 +91,68 @@ typedef struct {
91
91
u8 feature_set ; ///< Same as BtdrvAdapterProperty::feature_set.
92
92
} BtmHostDeviceProperty ;
93
93
94
+ /// BtmConnectedDevice
95
+ typedef struct {
96
+ BtdrvAddress address ;
97
+ u8 pad [2 ];
98
+ u32 unk_x8 ;
99
+ char name [0x20 ];
100
+ u8 unk_x2C [0x1C ];
101
+ u16 vid ;
102
+ u16 pid ;
103
+ u8 unk_x4C [0x20 ];
104
+ } BtmConnectedDevice ;
105
+
106
+ /// DeviceCondition [1.0.0-5.0.2]
107
+ typedef struct {
108
+ u32 unk_x0 ;
109
+ u32 unk_x4 ;
110
+ u8 unk_x8 ;
111
+ u8 unk_x9 ;
112
+ u8 max_count ;
113
+ u8 connected_count ;
114
+ BtmConnectedDevice devices [8 ];
115
+ } BtmDeviceConditionV100 ;
116
+
117
+ /// DeviceCondition [5.1.0-7.0.1]
118
+ typedef struct {
119
+ u32 unk_x0 ;
120
+ u32 unk_x4 ;
121
+ u8 unk_x8 ;
122
+ u8 unk_x9 [2 ];
123
+ u8 max_count ;
124
+ u8 connected_count ;
125
+ u8 pad [3 ];
126
+ BtmConnectedDevice devices [8 ];
127
+ } BtmDeviceConditionV510 ;
128
+
129
+ /// DeviceCondition [8.0.0-8.1.1]
130
+ typedef struct {
131
+ u32 unk_x0 ;
132
+ u32 unk_x4 ;
133
+ u8 unk_x8 ;
134
+ u8 unk_x9 ;
135
+ u8 max_count ;
136
+ u8 connected_count ;
137
+ BtmConnectedDevice devices [8 ];
138
+ } BtmDeviceConditionV800 ;
139
+
140
+ /// DeviceCondition [9.0.0+]
141
+ typedef struct {
142
+ u32 unk_x0 ;
143
+ u8 unk_x4 ;
144
+ u8 unk_x5 ;
145
+ u8 max_count ;
146
+ u8 connected_count ;
147
+ BtmConnectedDevice devices [8 ];
148
+ } BtmDeviceConditionV900 ;
149
+
94
150
/// DeviceCondition
95
- typedef struct {
96
- u8 unk_x0 [0x368 ]; ///< Unknown
151
+ typedef union {
152
+ BtmDeviceConditionV100 v100 ;
153
+ BtmDeviceConditionV510 v510 ;
154
+ BtmDeviceConditionV800 v800 ;
155
+ BtmDeviceConditionV900 v900 ;
97
156
} BtmDeviceCondition ;
98
157
99
158
/// DeviceSlotMode
Original file line number Diff line number Diff line change @@ -157,7 +157,12 @@ Result btmAcquireDeviceConditionEvent(Event* out_event) {
157
157
}
158
158
159
159
Result btmGetDeviceCondition (BtmDeviceCondition * out ) {
160
- return _btmCmdOutBufPtrFixed (out , sizeof (* out ), 3 );
160
+ size_t buff_size ;
161
+ if (hosversionAtLeast (9 ,0 ,0 )) buff_size = sizeof (BtmDeviceConditionV900 );
162
+ else if (hosversionAtLeast (8 ,0 ,0 )) buff_size = sizeof (BtmDeviceConditionV800 );
163
+ else if (hosversionAtLeast (5 ,1 ,0 )) buff_size = sizeof (BtmDeviceConditionV510 );
164
+ else buff_size = sizeof (BtmDeviceConditionV100 );
165
+ return _btmCmdOutBufPtrFixed (out , buff_size , 3 );
161
166
}
162
167
163
168
Result btmSetBurstMode (BtdrvAddress addr , bool flag ) {
You can’t perform that action at this time.
0 commit comments