Send channels over phoneapi on want config (#1780)

* Send channels

* Doh!

* Adjust comments

* Missed a spot

* Consolidate

* Skipped disabled ones

* Fixed bounding

* Change order

* comment out disabled check for build artefact

* Remove loop

* Off by one

* Probably should start at zero

* Zero

* Oops

* enable dubug log

* Reset to index zero

Co-authored-by: Sacha Weatherstone <sachaw100@hotmail.com>
This commit is contained in:
Ben Meadors
2022-10-10 10:36:49 -05:00
committed by GitHub
parent f8982ddaf8
commit f88dde2f60
5 changed files with 115 additions and 99 deletions

View File

@@ -16,13 +16,13 @@
* Eventually there should be once instance of this class for each live connection (because it has a bit of state
* for that connection)
*/
class PhoneAPI
: public Observer<uint32_t> // FIXME, we shouldn't be inheriting from Observer, instead use CallbackObserver as a member
class PhoneAPI : public Observer<uint32_t> // FIXME, we shouldn't be inheriting from Observer, instead use CallbackObserver as a member
{
enum State {
STATE_SEND_NOTHING, // Initial state, don't send anything until the client starts asking for config
STATE_SEND_MY_INFO, // send our my info record
STATE_SEND_NODEINFO, // states progress in this order as the device sends to to the client
STATE_SEND_CHANNELS, // Send all channels
STATE_SEND_CONFIG, // Replacement for the old Radioconfig
STATE_SEND_MODULECONFIG, // Send Module specific config
STATE_SEND_COMPLETE_ID,
@@ -31,7 +31,7 @@ class PhoneAPI
State state = STATE_SEND_NOTHING;
int8_t config_state = Config_device_tag;
uint8_t config_state = 0;
/**
* Each packet sent to the phone has an incrementing count