Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 0e465290 authored by Myles Watson's avatar Myles Watson
Browse files

PDL: Add Python support for Address, ClassOfDevice

Add a type_caster for each custom type to and from std::string.

Bug: 143568835
Test: Create packets in Python passing strings:
   $ python3.8
   >>> import bluetooth_packets_python3 as bp3
   >>> pview = bp3.PacketViewLittleEndian([14, 10, 1, 9, 16, 0, 1, 2, 3, 4, 5, 6])
   >>> event = bp3.hci_packets.EventPacketView(pview)
   >>> complete = bp3.hci_packets.CommandCompleteView(event)
   >>> read_complete = bp3.hci_packets.ReadBdAddrCompleteView(complete)
   >>> address = read_complete.GetBdAddr()
   >>> print(address)
   06:05:04:03:02:01
   >>> builder = bp3.hci_packets.ReadBdAddrCompleteBuilder(1, bp3.hci_packets.ErrorCode.SUCCESS, address)
   >>> builder.Serialize()
   [14, 10, 1, 9, 16, 0, 1, 2, 3, 4, 5, 6]
   >>> quit()
Change-Id: If0a1639a4c1a162b68e1d0a0bb1cd5ba552a1190
parent 73ec92e9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment