* etc.
* This provides some robustness against network outages, automatically
* replaying the log periodically to be collected after connectivity
- * is restored.
- *
- * Values above 17 are currently not recommended because the current
- * wire format uses a 16-bit field for a duration in seconds, which wraps
- * at 18 hours.
- * */
+ * is restored. */
const uint config_resend_count = 16;
/* These control the size of the per-send-count press queues.
* etc.
* This provides some robustness against network outages, automatically
* replaying the log periodically to be collected after connectivity
- * is restored.
- *
- * Values above 17 are currently not recommended because the current
- * wire format uses a 16-bit field for a duration in seconds, which wraps
- * at 18 hours.
- * */
+ * is restored. */
extern const uint config_resend_count;
/* These control the size of the per-send-count press queues.
struct tattle_message_wire_format {
u16_t sender;
u16_t seq;
- u16_t ago;
+ u32_t ago;
};
-void send_report_packet(u16_t seq, u16_t ago) {
+void send_report_packet(u16_t seq, u32_t ago) {
cyw43_arch_lwip_begin();
initialize_the_pcb();
(struct tattle_message_wire_format *)(p->payload);
msg->sender = htons(config_this_tattler_identity);
msg->seq = htons(seq);
- msg->ago = htons(ago);
+ msg->ago = htonl(ago);
if (udp_send(the_pcb, p) != ERR_OK)
signal_error_by_blinking();
#include "lwip/arch.h"
-void send_report_packet(u16_t seq, u16_t ago);
+void send_report_packet(u16_t seq, u32_t ago);
#endif
press_t press;
if (!get_press_due_for_resend(pp, now, &press))
signal_error_by_blinking();
- uint32_t ago = now - press.timestamp;
+ u32_t ago = now - press.timestamp;
send_report_packet(press.seq, ago);
press.send_count++;
if (press.send_count < config_resend_count) {