您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wifi_station_get_config函数代码示例

51自学网 2021-06-03 09:56:44
  C++
这篇教程C++ wifi_station_get_config函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中wifi_station_get_config函数的典型用法代码示例。如果您正苦于以下问题:C++ wifi_station_get_config函数的具体用法?C++ wifi_station_get_config怎么用?C++ wifi_station_get_config使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了wifi_station_get_config函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: dhconnector_init

void ICACHE_FLASH_ATTR dhconnector_init(dhconnector_command_json_cb cb) {	dhrequest_load_settings();	mCommandCallback = cb;	mConnectionState = CS_DISCONNECT;	dhrequest_create_info(&mInfoRequest);	dhrequest_create_register(&mRegisterRequest);	mPollRequest.len = mPollRequest.data[0] = 0;	wifi_set_opmode(STATION_MODE);	wifi_station_set_auto_connect(1);	wifi_station_set_reconnect_policy(true);	struct station_config stationConfig;	wifi_station_get_config(&stationConfig);	wifi_set_phy_mode(PHY_MODE_11N);	os_memset(stationConfig.ssid, 0, sizeof(stationConfig.ssid));	os_memset(stationConfig.password, 0, sizeof(stationConfig.password));	snprintf(stationConfig.ssid, sizeof(stationConfig.ssid), "%s", dhsettings_get_wifi_ssid());	snprintf(stationConfig.password, sizeof(stationConfig.password), "%s", dhsettings_get_wifi_password());	wifi_station_set_config(&stationConfig);	static esp_tcp tcp;	os_memset(&tcp, 0, sizeof(tcp));	os_memset(&mDHConnector, 0, sizeof(mDHConnector));	mDHConnector.type = ESPCONN_TCP;	mDHConnector.state = ESPCONN_NONE;	mDHConnector.proto.tcp = &tcp;	mDHConnector.proto.tcp->local_port = espconn_port();	wifi_set_event_handler_cb(wifi_state_cb);}
开发者ID:AntonioSolanoTarroc,项目名称:esp8266-firmware,代码行数:31,


示例2: printWifiInfo

// print various Wifi information into json bufferint ICACHE_FLASH_ATTR printWifiInfo(char *buff) {	int len;	struct station_config stconf;	wifi_station_get_config(&stconf);	uint8_t op = wifi_get_opmode() & 0x3;	char *mode = wifiMode[op];	char *status = "unknown";	int st = wifi_station_get_connect_status();	if (st > 0 && st < sizeof(connStatuses)) status = connStatuses[st];	int p = wifi_get_phy_mode();	char *phy = wifiPhy[p&3];	char *warn = wifiWarn[op];	sint8 rssi = wifi_station_get_rssi();	if (rssi > 0) rssi = 0;	uint8 mac_addr[6];	wifi_get_macaddr(0, mac_addr);	len = os_sprintf(buff,		"/"mode/": /"%s/", /"ssid/": /"%s/", /"status/": /"%s/", /"phy/": /"%s/", "		"/"rssi/": /"%ddB/", /"warn/": /"%s/", /"passwd/": /"%s/", "		"/"mac/":/"%02x:%02x:%02x:%02x:%02x:%02x/"",		mode, (char*)stconf.ssid, status, phy, rssi, warn, (char*)stconf.password,		mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]);	struct ip_info info;	if (wifi_get_ip_info(0, &info)) {		len += os_sprintf(buff+len, ", /"ip/": /"%d.%d.%d.%d/"",			(info.ip.addr>>0)&0xff, (info.ip.addr>>8)&0xff,			(info.ip.addr>>16)&0xff, (info.ip.addr>>24)&0xff);	} else {
开发者ID:alonewolfx2,项目名称:esp-link,代码行数:33,


示例3: tplWlan

//Template code for the WLAN page.void ICACHE_FLASH_ATTR tplWlan(HttpdConnData *connData, char *token, void **arg) {	char buff[1024];	int x;	static struct station_config stconf;	if (token==NULL) return;	wifi_station_get_config(&stconf);	os_strcpy(buff, "Unknown");	if (os_strcmp(token, "WiFiMode")==0) {		x=wifi_get_opmode();		if (x==1) os_strcpy(buff, "Client");		if (x==2) os_strcpy(buff, "SoftAP");		if (x==3) os_strcpy(buff, "STA+AP");	} else if (os_strcmp(token, "currSsid")==0) {		os_strcpy(buff, (char*)stconf.ssid);	} else if (os_strcmp(token, "WiFiPasswd")==0) {		os_strcpy(buff, (char*)stconf.password);	} else if (os_strcmp(token, "WiFiapwarn")==0) {		x=wifi_get_opmode();		if (x==2) {			os_strcpy(buff, "<b>Can't scan in this mode.</b> Click <a href=/"setmode.cgi?mode=3/">here</a> to go to STA+AP mode.");		} else {			os_strcpy(buff, "Click <a href=/"setmode.cgi?mode=2/">here</a> to go to standalone AP mode.");		}	}	espconn_sent(connData->conn, (uint8 *)buff, os_strlen(buff));}
开发者ID:bacl,项目名称:WiFiPhot0,代码行数:28,


示例4: setup_wifi_st_mode

void setup_wifi_st_mode(void){//	wifi_set_opmode((wifi_get_opmode()|STATION_MODE)&STATIONAP_MODE);	wifi_set_opmode(wifi_get_opmode() | STATION_MODE);	struct station_config stconfig;	wifi_station_disconnect();	wifi_station_dhcpc_stop();	if(wifi_station_get_config(&stconfig))		{		memset(stconfig.ssid, 0, sizeof(stconfig.ssid));		memset(stconfig.password, 0, sizeof(stconfig.password));		os_sprintf(stconfig.ssid, "%s", sysCfg.sta_ssid);		os_sprintf(stconfig.password, "%s", sysCfg.sta_pwd);		if(!wifi_station_set_config(&stconfig))			{			#ifdef PLATFORM_DEBUG			INFO("ESP8266 not set station config!/r/n");			#endif			}		}	wifi_station_connect();	wifi_station_dhcpc_start();	wifi_station_set_auto_connect(1);	#ifdef PLATFORM_DEBUG	INFO("ESP8266 in STA mode configured./r/n");	#endif}
开发者ID:aidanruff,项目名称:esp8266-MQTT-client,代码行数:28,


示例5: nixieTplWlan

int ICACHE_FLASH_ATTR nixieTplWlan(HttpdConnData *connData, char *token, void **arg) {    char buff[1024];    int x;    static struct station_config stconf;    if (token==NULL) return HTTPD_CGI_DONE;    wifi_station_get_config(&stconf);        os_strcpy(buff, "Unknown");    if (os_strcmp(token, "WiFiMode")==0) {        x=wifi_get_opmode();        if (x==1) os_strcpy(buff, "Client");        if (x==2) os_strcpy(buff, "SoftAP");        if (x==3) os_strcpy(buff, "Client+AP");    } else if (os_strcmp(token, "currSsid")==0) {        os_strcpy(buff, (char*)stconf.ssid);    } else if (os_strcmp(token, "WiFiPasswd")==0) {        os_strcpy(buff, (char*)stconf.password);    } else if (os_strcmp(token, "DeviceID")==0) {        uint8_t client_id[16];        os_sprintf(client_id, "%08X", system_get_chip_id());        os_strcpy(buff, (char*)client_id);    } else if (os_strcmp(token, "WiFiapwarn")==0) {        x=wifi_get_opmode();        if (x==2) {            os_strcpy(buff, "<b>Can't scan in this mode.</b><a href=/"setmode.cgi?mode=3/">Go to STA+AP mode.</a>");        } else if(x==1) {            os_strcpy(buff, "<a href=/"setmode.cgi?mode=3/">Go back to Client+AP mode.</a>");        } else {            os_strcpy(buff, "<a href=/"setmode.cgi?mode=1/">Go to Client Only Mode</a><br /> To reset hold Button for 5 sec and release");        }    }    httpdSend(connData, buff, -1);    return HTTPD_CGI_DONE;}
开发者ID:murf0,项目名称:esp_nixie,代码行数:34,


示例6: setup_station

void ICACHE_FLASH_ATTR setup_station(char ssid[], char password[]) {    // Stop previous connection    wifi_station_disconnect();    wifi_station_dhcpc_stop();    // Create config struct    struct station_config staConfig;    wifi_station_get_config(&staConfig);    // Set SSID in struct    os_memset(staConfig.ssid, 0, sizeof(staConfig.ssid));    os_memcpy(staConfig.ssid, ssid, os_strlen(ssid));    // Set Password in struct    os_memset(staConfig.password, 0, sizeof(staConfig.password));    os_memcpy(staConfig.password, password, os_strlen(password));    // Use config struct    wifi_station_set_config(&staConfig);    //print("Set Station info");    wifi_station_connect();    wifi_station_dhcpc_start();    wifi_station_set_auto_connect(1);    connection_status = CONNECTION_CONNECTING;}
开发者ID:withmaia,项目名称:maia-attinytemp,代码行数:26,


示例7: at_queryCmdCwjap

/**  * @brief  Query commad of join to wifi ap.  * @param  id: commad id number  * @retval None  */void ICACHE_FLASH_ATTRat_queryCmdCwjap(uint8_t id){  char temp[64];  struct station_config stationConf;  wifi_station_get_config(&stationConf);  struct ip_info pTempIp;  wifi_get_ip_info(0x00, &pTempIp);  if(pTempIp.ip.addr == 0)  {    at_backError;    //    os_sprintf(temp, at_backTeError, 4);    //    uart0_sendStr(at_backTeError"4/r/n");    return;  }  mdState = m_gotip;  if(stationConf.ssid != 0)  {    os_sprintf(temp, "%s:/"%s/"/r/n", at_fun[id].at_cmdName, stationConf.ssid);    uart0_sendStr(temp);    at_backOk;  }  else  {    at_backError;    //    os_sprintf(temp, at_backTeError, 5);    //    uart0_sendStr(at_backTeError"5/r/n");  }}
开发者ID:GPTO,项目名称:ESP8266-SSM,代码行数:35,


示例8: wifi_station_get_config

/** * Return the current bssid / mac associated with the network if configured * @return String bssid mac */String ESP8266WiFiSTAClass::BSSIDstr(void) {    struct station_config conf;    char mac[18] = { 0 };    wifi_station_get_config(&conf);    sprintf(mac, "%02X:%02X:%02X:%02X:%02X:%02X", conf.bssid[0], conf.bssid[1], conf.bssid[2], conf.bssid[3], conf.bssid[4], conf.bssid[5]);    return String(mac);}
开发者ID:Makuna,项目名称:Arduino,代码行数:11,


示例9: http_wifi_api_get_status

int http_wifi_api_get_status(http_connection *c){    CGI_WIFI_DBG("wifi get_status/n");    //wait for whole body    if(c->state <HTTPD_STATE_BODY_END) {        return HTTPD_CGI_MORE;    }    api_cgi_status * status = c->cgi.data;    //first call, send headers    if(status==NULL)    {        status = (api_cgi_status*)os_malloc(sizeof(api_cgi_status));        status->state=1;        c->cgi.data=status;        http_SET_HEADER(c,HTTP_CONTENT_TYPE,JSON_CONTENT_TYPE);        http_response_OK(c);        return HTTPD_CGI_MORE;    }    else if(status->state==1)    {        wifi_station_get_config(&wifi_status.station_config);        uint8_t c_status = wifi_station_get_connect_status();        //return JSON        cJSON *root = cJSON_CreateObject();        cJSON_AddBoolToObject(root,"scanning",wifi_status.scanning);        cJSON_AddStringToObject(root,"ssid",(const char *)wifi_status.station_config.ssid);        cJSON_AddNumberToObject(root,"mode",wifi_get_opmode());        cJSON_AddNumberToObject(root,"station_status",c_status);        //got ip        if(c_status==5)        {            struct ip_info ip;            wifi_get_ip_info(0x0,&ip);            char *ip_str = (char*)ipaddr_ntoa(&ip.ip);            cJSON_AddStringToObject(root,"ip",ip_str);        }        else {            cJSON_AddStringToObject(root,"ip","");        }        http_write_json(c,root);        cJSON_Delete(root);        status->state=99;        return HTTPD_CGI_MORE;    }    else    {        os_free(c->cgi.data);        return HTTPD_CGI_DONE;    }}
开发者ID:someburner,项目名称:esp-rfm69,代码行数:59,


示例10: configure

static ICACHE_FLASH_ATTR intconfigure(void){    char ch;    int ret;     static struct station_config st_config;    wifi_station_get_config(&st_config);    do    {        printf("/r/nConfiguration:/r/n");        printf("1: Wifi SSID [%s]/r/n", st_config.ssid);        printf("2: Wifi Password [%s]/r/n", st_config.password);        printf("3: HTTP host[%s]/r/n", user_config.host);        printf("4: HTTP port[%d]/r/n", user_config.port);        printf("5: HTTP path/query [%s]/r/n", user_config.get_cmd);        printf("0: Exit configuration/r/n");        // ch = uart_getchar();        xQueueReceive(xUARTQueue, &ch, -1);        switch (ch)        {        case '1':            printf("Enter Wifi SSID: ");            uart_gets(&xUARTQueue, st_config.ssid, 32);            break;        case '2':            printf("Enter Wifi Password: ");            uart_gets(&xUARTQueue, st_config.password, 64);            break;        case '3':            printf("Enter HTTP host: ");            uart_gets(&xUARTQueue, user_config.host, HOST_LEN+1);            break;        case '4':            printf("Enter HTTP port: ");            char buf[6];            uart_gets(&xUARTQueue, buf, 6);            user_config.port = atoi(buf);            break;        case '5':            printf("Enter HTTP path and query string: ");            uart_gets(&xUARTQueue, user_config.get_cmd, GET_LEN+1);            break;        case '0':            DBG("setting config [%s] [%s]/n", st_config.ssid, st_config.password);            wifi_station_set_config(&st_config);            save_user_config(&user_config);            break;        default:            printf("Invalid choice/r/n");        }    } while (ch != '0');    printf("System will now restart/r/n");    system_restart();}
开发者ID:Andrew-Collins,项目名称:esp8266-sdk,代码行数:54,


示例11: getSSID

String StationClass::getSSID(){	station_config config = {0};	if (!wifi_station_get_config(&config))	{		debugf("Can't read station configuration!");		return "";	}	debugf("SSID: %s", (char*)config.ssid);	return String((char*)config.ssid);}
开发者ID:0xPIT,项目名称:Sming,代码行数:11,


示例12: getPassword

String StationClass::getPassword(){	station_config config = {0};	if (!wifi_station_get_config(&config))	{		debugf("Can't read station configuration!");		return "";	}	debugf("Pass: %s", (char*)config.password);	return String((char*)config.password);}
开发者ID:0xPIT,项目名称:Sming,代码行数:11,


示例13: printWifiInfo

// print various Wifi information into json bufferint ICACHE_FLASH_ATTR printWifiInfo(char *buff) {  int len;    //struct station_config stconf;    wifi_station_get_config(&stconf);    //struct softap_config apconf;    wifi_softap_get_config(&apconf);    uint8_t op = wifi_get_opmode() & 0x3;    char *mode = wifiMode[op];    char *status = "unknown";    int st = wifi_station_get_connect_status();    if (st >= 0 && st < sizeof(connStatuses)) status = connStatuses[st];    int p = wifi_get_phy_mode();    char *phy = wifiPhy[p&3];    char *warn = wifiWarn[op];    if (op == 3) op = 4; // Done to let user switch to AP only mode from Soft-AP settings page, using only one set of warnings    char *apwarn = wifiWarn[op];    char *apauth = apAuthMode[apconf.authmode];    sint8 rssi = wifi_station_get_rssi();    if (rssi > 0) rssi = 0;    uint8 mac_addr[6];    uint8 apmac_addr[6];    wifi_get_macaddr(0, mac_addr);    wifi_get_macaddr(1, apmac_addr);    uint8_t chan = wifi_get_channel();    len = os_sprintf(buff,        "/"mode/": /"%s/", /"modechange/": /"%s/", /"ssid/": /"%s/", /"status/": /"%s/", "        "/"phy/": /"%s/", /"rssi/": /"%ddB/", /"warn/": /"%s/",  /"apwarn/": /"%s/", "        "/"mac/":/"%02x:%02x:%02x:%02x:%02x:%02x/", /"chan/":/"%d/", /"apssid/": /"%s/", "        "/"appass/": /"%s/", /"apchan/": /"%d/", /"apmaxc/": /"%d/", /"aphidd/": /"%s/", "        "/"apbeac/": /"%d/", /"apauth/": /"%s/",/"apmac/":/"%02x:%02x:%02x:%02x:%02x:%02x/"",        mode, MODECHANGE, (char*)stconf.ssid, status, phy, rssi, warn, apwarn,        mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5],        chan, (char*)apconf.ssid, (char*)apconf.password, apconf.channel, apconf.max_connection,        apconf.ssid_hidden?"enabled":"disabled", apconf.beacon_interval,        apauth,apmac_addr[0], apmac_addr[1], apmac_addr[2], apmac_addr[3], apmac_addr[4],        apmac_addr[5]);    struct ip_info info;    if (wifi_get_ip_info(0, &info)) {        len += os_sprintf(buff+len, ", /"ip/": /"%d.%d.%d.%d/"", IP2STR(&info.ip.addr));        len += os_sprintf(buff+len, ", /"netmask/": /"%d.%d.%d.%d/"", IP2STR(&info.netmask.addr));        len += os_sprintf(buff+len, ", /"gateway/": /"%d.%d.%d.%d/"", IP2STR(&info.gw.addr));        len += os_sprintf(buff+len, ", /"hostname/": /"%s/"", flashConfig.hostname);    } else {        len += os_sprintf(buff+len, ", /"ip/": /"-none-/"");    }    len += os_sprintf(buff+len, ", /"staticip/": /"%d.%d.%d.%d/"", IP2STR(&flashConfig.staticip));    len += os_sprintf(buff+len, ", /"dhcp/": /"%s/"", flashConfig.staticip > 0 ? "off" : "on");    return len;}
开发者ID:mroavi,项目名称:esp-link,代码行数:54,


示例14: wifi_station_get_config

/*JSON{  "type"     : "staticmethod",  "class"    : "ESP8266WiFi",  "name"     : "getStationConfig",  "generate" : "jswrap_ESP8266WiFi_getStationConfig",  "return"   : ["JsVar","A Station Config"],  "return_object" : "StationConfig"}*/JsVar *jswrap_ESP8266WiFi_getStationConfig() {  struct station_config config;  wifi_station_get_config(&config);  JsVar *jsConfig = jspNewObject(NULL, "StationConfig");  //char ssid[33];  //nullTerminateString(ssid, (char *)config.ssid, 32);  jsvUnLock(jsvObjectSetChild(jsConfig, "ssid", jsvNewFromString((char *)config.ssid)));  //char password[65];  //nullTerminateString(password, (char *)config.password, 64);  jsvUnLock(jsvObjectSetChild(jsConfig, "password", jsvNewFromString((char *)config.password)));  return jsConfig;}
开发者ID:RobinLin,项目名称:Espruino,代码行数:20,


示例15: user_sta_setup_config

void ICACHE_FLASH_ATTRuser_sta_setup_config(void){	// Build our Access Point configuration details	struct station_config config; 	wifi_station_get_config(&config);	os_memset(config.ssid, 0, 32);	os_memset(config.password, 0, 64);	os_memcpy(config.ssid, SSID, strlen(SSID));	os_memcpy(config.password, WIFI_KEY, strlen(WIFI_KEY));	config.bssid_set = 0; 	wifi_station_set_config(&config);}
开发者ID:joelluijmes,项目名称:druppel-avr,代码行数:15,


示例16: tplTcpServerStatus

//Template code for the Tcp server statusvoid ICACHE_FLASH_ATTR tplTcpServerStatus(HttpdConnData *connData, char *token, void **arg) {	char buff[512];	static struct station_config stconf;	if (token==NULL) return;	wifi_station_get_config(&stconf);	os_strcpy(buff, "Unknown");	if (os_strcmp(token, "WiFiSettings")==0) {		os_printf("-%s-%s Getting ip settings to replace token: %s /r/n", __FILE__, __func__, token);				char ipSettings[256] = { 0};		GetTcpServerStatus(ipSettings);		os_strcpy(buff, ipSettings);		os_printf("-%s-%s Found ip settings: %s /r/n", __FILE__, __func__, buff);			}	espconn_sent(connData->conn, (uint8 *)buff, os_strlen(buff));}
开发者ID:eeijcea,项目名称:ESP8266,代码行数:16,


示例17: wifiInit

void ICACHE_FLASH_ATTR wifiInit(int wifiMode){INFO("/r===== WiFi Init =====/r");wifi_set_opmode(0); // Clear all modesINFO("/r/nSetting WiFI/r/n");if(wifiMode & SOFTAP_MODE)	{	INFO("/rSetting SOFTAP Mode/r/n");	setup_wifi_ap_mode();	INFO("Done/r/n");	}if(wifiMode & STATION_MODE)	{	INFO("/rSetting Station Mode /r/n");	setup_wifi_st_mode();	INFO("Done/r/n");	}if(wifi_get_phy_mode() != PHY_MODE_11N)	wifi_set_phy_mode(PHY_MODE_11N);if(wifi_station_get_auto_connect() == 0)	wifi_station_set_auto_connect(1);INFO("Wi-Fi mode: %s/r/n", WiFiMode[wifi_get_opmode()]);if(wifiMode & SOFTAP_MODE)	{	struct softap_config apConfig;	if(wifi_softap_get_config(&apConfig))		{		INFO("AP config: SSID: %s, PASSWORD: %s/r/n",			apConfig.ssid,			apConfig.password);		}	}if(wifiMode & STATION_MODE)	{	struct station_config stationConfig;	if(wifi_station_get_config(&stationConfig))		{		INFO("STA config: SSID: %s, PASSWORD: %s/r/n",			stationConfig.ssid,			stationConfig.password);		}	}}
开发者ID:aidanruff,项目名称:esp8266-MQTT-client,代码行数:48,


示例18: wifi_enter_sta

void wifi_enter_sta(){	struct station_config config;	//Connect to the defined access point.	wifi_station_get_config(&config);	os_memset(&config, 0x0, sizeof(struct station_config));	strcpy(config.ssid, AP_NAME);	strcpy(config.password, AP_PASS);	wifi_set_opmode(STATIONAP_MODE);	wifi_station_set_config(&config);	wifi_station_disconnect();	wifi_station_connect();}
开发者ID:fernandomorse,项目名称:noduino-sdk,代码行数:16,


示例19: connectToAp

void ICACHE_FLASH_ATTR connectToAp() {    char * ap = "LedAccess";    char * pass = "test12345";    wifi_set_phy_mode( PHY_MODE_11N );    struct station_config apconf;    wifi_station_set_auto_connect(true);    wifi_set_opmode(STATION_MODE);    wifi_station_get_config(&apconf);    strncpy((char*)apconf.ssid, ap, 32);    printf("connecting to: %s", apconf.ssid);    strncpy((char*)apconf.password, pass, 64);    wifi_station_set_config(&apconf);    wifi_promiscuous_enable(1);    //wifi_set_event_handler_cb(wifi_event_cb);}
开发者ID:houzhenggang,项目名称:ESP8266-3,代码行数:16,


示例20: at_queryCmdCwjap

/**  * @brief  Query commad of join to wifi ap.  * @param  id: commad id number  * @retval None  */void ICACHE_FLASH_ATTRat_queryCmdCwjap(uint8_t id){  char temp[64];  struct station_config stationConf;  wifi_station_get_config(&stationConf);  if(stationConf.ssid != 0)  {    os_sprintf(temp, "%s:/"%s/"/r/n", at_fun[id].at_cmdName, stationConf.ssid);    uart0_sendStr(temp);    at_backOk;  }  else  {    at_backError;  }}
开发者ID:EUA,项目名称:esp8266,代码行数:22,


示例21: user_init

/****************************************************************************** * FunctionName : user_init * Description  : entry of user application, init user function here * Parameters   : none * Returns      : none*******************************************************************************/void ICACHE_FLASH_ATTR user_init(void){	int i;    // rom use 74880 baut_rate, here reinitialize    uart_init(BIT_RATE_115200, BIT_RATE_115200);	uart_tx_one_char('/r');	__printf("NodeLua %s (With liblua %s) Copyright (C) 2014 NodeLua.org free mem=%d/n", NODELUA_RELEASE NODELUA_RELEASE_LOC, LUA_RELEASE, system_get_free_heap_size());	// char *argv[] = {"lua", "-e", (char*)buf};	// for(i = 0; 1; i ++)	// {	// 	uint16_t val = system_adc_read();	// 	__printf("adc=%d/n", val);	// 	luamain(sizeof(argv)/sizeof(char*), argv);	// }    struct station_config config;    wifi_station_get_config(&config);	if (wifi_get_opmode() == STATION_MODE && os_strlen(config.ssid) > 0)	{		os_timer_disarm(&check_sta_timer);		os_timer_setfn(&check_sta_timer, (os_timer_func_t *)user_check_ip, 1);		os_timer_arm(&check_sta_timer, 100, 0);	}	else	{		__printf("Please set wifi parameters to connect to an exist AP!/n");		luainit("");	}	return;// #if ESP_PLATFORM//     user_esp_platform_init();// #endif////     user_devicefind_init();// #ifdef SERVER_SSL_ENABLE//     user_webserver_init(SERVER_SSL_PORT);// #else//     user_webserver_init(SERVER_PORT);// #endif}
开发者ID:Squonk42,项目名称:nodelua,代码行数:51,


示例22: GetWifiConfig

void ICACHE_FLASH_ATTRGetWifiConfig(char * data){  struct softap_config apConfig;  struct station_config stationConfig;  os_printf("-%s-%s /r/n", __FILE__, __func__);   wifi_station_get_config(&stationConfig);  wifi_softap_get_config(&apConfig);  os_sprintf(data, " /"%s/",/"%s/",%d,%d <br />/r/n",             apConfig.ssid,             apConfig.password,             apConfig.channel,             apConfig.authmode);  os_sprintf(data, "%s /"%s/",/"%s/"<br />/r/n",             data,             stationConfig.ssid,             stationConfig.password);}
开发者ID:eeijcea,项目名称:ESP8266,代码行数:19,


示例23: connect_st_mode

// ----------------------------------------------------------------------------// Set up and connect for STA Mode// ----------------------------------------------------------------------------void connect_st_mode(void){     struct station_config stconfig;     wifi_set_opmode(STATION_MODE);     wifi_station_disconnect();       // just in case     wifi_station_dhcpc_stop();     if(wifi_station_get_config(&stconfig))  {         os_memset(stconfig.ssid,     0, sizeof(stconfig.ssid));         os_memset(stconfig.password, 0, sizeof(stconfig.password));         os_sprintf((char *)stconfig.ssid,     "%s", WIFI_CLIENTSSID);         os_sprintf((char *)stconfig.password, "%s", WIFI_CLIENTPASSWORD);         if(!wifi_station_set_config(&stconfig)) {             os_printf("ESP8266 not set station config!/n");        }    }    wifi_station_connect();    wifi_station_dhcpc_start();    os_printf("ESP8266 in STA mode configured./n");}
开发者ID:donnaware,项目名称:ESP8266,代码行数:22,


示例24: isEnabled

bool StationClass::config(String ssid, String password, bool autoConnectOnStartup /* = true*/){	station_config config = {0};	if (ssid.length() >= sizeof(config.ssid)) return false;	if (password.length() >= sizeof(config.password)) return false;	bool enabled = isEnabled();	bool dhcp = isEnabledDHCP();	enable(true); // Power on for configuration	wifi_station_disconnect();	if (dhcp) enableDHCP(false);	bool cfgreaded = wifi_station_get_config(&config);	if (!cfgreaded) debugf("Can't read station configuration!");	memset(config.ssid, 0, sizeof(config.ssid));	memset(config.password, 0, sizeof(config.password));	config.bssid_set = false;	strcpy((char*)config.ssid, ssid.c_str());	strcpy((char*)config.password, password.c_str());	noInterrupts();	if(!wifi_station_set_config(&config))	{		interrupts();		debugf("Can't set station configuration!");		wifi_station_connect();		enableDHCP(dhcp);		enable(enabled);		return false;	}	debugf("Station configuration was updated to: %s", ssid.c_str());	interrupts();	wifi_station_connect();	enableDHCP(dhcp);	enable(enabled);	wifi_station_set_auto_connect(autoConnectOnStartup);	return true;}
开发者ID:0xPIT,项目名称:Sming,代码行数:43,


示例25: wifi_station_get_config

void WiFiConnector::use_smartconfig_wifi(){    static struct station_config conf;    wifi_station_get_config(&conf);    const char* ssid = reinterpret_cast<const char*>(conf.ssid);    WIFI_DEBUG_PRINT("SSID (");    WIFI_DEBUG_PRINT(strlen(ssid));    WIFI_DEBUG_PRINT("): ");    WIFI_DEBUG_PRINTLN(ssid);    const char* password = reinterpret_cast<const char*>(conf.password);    WIFI_DEBUG_PRINT("PASSWORD (");    WIFI_DEBUG_PRINT(strlen(password));    WIFI_DEBUG_PRINT("): ");    WIFI_DEBUG_PRINTLN(password);    init_config(ssid, password);}
开发者ID:Avtomat4ik,项目名称:WiFiConnector,代码行数:19,


示例26: wifi_station_getconfig

/**  * wifi.sta.getconfig()  * Description:  * 	Get current Station configuration.  * 	Note:  if bssid_set==1 STATION is configured to connect to specified BSSID  * 		   if bssid_set==0 specified BSSID address is irrelevant.  * Syntax:  * 	ssid, pwd, bssid_set, bssid=wifi.sta.getconfig()  * Parameters:  * 	none  * Returns:  * 	SSID, Password, BSSID_set, BSSID  */static int wifi_station_getconfig( lua_State* L ){	struct station_config sta_conf;	char bssid[17];	wifi_station_get_config(&sta_conf);	if(sta_conf.ssid==0)	{		lua_pushnil(L);	    return 1;	}	else	{	    lua_pushstring( L, sta_conf.ssid );	    lua_pushstring( L, sta_conf.password );	    lua_pushinteger( L, sta_conf.bssid_set);	    c_sprintf(bssid, MACSTR, MAC2STR(sta_conf.bssid));	    lua_pushstring( L, bssid);	    return 4;	}}
开发者ID:tjclement,项目名称:nodemcu-firmware,代码行数:33,


示例27: tplWlan

//Template code for the WLAN page.void ICACHE_FLASH_ATTR tplWlan(HttpdConnData *connData, char *token, void **arg) {	char buff[1024];	int x;	static struct station_config stconf;	if (token==NULL) return;	wifi_station_get_config(&stconf);	os_strcpy(buff, "Unknown");	if (os_strcmp(token, "WiFiMode")==0) {		x=wifi_get_opmode();		if (x==1) os_strcpy(buff, "Client");		if (x==2) os_strcpy(buff, "SoftAP");		if (x==3) os_strcpy(buff, "STA+AP");	} else if (os_strcmp(token, "currSsid")==0) {		os_strcpy(buff, (char*)stconf.ssid);	} else if (os_strcmp(token, "WiFiPasswd")==0) {		os_strcpy(buff, (char*)stconf.password);	}	espconn_sent(connData->conn, (uint8 *)buff, os_strlen(buff));}
开发者ID:Informatic,项目名称:esphttpd,代码行数:21,


示例28: setup_wifi_st_mode

LOCAL void ICACHE_FLASH_ATTR setup_wifi_st_mode(void){	wifi_set_opmode(STATION_MODE);	struct station_config stconfig;	wifi_station_disconnect();	wifi_station_dhcpc_stop();	if(wifi_station_get_config(&stconfig))	{		os_memcpy(&stconfig.ssid, WIFI_CLIENTSSID, sizeof(WIFI_CLIENTSSID));		os_memcpy(&stconfig.password, WIFI_CLIENTPASSWORD, sizeof(WIFI_CLIENTPASSWORD));		wifi_station_set_config(&stconfig);		ets_uart_printf("SSID: %s/n",stconfig.ssid);		stringDraw(2, 1, (char*)stconfig.ssid);	}	wifi_station_connect();	wifi_station_dhcpc_start();	wifi_station_set_auto_connect(1);	ets_uart_printf("STA mode/n");}
开发者ID:LeandroTE,项目名称:ESP8266,代码行数:20,



注:本文中的wifi_station_get_config函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ wifi_station_get_connect_status函数代码示例
C++ wifi_station_disconnect函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。