[no ci] Update wifibroadcast-ng

pull/1733/head
viktorxda 2025-02-27 15:11:35 +01:00
parent 95b21aa5f7
commit 7377ea7c76
4 changed files with 8 additions and 73 deletions

View File

@ -1,59 +0,0 @@
// Copyright (C) 2017 - 2024 Vasily Evseenko <svpcom@p2ptech.org>
/*
* 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; version 3.
*
* 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, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <fcntl.h>
#include <sodium.h>
#include <string.h>
int main(int argc, char **argv) {
unsigned char publickey[crypto_box_PUBLICKEYBYTES];
unsigned char secretkey[crypto_box_SECRETKEYBYTES];
FILE *fp;
if (argc != 2) {
printf("Passphrase is missing\n");
return 1;
}
if (sodium_init() < 0) {
printf("Libsodium init failed\n");
return 1;
}
char seed[32];
strncpy(seed, argv[1], sizeof(seed));
printf("Using passphrase: %s\n", seed);
if (crypto_box_seed_keypair(publickey, secretkey, seed) != 0) {
printf("Unable to generate key\n");
return 1;
}
const char *key = "/etc/drone.key";
if ((fp = fopen(key, "w")) == NULL) {
printf("Unable to save: %s\n", key);
return 1;
}
fwrite(secretkey, crypto_box_SECRETKEYBYTES, 1, fp);
fwrite(publickey, crypto_box_PUBLICKEYBYTES, 1, fp);
fclose(fp);
printf("Key saved: %s\n", key);
return 0;
}

View File

@ -4,18 +4,11 @@
#
################################################################################
WIFIBROADCAST_EXT_DEPENDENCIES += libsodium
define WIFIBROADCAST_EXT_BUILD_CMDS
$(TARGET_CC) $(WIFIBROADCAST_EXT_PKGDIR)/src/keygen.c -o $(@D)/keygen -lsodium -s
endef
define WIFIBROADCAST_EXT_INSTALL_TARGET_CMDS
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc/init.d
$(INSTALL) -m 755 -t $(TARGET_DIR)/etc/init.d $(WIFIBROADCAST_EXT_PKGDIR)/files/S75generate_vtx_info
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/bin
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(@D)/keygen
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/bin $(WIFIBROADCAST_EXT_PKGDIR)/files/generate_vtx_info
endef

View File

@ -83,14 +83,15 @@ start_telemetry() {
[ "$chipset" = "ssc33x" ] && devmem 0x1F207890 16 0x8
echo_log "Starting $router"
if [ "$router" = "msposd" ]; then
config=$(curl -s localhost/api/v1/config.json)
[ -n "$config" ] && size=$(echo "$config" | jsonfilter -e "@.video0.size")
msposd -b 115200 -c 8 -d -r "$osd_fps" -z "${size:-1280x720}" \
-m /dev/"$serial" -o 10.5.0.1:14551 > /dev/null &
elif [ "$router" = "mavfwd" ]; then
if [ "$router" = "mavfwd" ]; then
mavfwd -b 115200 -c 8 -p 100 -a 15 -t \
-m /dev/"$serial" -i 0.0.0.0:14550 -o 10.5.0.1:14551 > /dev/null &
else
if [ "$router" = "msposd" ]; then
size=$(curl -s localhost/api/v1/config.json | jsonfilter -e "@.video0.size")
fi
msposd -b 115200 -c 8 -z "$size" -r "$osd_fps" \
-m /dev/"$serial" -o 10.5.0.1:14551 > /dev/null &
fi
}

View File

@ -4,7 +4,7 @@
#
################################################################################
WIFIBROADCAST_NG_VERSION = 1d14a1a32df559b5a421fa15841e79e3b7a8ef99
WIFIBROADCAST_NG_VERSION = 6c5febf31c713beacd63221bfd74dfe30031c44d
WIFIBROADCAST_NG_SITE = $(call github,svpcom,wfb-ng,$(WIFIBROADCAST_NG_VERSION))
WIFIBROADCAST_NG_LICENSE = GPL-3.0