[Yunq] Read capabilities using the parsing library.

This commit is contained in:
Drew Galbraith 2024-01-11 19:59:36 -08:00
parent 0e6aa532a1
commit 75d84a0fa5
7 changed files with 41 additions and 40 deletions

View file

@ -19,8 +19,7 @@ glcr::Status KeyboardListener::ParseFromBytes(const glcr::ByteBuffer& bytes, uin
yunq::MessageView message(bytes, offset);
RETURN_ERROR(ParseFromBytesInternal(message));
// Parse port_capability.
// FIXME: Implement in-buffer capabilities for inprocess serialization.
set_port_capability(0);
ASSIGN_OR_RETURN(port_capability_, message.ReadCapability(0));
return glcr::Status::Ok();
}
@ -28,9 +27,7 @@ glcr::Status KeyboardListener::ParseFromBytes(const glcr::ByteBuffer& bytes, uin
yunq::MessageView message(bytes, offset);
RETURN_ERROR(ParseFromBytesInternal(message));
// Parse port_capability.
uint64_t port_capability_ptr = bytes.At<uint64_t>(offset + header_size + (8 * 0));
set_port_capability(caps.At(port_capability_ptr));
ASSIGN_OR_RETURN(port_capability_, message.ReadCapability(0, caps));
return glcr::Status::Ok();
}