33 return len >= 8 && pkt[5] == 0xE0 && pkt[6] == 0x1D;
38 using Table = std::pair<uint8_t, uint8_t>;
39 using Clock = std::chrono::steady_clock;
61 auto it =
by_id_.find(request_id);
64 const Table t = it->second;
71 std::vector<Table>
due(Clock::time_point now) {
72 std::vector<Table> out;
74 if (now >= it->second) {
75 out.push_back(it->first);
std::map< uint8_t, Table > by_id_
std::chrono::steady_clock Clock
std::chrono::milliseconds retry_after_
std::pair< uint8_t, uint8_t > Table
void reset()
A new connection: every subscription is sent afresh.
Table rejected(uint8_t request_id, Clock::time_point now)
The DB refused the subscription sent under request_id.
std::vector< Table > due(Clock::time_point now)
Refused tables whose wait is over; each is forgotten here until rejected again.
SubscriptionTracker(std::chrono::milliseconds retry_after=std::chrono::seconds(1))
size_t refused() const
Tables currently waiting to be asked for again.
std::map< Table, Clock::time_point > retry_at_
uint8_t assign(Table table)
The request id to subscribe table under.
bool is_error_response(const uint8_t *pkt, size_t len)
ErrorResponse: header len(4) | ty(1) | msg id [0xE0, 0x1D] | request id(1).
Motorized ball valve position: raw ADC counts -> % open.