From eb53e7f6e74d2214d2a08da5f5b579a64c8b2498 Mon Sep 17 00:00:00 2001 From: Gregg Date: Wed, 25 Jan 2023 22:22:49 -0600 Subject: [PATCH] Moved SpanPoint initialization message to main Info 'i' output Created SpanPoint table within 'i' output --- src/HomeSpan.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/HomeSpan.cpp b/src/HomeSpan.cpp index c51ca4e..3d4dbba 100644 --- a/src/HomeSpan.cpp +++ b/src/HomeSpan.cpp @@ -1027,6 +1027,20 @@ void Span::processSerialCommand(const char *c){ Serial.print("\n"); } } + + if(SpanPoint::SpanPoints.size()>0){ + uint8_t channel; + wifi_second_chan_t channel2; + esp_wifi_get_channel(&channel,&channel2); + Serial.printf("\nSpanPoint Channel=%d:\n\n",channel); + Serial.printf("%-17s %18s %7s %7s %7s\n","Local MAC Address","Remote MAC Address","Send","Receive","Depth"); + Serial.printf("%.17s %.18s %.7s %.7s %.7s\n",d,d,d,d,d); + for(auto it=SpanPoint::SpanPoints.begin();it!=SpanPoint::SpanPoints.end();it++) + Serial.printf("%-18s %02X:%02X:%02X:%02X:%02X:%02X %7d %7d %7d\n",(*it)->peerInfo.ifidx==WIFI_IF_AP?WiFi.softAPmacAddress().c_str():WiFi.macAddress().c_str(), + (*it)->peerInfo.peer_addr[0],(*it)->peerInfo.peer_addr[1],(*it)->peerInfo.peer_addr[2],(*it)->peerInfo.peer_addr[3],(*it)->peerInfo.peer_addr[4],(*it)->peerInfo.peer_addr[5], + (*it)->sendSize,(*it)->receiveSize,uxQueueSpacesAvailable((*it)->receiveQueue)); + } + Serial.print("\n*** End Info ***\n\n"); } break; @@ -2203,16 +2217,12 @@ SpanPoint::SpanPoint(const char *macAddress, int sendSize, int receiveSize, int this->sendSize=sendSize; this->receiveSize=receiveSize; - + if(receiveSize>0) WiFi.mode(WIFI_AP_STA); else if(WiFi.getMode()==WIFI_OFF) WiFi.mode(WIFI_STA); - Serial.printf("SpanPoint: Created link from (%s) to (%02X:%02X:%02X:%02X:%02X:%02X). Send size=%d bytes, Receive size=%d bytes with queue depth=%d.\n", - useAPaddress?WiFi.softAPmacAddress().c_str():WiFi.macAddress().c_str(), - peerInfo.peer_addr[0],peerInfo.peer_addr[1],peerInfo.peer_addr[2],peerInfo.peer_addr[3],peerInfo.peer_addr[4],peerInfo.peer_addr[5],sendSize,receiveSize,queueDepth); - init(); // initialize SpanPoint peerInfo.channel=0; // 0 = matches current WiFi channel