Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
knowledge_base:programming:protobuf [2022/12/02 15:58] – removed - external edit (Unknown date) 127.0.0.1 | knowledge_base:programming:protobuf [2022/12/02 15:58] (current) – ↷ Page moved from knowledge_base:home_it:protobuf to knowledge_base:programming:protobuf George Wayne | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Google Protocol Buffers for Python3 ====== | ||
+ | |||
+ | ===== Install Protobuf Compiler ===== | ||
+ | |||
+ | - Download protobuf binary and follow readme.txt - [[https:// | ||
+ | - Install setuptools (sudo apt-get install python3-setuptools) | ||
+ | - Download and install protobuf compiler - [[https:// | ||
+ | |||
+ | ===== Python3 Protobuf Programming Basics ===== | ||
+ | |||
+ | - Tutorial: [[https:// | ||
+ | |||
+ | ===== HCI Log Manipulation ===== | ||
+ | |||
+ | - Get btsnoop_hci.log by turning on Android developer option | ||
+ | - Use wireshark to extract RFCOMM payload | ||
+ | - Rip protobuf from payload binary by ripping transport header (See AMA protocol spec for transport header details). I wrote a little python3 program called rippproto.py to do that | ||
+ | - Parsing protobuf message. I wrote a little python3 program called listctl.py to do that | ||
+ | |||
+ | ===== Clipboard Access ===== | ||
+ | |||
+ | - xclip requires x-server. VcXsrv (open source) or Xming (donation based) are two possible choices. VcXsrv is what I use. | ||
+ | - subprocess package can run xclip (or any shell command) in Python3 and redirect input/ | ||
+ | |||
+ | ===== Bose Hack ===== | ||
+ | < | ||
+ | thomwang@SJC-5CG7193RWZ: | ||
+ | Version: 1 | ||
+ | Stream Id: 0 - control stream | ||
+ | Payload Bytes: 6 | ||
+ | command: GETFIRMWAREINFORMATION | ||
+ | response { | ||
+ | error_code: UNSUPPORTED | ||
+ | } | ||
+ | |||
+ | thomwang@SJC-5CG7193RWZ: | ||
+ | Version: 1 | ||
+ | Stream Id: 0 - control stream | ||
+ | Payload Bytes: 60 | ||
+ | command: GET_DEVICE_INFORMATION | ||
+ | response { | ||
+ | device_information { | ||
+ | serial_number: | ||
+ | name: "Bose QC35 II" | ||
+ | supported_transports: | ||
+ | supported_transports: | ||
+ | supported_transports: | ||
+ | device_type: | ||
+ | } | ||
+ | } | ||
+ | |||
+ | thomwang@SJC-5CG7193RWZ: | ||
+ | Version: 1 | ||
+ | Stream Id: 0 - control stream | ||
+ | Payload Bytes: 6 | ||
+ | command: GET_DEVICE_CONFIGURATION | ||
+ | response { | ||
+ | device_configuration { | ||
+ | } | ||
+ | } | ||
+ | |||
+ | thomwang@SJC-5CG7193RWZ: | ||
+ | Version: 1 | ||
+ | Stream Id: 0 - control stream | ||
+ | Payload Bytes: 6 | ||
+ | command: SYNCHRONIZE_SETTINGS | ||
+ | response { | ||
+ | error_code: UNSUPPORTED | ||
+ | } | ||
+ | </ | ||
+ | |||