X-Git-Url: http://git.scottworley.com/tattlekey/blobdiff_plain/1d94976e09413eba32972b3c60f30e2ee83dbcdb..a4a617fd9b53e294a057d1b01a6a8896658f2be3:/client/net.c?ds=sidebyside diff --git a/client/net.c b/client/net.c index c692a12..6253d61 100644 --- a/client/net.c +++ b/client/net.c @@ -1,3 +1,20 @@ +/* tattlekey: A one-key UDP keyboard + * Copyright (C) 2023 Scott Worley + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include "net.h" #include "blink.h" #include "config.h" @@ -20,10 +37,10 @@ static void initialize_the_pcb() { signal_error_by_blinking(); ip_addr_t ipaddr; - if (ip4addr_aton(tattle_server_ip_address, &ipaddr) == 0) + if (ip4addr_aton(config_tattle_server_ip_address, &ipaddr) == 0) signal_error_by_blinking(); - if (udp_connect(the_pcb, &ipaddr, tattle_port) != ERR_OK) + if (udp_connect(the_pcb, &ipaddr, config_tattle_port) != ERR_OK) signal_error_by_blinking(); } @@ -33,7 +50,7 @@ struct tattle_message_wire_format { u16_t ago; }; -void send_report(u16_t seq, u16_t ago) { +void send_report_packet(u16_t seq, u16_t ago) { cyw43_arch_lwip_begin(); initialize_the_pcb(); @@ -45,7 +62,7 @@ void send_report(u16_t seq, u16_t ago) { struct tattle_message_wire_format *msg = (struct tattle_message_wire_format *)(p->payload); - msg->sender = htons(this_tattler_identity); + msg->sender = htons(config_this_tattler_identity); msg->seq = htons(seq); msg->ago = htons(ago);