Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
openshwprojects committed Sep 2, 2024
2 parents d761ce0 + 816721e commit 18316ec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
19 changes: 12 additions & 7 deletions src/hal/w800/hal_wifi_w800.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,11 @@ void HAL_PrintNetworkInfo()
unsigned char mac[6] = { 0, 1, 2, 3, 4, 5 };

struct netif* netif = tls_get_netif();
MEMCPY(mac, &netif->hwaddr[0], ETH_ALEN);
MEMCPY(mac, &netif->hwaddr, ETH_ALEN);
snprintf(macstr, sizeof(macstr), MACSTR, MAC2STR(mac));

tls_wifi_get_current_bss(&bss);

wm_printf("sta:rssi=%d,ssid=%s,bssid=" MACSTR ",channel=%d,cipher_type:",
bss.rssi, bss.ssid, macstr, bss.channel);
print_security_type(bss.encryptype);
bss.ssid[bss.ssid_len]=0;

struct tls_ethif* tmpethif = tls_netif_get_ethif();
char buffer[256];
Expand All @@ -105,8 +102,16 @@ void HAL_PrintNetworkInfo()
strcpy(netmask, inet_ntoa(tmpethif->netmask));
char dns[16] = {0};
strcpy(dns, inet_ntoa(tmpethif->dns1));
snprintf(buffer, 256, "ip=%s,gate=%s,mask=%s,dns=%s\r\n", ip, gw, netmask, dns);
addLogAdv(LOG_INFO, LOG_FEATURE_GENERAL, buffer);
snprintf(buffer, 256, "Network info:\r\n"
"\tsta:rssi=%d, SSID=%s, BSSID=" MACSTR ", channel=%d, encr=%s\r\n"
"\tIP=%s, GW=%s, MASK=%s, MAC=%s, DNS=%s\r\n",
bss.rssi, bss.ssid, MAC2STR(bss.bssid), bss.channel,
( bss.encryptype >= IEEE80211_ENCRYT_NONE && bss.encryptype <= IEEE80211_ENCRYT_AUTO_WPA2) ? security_names[bss.encryptype] : "-",
ip, gw, netmask, macstr, dns );
bk_printf(buffer);
// do we need this in web Log?
// disable for now
// addLogAdv(LOG_INFO, LOG_FEATURE_GENERAL, buffer);
}

int HAL_GetWifiStrength()
Expand Down
8 changes: 4 additions & 4 deletions src/mqtt/new_mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ static struct mqtt_connect_client_info_t mqtt_client_info =
100, /* keep alive */
NULL, /* will_topic */
NULL, /* will_msg */
0, /* will_qos */
1, /* will_qos */
0 /* will_retain */
#if LWIP_ALTCP && LWIP_ALTCP_TLS
, NULL
Expand Down Expand Up @@ -809,7 +809,7 @@ static void mqtt_pub_request_cb(void* arg, err_t result)
static OBK_Publish_Result MQTT_PublishTopicToClient(mqtt_client_t* client, const char* sTopic, const char* sChannel, const char* sVal, int flags, bool appendGet)
{
err_t err;
u8_t qos = 2; /* 0 1 or 2, see MQTT specification */
u8_t qos = 1; /* 0 1 or 2, see MQTT specification */
u8_t retain = 0; /* No don't retain such crappy payload... */
size_t sVal_len;
char* pub_topic;
Expand Down Expand Up @@ -1198,7 +1198,7 @@ static int MQTT_do_connect(mqtt_client_t* client)
mqtt_client_info.will_topic = will_topic;
mqtt_client_info.will_msg = "offline";
mqtt_client_info.will_retain = true;
mqtt_client_info.will_qos = 2;
mqtt_client_info.will_qos = 1;

#ifdef WINDOWS
hostEntry = gethostbyname(mqtt_host);
Expand Down Expand Up @@ -1520,7 +1520,7 @@ void MQTT_Test_Tick(void* param)
BENCHMARK_TEST_INFO* info = (BENCHMARK_TEST_INFO*)param;
int block = 1;
err_t err;
int qos = 2;
int qos = 1;
int retain = 0;

if (info != NULL)
Expand Down

0 comments on commit 18316ec

Please sign in to comment.