btm: update GetHostDeviceProperty for 13.0.0

This commit is contained in:
ndeadly 2021-09-23 22:50:38 +02:00
parent 2c341f1da3
commit 459a5c2125
2 changed files with 19 additions and 5 deletions

View File

@ -85,10 +85,21 @@ typedef struct {
/// HostDeviceProperty /// HostDeviceProperty
typedef struct { typedef struct {
union {
struct {
BtdrvAddress addr; ///< Same as BtdrvAdapterProperty::addr. BtdrvAddress addr; ///< Same as BtdrvAdapterProperty::addr.
BtmClassOfDevice class_of_device; ///< Same as BtdrvAdapterProperty::class_of_device. BtmClassOfDevice class_of_device; ///< Same as BtdrvAdapterProperty::class_of_device.
BtmBdName name; ///< Same as BtdrvAdapterProperty::name (except the last byte which is always zero). BtmBdName name; ///< Same as BtdrvAdapterProperty::name (except the last byte which is always zero).
u8 feature_set; ///< Same as BtdrvAdapterProperty::feature_set. u8 feature_set; ///< Same as BtdrvAdapterProperty::feature_set.
} v1; ///< [1.0.0-12.1.0]
struct {
BtdrvAddress addr; ///< Same as BtdrvAdapterProperty::addr.
BtmClassOfDevice class_of_device; ///< Same as BtdrvAdapterProperty::class_of_device.
char name[0xF9]; ///< Same as BtdrvAdapterProperty::name (except the last byte which is always zero).
u8 feature_set; ///< Same as BtdrvAdapterProperty::feature_set.
} v13; ///< [13.0.0+]
};
} BtmHostDeviceProperty; } BtmHostDeviceProperty;
/// BtmConnectedDevice [1.0.0-12.1.0] /// BtmConnectedDevice [1.0.0-12.1.0]

View File

@ -156,7 +156,10 @@ Result btmGetState(BtmState *out) {
} }
Result btmGetHostDeviceProperty(BtmHostDeviceProperty *out) { Result btmGetHostDeviceProperty(BtmHostDeviceProperty *out) {
return serviceDispatchOut(&g_btmSrv, 1, *out); if (hosversionBefore(13,0,0))
return serviceDispatchOut(&g_btmSrv, 1, (*out).v1);
return _btmCmdOutBufPtrFixed(out, sizeof((*out).v13), 1);
} }
Result btmAcquireDeviceConditionEvent(Event* out_event) { Result btmAcquireDeviceConditionEvent(Event* out_event) {