private bool CheckNetworkJoined() { // Check if the network is initialised EzspNetworkStateRequest networkStateRequest = new EzspNetworkStateRequest(); IEzspTransaction networkStateTransaction = _protocolHandler.SendEzspTransaction(new EzspSingleResponseTransaction(networkStateRequest, typeof(EzspNetworkStateResponse))); EzspNetworkStateResponse networkStateResponse = (EzspNetworkStateResponse)networkStateTransaction.GetResponse(); Log.Debug(networkStateResponse.ToString()); Log.Debug("EZSP networkStateResponse {Status}", networkStateResponse.GetStatus()); return(networkStateResponse.GetStatus() == EmberNetworkStatus.EMBER_JOINED_NETWORK); }
/** * The command allows the Host to specify the desired EZSP version and must be sent before any other command. The * response provides information about the firmware running on the NCP. * * @param desiredVersion the requested version we support * @return the {@link EzspVersionResponse} */ public EzspVersionResponse GetVersion(int desiredVersion) { EzspVersionRequest request = new EzspVersionRequest(); request.SetDesiredProtocolVersion(EzspFrame.GetEzspVersion()); IEzspTransaction transaction = _protocolHandler.SendEzspTransaction(new EzspSingleResponseTransaction(request, typeof(EzspVersionResponse))); EzspVersionResponse response = (EzspVersionResponse)transaction.GetResponse(); if (response == null) { Log.Debug("No response from ezspVersion command"); return(null); } Log.Debug(response.ToString()); _lastStatus = EmberStatus.UNKNOWN; return(response); }