]> git.scottworley.com Git - tattlekey/blame - client/config.c
client: New epoch if seq wraps
[tattlekey] / client / config.c
CommitLineData
fbc57595
SW
1#include "config.h"
2
1d699cc3 3/* Wi-Fi credentials */
e8a53974
SW
4const char config_wifi_ssid[] = "THEWIFISSID";
5const char config_wifi_pass[] = "THEWIFIPASSWORD";
1e0a316e 6
1d699cc3 7/* Network address of the server to contact */
e8a53974
SW
8const char config_tattle_server_ip_address[] = "192.168.10.10";
9const u16_t config_tattle_port = 29803; // 'tk'
1e0a316e 10
1d699cc3 11/* For distinguishing reports from multiple tattlekey devices. */
e8a53974 12const u16_t config_this_tattler_identity = 1;
d1521eda
SW
13
14/* Which GPIO pin is the button connected to?
15 * The button should span this pin and ground, connecting this pin to ground
16 * when pressed.
17 * https://projects.raspberrypi.org/en/projects/introduction-to-the-pico/10
18 * recommends pins 18, 22, or 28. */
e8a53974 19const uint config_button_pin = 18;
2f7a1e89
SW
20
21/* Don't bother reporting each separate button press when it is pressed many
22 * times in short succession. (We also use this to de-bounce. :) */
e8a53974 23const u32_t config_minimum_seconds_between_button_presses = 1;
ff379463 24
24ed3618
SW
25/* Send each report multiple times. Re-sends are sent with exponential delay:
26 * #1 sent immediately
27 * #2 after 1 seconds
28 * #3 after 2 seconds
29 * #4 after 4 seconds
30 * #5 after 8 seconds
31 * ...
32 * #11 after 8 minutes
33 * #12 after 17 minutes
34 * #13 after 34 minutes
35 * #14 after 68 minutes
36 * #15 after 2 hours
37 * #16 after 4 hours
38 * #17 after 9 hours
39 * etc.
40 * This provides some robustness against network outages, automatically
41 * replaying the log periodically to be collected after connectivity
9266b741 42 * is restored. */
3a07ca82 43const uint config_resend_count = 16;
a36c278f
SW
44
45/* These control the size of the per-send-count press queues.
46When the button is pressed more than config_maximum_queue_size times
47within the resend interval, some presses will be reported fewer
48than config_resend_count times. This is usually fine because it's
49the old, longest-delayed, most-redundant reports that get dropped;
50fresh, timely reports of new button presses will not get anywhere near
51config_resend_count in a resend interval because the early resend internals
52are so short. */
e8a53974 53const uint config_maximum_queue_size = 512;
a36c278f
SW
54
55/* This is paranoia about unanticipated delays. Setting this to zero
56would probably be fine, but imposing a minimum queue size is an easy
57safety measure. */
e8a53974 58const uint config_minimum_queue_size = 32;