Пример #1
0
/*******************************************************************
* CLOSE THE SERVER MODE
********************************************************************/
uint8_t ESP8266::closeServer() {
	if (connectionMode(AT_TRUE) != NO_ERROR) {return ERROR_CONNECTION_MODE;}
	String _cmd = AT_CMD_SERVER_MODE;
	_cmd += "0";
	myESP8266->println(_cmd);
	return expectResponse(AT_RESP_OK);
}
Пример #2
0
/*******************************************************************
* SET THE SERVER MODE
* Configures the module in Server mode on the given port. From that 
* moment on, it will be possible to talk to the module on that port
* by opening a TCP connection on its IP (You can use Putty to do so)
********************************************************************/
uint8_t ESP8266::setServer(String _port) {
	if (connectionMode(AT_TRUE) != NO_ERROR) {return ERROR_CONNECTION_MODE;}
	String _cmd = AT_CMD_SERVER_MODE;
	serverPort = _port;
	_cmd += "1,";
	_cmd += _port;
	myESP8266->println(_cmd);
	return expectResponse(AT_RESP_OK);
}
// ---------------------------------------------------------------------------
// Unpackages TConnMonWLANNetwork from TPtrC descriptor
// ---------------------------------------------------------------------------
//
EXPORT_C TConnMonWLANNetwork TConnMonWLANNetwork::FromPtrC( const TPtrC& aPtrC )
    {

    TUint len( (TUint)aPtrC[ENameLength] );
    TBuf<KMaxNameLength> name( aPtrC.Mid(EName, len) );
    TUint connectionMode( aPtrC[len+EConnectionMode] );
    TUint signalStrength( aPtrC[len+ESignalStrength] );
    TUint securityMode( aPtrC[len+ESecurityMode] );

    RArray<TInt> buf;
    TUint count( aPtrC[len+EBufCounter] );
    for ( TUint i = 1; i < count+1; ++i )
        {
        buf.Append( aPtrC[len+EBufBase+i] );
        }
    TConnMonWLANNetwork connMonWLANNetwork = TConnMonWLANNetwork( name, 
            connectionMode, signalStrength, securityMode, buf );
    buf.Close();
    return connMonWLANNetwork;
    }