Files
OpenEPaperLink/ESP32_AP-Flasher/include/serialap.h
Nic Limper 6292e73135 Pending queue (#210)
Pretty complex change here: pending images/commands are now queued.

A command (like LED flasher) will not overwrite a pending image anymore. Also, sending multiple preloaded images is possible.
Also works (at least, as far as I could test) in combination with Multi AP and mirroring tags ('display a copy' content type).

It you want to test this: don't forget to upload the changed files in /www (the pending icon is now displaying the amount of queued messages). Timing improvements will follow later (only one message can be transmitted every checkin. If multiple messages are queued, at this moment, you have to wait until the next checkin which takes 40-60 sec).

This comes also with the advantage of better stability if you upload multiple images to the same tag in succession. Before queuing, if was possible to replace the image between sending the pending message and the image transfer to the tag, causing md5 mismatches and instability.

Solves #47
2024-01-29 00:49:52 +01:00

38 lines
900 B
C

#include <Arduino.h>
extern struct espSetChannelPower curChannel;
#define AP_STATE_OFFLINE 0
#define AP_STATE_ONLINE 1
#define AP_STATE_FLASHING 2
#define AP_STATE_WAIT_RESET 3
#define AP_STATE_REQUIRED_POWER_CYCLE 4
#define AP_STATE_FAILED 5
#define AP_STATE_COMING_ONLINE 6
struct APInfoS {
bool isOnline = false;
uint8_t state = AP_STATE_OFFLINE;
uint8_t type;
uint16_t version = 0;
uint8_t channel;
uint8_t mac[8];
uint8_t power;
uint8_t pendingBuffer;
uint8_t nop;
};
extern struct APInfoS apInfo;
void APTask(void* parameter);
bool sendCancelPending(struct pendingData* pending);
bool sendDataAvail(struct pendingData* pending);
bool sendPing();
void APEnterEarlyReset();
bool sendChannelPower(struct espSetChannelPower* scp);
void rxSerialTask2(void* parameter);
void APTagReset();
bool bringAPOnline();
void setAPstate(bool isOnline, uint8_t state);