ei: only send region_mapping_id to clients binding v2
This commit is contained in:
parent
0cf547655d
commit
54b8b2a830
1 changed files with 8 additions and 4 deletions
|
|
@ -29,6 +29,8 @@ pub const EI_DEVICE_TYPE_VIRTUAL: u32 = 1;
|
||||||
#[expect(dead_code)]
|
#[expect(dead_code)]
|
||||||
pub const EI_DEVICE_TYPE_PHYSICAL: u32 = 2;
|
pub const EI_DEVICE_TYPE_PHYSICAL: u32 = 2;
|
||||||
|
|
||||||
|
pub const REGION_MAPPING_ID_SINCE: EiVersion = EiVersion(2);
|
||||||
|
|
||||||
pub struct EiDevice {
|
pub struct EiDevice {
|
||||||
pub id: EiDeviceId,
|
pub id: EiDeviceId,
|
||||||
pub client: Rc<EiClient>,
|
pub client: Rc<EiClient>,
|
||||||
|
|
@ -101,10 +103,12 @@ impl EiDevice {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn send_region_mapping_id(&self, mapping_id: &str) {
|
pub fn send_region_mapping_id(&self, mapping_id: &str) {
|
||||||
self.client.event(RegionMappingId {
|
if self.version >= REGION_MAPPING_ID_SINCE {
|
||||||
self_id: self.id,
|
self.client.event(RegionMappingId {
|
||||||
mapping_id,
|
self_id: self.id,
|
||||||
});
|
mapping_id,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[expect(dead_code)]
|
#[expect(dead_code)]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue