Skip to content

Commit 9aa8f37

Browse files
committed
rename for the protobuf update
1 parent f3cfb56 commit 9aa8f37

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

src/Wippersnapper.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -534,24 +534,24 @@ bool cbDecodeSignalRequestI2C(pb_istream_t *stream, const pb_field_t *field,
534534
wippersnapper_signal_v1_I2CResponse_init_zero;
535535
if (field->tag == wippersnapper_signal_v1_I2CRequest_req_i2c_init_tag) {
536536
WS_DEBUG_PRINTLN("I2C Init Request Found!");
537-
// Decode I2CInitRequest
538-
wippersnapper_i2c_v1_I2CInitRequest msgI2cInitRequest =
539-
wippersnapper_i2c_v1_I2CInitRequest_init_zero;
540-
if (!pb_decode(stream, wippersnapper_i2c_v1_I2CInitRequest_fields,
541-
&msgI2cInitRequest)) {
537+
// Decode I2CBusInitRequest
538+
wippersnapper_i2c_v1_I2CBusInitRequest msgI2CBusInitRequest =
539+
wippersnapper_i2c_v1_I2CBusInitRequest_init_zero;
540+
if (!pb_decode(stream, wippersnapper_i2c_v1_I2CBusInitRequest_fields,
541+
&msgI2CBusInitRequest)) {
542542
WS_DEBUG_PRINTLN(
543-
"ERROR: Could not decode wippersnapper_i2c_v1_I2CInitRequest");
543+
"ERROR: Could not decode wippersnapper_i2c_v1_I2CBusInitRequest");
544544
return false; // fail out
545545
}
546546

547547
// Create a new I2C Component
548-
if (msgI2cInitRequest.i2c_port_number == 0) {
549-
WS._i2cPort0 = new WipperSnapper_Component_I2C(&msgI2cInitRequest);
548+
if (msgI2CBusInitRequest.i2c_port_number == 0) {
549+
WS._i2cPort0 = new WipperSnapper_Component_I2C(&msgI2CBusInitRequest);
550550
WS.i2cComponents.push_back(WS._i2cPort0);
551551
// did we init. the port successfully?
552552
is_success = WS._i2cPort0->isInitialized();
553-
} else if (msgI2cInitRequest.i2c_port_number == 1) {
554-
WS._i2cPort1 = new WipperSnapper_Component_I2C(&msgI2cInitRequest);
553+
} else if (msgI2CBusInitRequest.i2c_port_number == 1) {
554+
WS._i2cPort1 = new WipperSnapper_Component_I2C(&msgI2CBusInitRequest);
555555
// did we init. the port successfully?
556556
is_success = WS._i2cPort1->isInitialized();
557557
WS.i2cComponents.push_back(WS._i2cPort1);
@@ -573,13 +573,13 @@ bool cbDecodeSignalRequestI2C(pb_istream_t *stream, const pb_field_t *field,
573573
wippersnapper_signal_v1_I2CRequest_req_i2c_scan_tag) {
574574
WS_DEBUG_PRINTLN("I2C Scan Request");
575575

576-
// Decode I2CScanRequest
577-
wippersnapper_i2c_v1_I2CScanRequest msgScanReq =
578-
wippersnapper_i2c_v1_I2CScanRequest_init_zero;
579-
if (!pb_decode(stream, wippersnapper_i2c_v1_I2CScanRequest_fields,
576+
// Decode I2CBusScanRequest
577+
wippersnapper_i2c_v1_I2CBusScanRequest msgScanReq =
578+
wippersnapper_i2c_v1_I2CBusScanRequest_init_zero;
579+
if (!pb_decode(stream, wippersnapper_i2c_v1_I2CBusScanRequest_fields,
580580
&msgScanReq)) {
581581
WS_DEBUG_PRINTLN(
582-
"ERROR: Could not decode wippersnapper_i2c_v1_I2CScanRequest");
582+
"ERROR: Could not decode wippersnapper_i2c_v1_I2CBusScanRequest");
583583
return false; // fail out if we can't decode the request
584584
}
585585

@@ -591,8 +591,8 @@ bool cbDecodeSignalRequestI2C(pb_istream_t *stream, const pb_field_t *field,
591591
}
592592

593593
// Perform I2C scan
594-
wippersnapper_i2c_v1_I2CScanResponse scanResp =
595-
wippersnapper_i2c_v1_I2CScanResponse_init_zero;
594+
wippersnapper_i2c_v1_I2CBusScanResponse scanResp =
595+
wippersnapper_i2c_v1_I2CBusScanResponse_init_zero;
596596
if (msgScanReq.i2c_port_number == 0) {
597597
scanResp = WS._i2cPort0->scanAddresses();
598598
} else {

src/components/i2c/WipperSnapper_I2C.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
/***************************************************************************************************************/
2626
WipperSnapper_Component_I2C::WipperSnapper_Component_I2C(
27-
wippersnapper_i2c_v1_I2CInitRequest *msgInitRequest) {
27+
wippersnapper_i2c_v1_I2CBusInitRequest *msgInitRequest) {
2828
WS_DEBUG_PRINTLN("EXEC: New I2C Port ");
2929
WS_DEBUG_PRINT("\tPort #: ");
3030
WS_DEBUG_PRINTLN(msgInitRequest->i2c_port_number);
@@ -84,16 +84,16 @@ bool WipperSnapper_Component_I2C::isInitialized() { return _isInit; }
8484
/*!
8585
@brief Scans all I2C addresses on the bus between 0x08 and 0x7F
8686
inclusive and returns an array of the devices found.
87-
@returns wippersnapper_i2c_v1_I2CScanResponse
87+
@returns wippersnapper_i2c_v1_I2CBusScanResponse
8888
*/
8989
/************************************************************************/
90-
wippersnapper_i2c_v1_I2CScanResponse
90+
wippersnapper_i2c_v1_I2CBusScanResponse
9191
WipperSnapper_Component_I2C::scanAddresses() {
9292
WS_DEBUG_PRINT("EXEC: I2C Scan");
9393

9494
// Create response
95-
wippersnapper_i2c_v1_I2CScanResponse scanResp =
96-
wippersnapper_i2c_v1_I2CScanResponse_init_zero;
95+
wippersnapper_i2c_v1_I2CBusScanResponse scanResp =
96+
wippersnapper_i2c_v1_I2CBusScanResponse_init_zero;
9797

9898
// Scan all I2C addresses between 0x08 and 0x7F inclusive and return a list of
9999
// those that respond.

src/components/i2c/WipperSnapper_I2C.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ class I2C_Driver;
3333
class WipperSnapper_Component_I2C {
3434
public:
3535
WipperSnapper_Component_I2C(
36-
wippersnapper_i2c_v1_I2CInitRequest *msgInitRequest);
36+
wippersnapper_i2c_v1_I2CBusInitRequest *msgInitRequest);
3737
~WipperSnapper_Component_I2C();
38-
wippersnapper_i2c_v1_I2CScanResponse scanAddresses();
38+
wippersnapper_i2c_v1_I2CBusScanResponse scanAddresses();
3939
bool
4040
attachI2CDevice(wippersnapper_i2c_v1_I2CDeviceInitRequest *msgDeviceInitReq);
4141
bool isInitialized();

0 commit comments

Comments
 (0)