GD-Packet: Do not assume POD type for fixed size custom type
* Instead of assuming POD type, define a data() and length() interface for fixed size custom types and use the returned value for value serialization and deserialization * This allows custom fixed types to implement other base classes as any virtual function will make the object not POD due to the creation VTABLE pointer for the virtual function * Moreover, treating objects as POD types and write to its memory without protection is generally dangerous as it is subjected to padding and alignment decisions of the compiler and processor * Also, use std::array in hci::Address and hci::ClassOfDevice to discourage writing to raw C arrays directly Bug: 157533831 Tag: #gd-refactor Test: gd/cert/run --host Change-Id: I81e17fd03ab58b42a195ef566bb1aa453f85684a
Loading
Please register or sign in to comment