mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 22:07:04 +01:00
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
52 lines
1.0 KiB
C
52 lines
1.0 KiB
C
#ifndef NEWPROTO_H
|
|
#define NEWPROTO_H
|
|
|
|
#include<Arduino.h>
|
|
#pragma pack(push, 1)
|
|
|
|
#include "../../oepl-definitions.h"
|
|
#include "../../oepl-proto.h"
|
|
#include "../../oepl-esp-ap-proto.h"
|
|
|
|
#define BLOCK_XFER_BUFFER_SIZE BLOCK_DATA_SIZE + sizeof(struct blockData)
|
|
|
|
#define PKT_XFER_TIMEOUT 0xED
|
|
|
|
#define PKT_APLIST_REQ 0x80
|
|
#define PKT_APLIST_REPLY 0x81
|
|
#define PKT_TAGINFO 0x82
|
|
|
|
struct APlist {
|
|
uint32_t src;
|
|
char alias[32];
|
|
uint8_t channelId;
|
|
uint8_t tagCount;
|
|
uint16_t version;
|
|
} __packed;
|
|
|
|
#define SYNC_NOSYNC 0
|
|
#define SYNC_USERCFG 1
|
|
#define SYNC_TAGSTATUS 2
|
|
#define SYNC_DELETE 3
|
|
#define SYNC_VERSION 0xAA01
|
|
|
|
struct TagInfo {
|
|
uint16_t structVersion = SYNC_VERSION;
|
|
uint8_t mac[8];
|
|
uint8_t syncMode;
|
|
char alias[32];
|
|
uint32_t lastseen;
|
|
uint32_t nextupdate;
|
|
uint16_t pendingCount;
|
|
uint32_t expectedNextCheckin;
|
|
uint8_t hwType;
|
|
uint8_t wakeupReason;
|
|
uint8_t capabilities;
|
|
uint16_t pendingIdle;
|
|
uint8_t contentMode;
|
|
uint8_t reserved[8];
|
|
} __packed;
|
|
|
|
#pragma pack(pop)
|
|
|
|
#endif // NEWPROTO_H
|