Skip to content

Commit

Permalink
Merge pull request #581 from WildernessLabs/bug/esp32-event
Browse files Browse the repository at this point in the history
unsupported ESP32 event is now a warning, not an exception
  • Loading branch information
ctacke authored Sep 10, 2024
2 parents c627ea5 + 7882088 commit d182233
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ internal StatusCodes SendCommand(byte where, UInt32 function, bool block, byte[]
/// <returns>StatusCodes enum indicating if the command was successful or if an error occurred.</returns>
protected StatusCodes SendBluetoothCommand(BluetoothFunction function, bool block, byte[]? encodedRequest, byte[]? encodedResult)
{
return (SendCommand((byte)Esp32Interfaces.BlueTooth, (uint)function, block, encodedRequest, encodedResult));
return SendCommand((byte)Esp32Interfaces.BlueTooth, (uint)function, block, encodedRequest, encodedResult);
}


Expand Down Expand Up @@ -182,7 +182,7 @@ internal StatusCodes SendCommand(byte destination, uint function, bool block, by
resultGcHandle.Free();
}
}
return (result);
return result;
}

/// <summary>
Expand Down Expand Up @@ -229,7 +229,7 @@ private StatusCodes GetEventData(EventData eventData, out byte[]? payload)
resultGcHandle.Free();
}
}
return (result);
return result;
}

/// <summary>
Expand Down Expand Up @@ -289,7 +289,8 @@ private void EventHandlerServiceThread(object o)
SystemMessageReceived?.Invoke(this, ((SystemFunction)eventData.Function, (StatusCodes)eventData.StatusCode));
break;
default:
throw new NotImplementedException($"Events not implemented for interface {eventData.Interface}");
Resolver.Log.Warn($"Received an ESP32 event for interface {eventData.Interface}. Ignored");
break;
}
}).RethrowUnhandledExceptions();
}
Expand Down Expand Up @@ -325,6 +326,6 @@ public double GetBatteryLevel()
GetBatteryChargeLevelResponse response = Encoders.ExtractGetBatteryChargeLevelResponse(result, 0);
voltage = response.Level / 1000f;
}
return (voltage);
return voltage;
}
}

0 comments on commit d182233

Please sign in to comment.