Understanding the OTA code ...

Started by Humancell, June 06, 2019, 08:11:41 PM

Humancell

Hello,

I'm trying to understand the OTA code, and have a few questions that I just can't figure out.  For some background, I'm working on a way for the OTA to occur from a Moteino connected to an ESP8266, pulling the HEX file from a server over WiFi.  :-)

I'm getting close, and ran into a few things tonight that I just want to make sure that I understand.

Looking at:  https://github.com/LowPowerLab/RFM69/blob/master/RFM69_OTA.cpp#L350

HandleSerialHEXData(RFM69& radio, uint8_t targetID, uint16_t TIMEOUT, uint16_t ACKTIMEOUT, uint8_t DEBUG)

So a "targetID" is passed into this function.  But then immediately below we grab the remoteID.

https://github.com/LowPowerLab/RFM69/blob/master/RFM69_OTA.cpp#L353

Then, within the function both targetID and remoteID are being passed to different functions.

What is the difference between a "targetID" and a "remoteID"?

I was thinking that they were one and the same ... and I even found in the code where a remoteID is being passed as a targetID parameter.

Thoughts?

Felix

I think they are the same thing.
I can't remember why I might have had them written like that, with 2 names.
Might have to do with some edge case I can't think of right now.
A quick way to "check" is to use the targetID in both places and see if something breaks.

Humancell

Thanks ... I'm slowly making my way through the code and might post other questions.  I'm also doing some other refactoring, and will post to a public repo once I get this done.  Hopefully in the next day or so ...