From: Markus Großer Date: Tue, 5 Dec 2017 13:53:29 +0000 (+0100) Subject: Fix STEMlab discovery without hostname resolution X-Git-Url: https://git.rkrishnan.org/pf/$rel_link?a=commitdiff_plain;h=4aa4bd6087207e4a6409776ab9046d5943107fe9;p=pihpsdr.git Fix STEMlab discovery without hostname resolution Before, the web request to start the SDR application was sent to the STEMlab identified by the hostname (rp-xxxxxx). Unfortunately, there are cases where the STEMlab can be found via IP address, but not via hostname. This should have really been in with the original commit for STEMlab discovery already, but seems to have slipped under my radar - listing the installed HPSDR applications already uses the IP address, but actually starting it was still left with using hostname resolution. --- diff --git a/stemlab_discovery.c b/stemlab_discovery.c index bb8b532..4581bd1 100644 --- a/stemlab_discovery.c +++ b/stemlab_discovery.c @@ -289,11 +289,9 @@ static size_t app_start_callback(void *buffer, size_t size, size_t nmemb, void * void stemlab_start_app(const char * const app_id) { // Dummy string, using the longest possible app id - char app_start_url[] = "http://rp-ff00ff/bazaar?start=stemlab_sdr_transceiver_hpsdr"; - sprintf(app_start_url, "http://rp-%02hhx%02hhx%02hhx/bazaar?start=%s", - radio->info.network.mac_address[3], - radio->info.network.mac_address[4], - radio->info.network.mac_address[5], + char app_start_url[] = "http://123.123.123.123/bazaar?start=stemlab_sdr_transceiver_hpsdr"; + sprintf(app_start_url, "http://%s/bazaar?start=%s", + inet_ntoa(radio->info.network.address.sin_addr), app_id); CURL *curl_handle = curl_easy_init(); if (curl_handle == NULL) {