adafruit / Wippersnapper_Protobuf

Protocol buffer messages for Adafruit.io WipperSnapper Beta
MIT License
0 stars 2 forks source link

Create I2CRequest, I2CResponse #50

Closed brentru closed 3 years ago

brentru commented 3 years ago

Devices listen for i2c commands across a signals/i2c MQTT sub-topic. The callback for this topic will call the existing signal message decoding overhead as I2C commands are currently within the CreateSignalRequest message.

This pull request aims to pull the I2C-specific commands out of CreateSignalRequest for use with a decoder specific to handling I2CRequests and an encoder function for handling I2CResponses.

I did not bring in the unified sensor API/anything else yet, just focusing on scanning and initializing for now.

Noting that we may need to drop the oneof if we can not decode the repeated i2c_address field within the i2cscanrequest

brentru commented 3 years ago

Added I2C bus frequency setter Added fields for SDA/SCL pins (will be from hardware definition) Added I2C Bus Id (ESP32 has multiple, we may want to modify a hardware definition to include a string "i2c_bus_id")

Ready for review

brentru commented 3 years ago

Failure on #cef1d28 due to type change - this API is not currently in use , shouldn't effect merge