当前位置: 首页>>代码示例>>C++>>正文


C++ WebServer::addCommand方法代码示例

本文整理汇总了C++中WebServer::addCommand方法的典型用法代码示例。如果您正苦于以下问题:C++ WebServer::addCommand方法的具体用法?C++ WebServer::addCommand怎么用?C++ WebServer::addCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WebServer的用法示例。


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

示例1: InitializeGarageDoorWebserver

void InitializeGarageDoorWebserver()
{
  static uint8_t auLocalMAC[] = LOCAL_MAC_ADDRESS;
  static uint8_t auLocalIPAddress[] = LOCAL_IP_ADDRESS;

  AccessControlServer.setDefaultCommand(ShowWebRoot);
  AccessControlServer.addCommand("LetMeIn.html", CheckLogin);
  AccessControlServer.addCommand("index.html", ShowWebRoot);
  AccessControlServer.setFailureCommand(ShowPageNotFound);

  Ethernet.begin(auLocalMAC, auLocalIPAddress);
  AccessControlServer.begin();
}
开发者ID:VaughanHunt,项目名称:GarageDoorOpener,代码行数:13,代码来源:Webserver.cpp

示例2: setup

void setup() {
#if DEBUG
    Serial.begin(9600);
    Serial.println("Hello world.");
#endif
    
    /* setup our default command that will be run when the user accesses
     * the root page on the server */
    webserver.setDefaultCommand(&helloCmd);
    
    /* run the same command if you try to load /index.html, a common
     * default page name */
    webserver.addCommand("index.html", &helloCmd);
    
    /* start the webserver */
    webserver.begin();
}
开发者ID:corbinstreehouse,项目名称:Webduino,代码行数:17,代码来源:HelloWorld.cpp

示例3: init

/* ================================================================== *
 * Function: init
 * Description: Initialize the server
 * Parameters: none
 * ================================================================== */
void Server::init() {
    /* Default command accessed through http://ip_address */
    webserver.setDefaultCommand(&web_index);

    /* Command to handle web inputs, accessed through http://ip_address/web_input */
    webserver.addCommand("web_input", &web_input, this);

    /* start the webserver */
    webserver.begin();

    // Print the IP so we know where to connect
    Particle.variable("ipAddress", myIpAddress, STRING);
    IPAddress myIp = WiFi.localIP();
    sprintf(myIpAddress, "%d.%d.%d.%d", myIp[0], myIp[1], myIp[2], myIp[3]);

    power_status = SERVER_POWER_ON;
}
开发者ID:SuperUser320,项目名称:muse,代码行数:22,代码来源:server.cpp

示例4:

RestDhtApi::RestDhtApi(WebServer &server) {
	server.addCommand("dht", &RestDhtApi::dht);
}
开发者ID:jpfaria,项目名称:RestDhtApi,代码行数:3,代码来源:RestDhtApi.cpp

示例5:

RestApi::RestApi(WebServer &server) {
	server.addCommand("get", &RestApi::get);
	server.addCommand("put", &RestApi::put);
}
开发者ID:jpfaria,项目名称:RestApi,代码行数:4,代码来源:RestApi.cpp


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