Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Decompiled with JetBrains decompiler
- // Type: Rinnai.NetworkerSystem.API.CNetworker
- // Assembly: API, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
- // MVID: 9E1B7773-F300-4632-970B-75E74F11BA63
- // Assembly location: C:\Users\Mitch\Documents\rinnaitouchDecom\resources\assemblies\API.dll
- using NetworkerSystem.NBWControlWIFIAccess;
- using Rinnai.NetworkerSystem.API.NBWControl;
- using Rinnai.NetworkerSystem.API.NBWControl.Settings;
- using Rinnai.NetworkerSystem.API.NBWControlWIFIAccess;
- using Rinnai.NetworkerSystem.API.NetworkerSystemAccess.Functional.Cooling;
- using Rinnai.NetworkerSystem.API.NetworkerSystemAccess.Functional.Evpcool;
- using Rinnai.NetworkerSystem.API.NetworkerSystemAccess.Functional.Heating;
- using Rinnai.NetworkerSystem.API.NetworkerSystemAccess.Functional.System;
- using Rinnai.NetworkerSystem.API.NetworkerSystemAccess.Interface;
- using Rinnai.NetworkerSystem.API.NetworkerSystemAccess.TransferControl;
- using Rinnai.NetworkerSystem.API.Timing;
- using System;
- using System.Text;
- using System.Threading.Tasks;
- namespace Rinnai.NetworkerSystem.API
- {
- public class CNetworker
- {
- private bool _waitingForFirstCommand = true;
- private CNBWControl _nbwControl;
- private CCommandInterface _commandInterface;
- private CSystem _system;
- private CMode _mode;
- private CContainer _rxContainer;
- private CTransferControl _transferControl;
- private CTimer _commandIssueTxResponseTimeoutTimer;
- private int _sequenceControlTxValue;
- private int _sequenceControlRxValue;
- private CNetworker.CONNECT_TYPE _connectType;
- private int _commandResponseTimeoutSeconds;
- private const string _CMD_CONFIG = "C";
- private const string _CMD_NETWORKER = "N";
- public CNetworker()
- {
- this._nbwControl = new CNBWControl("C", (Action<string>) (message =>
- {
- EventHandler<string> networkerDebugMessage = this.Networker_DebugMessage;
- if (networkerDebugMessage == null)
- return;
- networkerDebugMessage((object) this, message);
- }));
- this._nbwControl.WIFI_MessageReceived += new EventHandler<CMessageEventArgs>(this.NBWControl_WIFI_MessageReceived);
- this._nbwControl.WIFI_HostConnected += new EventHandler(this.NBWControl_WIFI_HostConnected);
- this._nbwControl.WIFI_HostInactivityDetected += new EventHandler(this.NBWControl_WIFI_HostInactivityDetected);
- this._nbwControl.WIFI_UserInactivityDetected += new EventHandler(this.NBWControl_WIFI_UserInactivityDetected);
- this._nbwControl.WIFI_HostConnectTimeout += new EventHandler(this.NBWControl_WIFI_HostConnectTimeout);
- this._nbwControl.WIFI_HostDisconnected += new EventHandler(this.NBWControl_WIFI_HostDisconnected);
- this._nbwControl.WIFI_HostLocated += new EventHandler(this.NBWControl_WIFI_HostLocated);
- this._nbwControl.WIFI_HostLocateTimeout += new EventHandler(this.NBWControl_WIFI_HostLocateTimeout);
- this._nbwControl.HUB.MessageSentAcknowledged += new EventHandler<CMessageEventArgs>(this.NBWControl_HUB_MessageSentAcknowledged);
- this._nbwControl.HUB.MessageReceived += new EventHandler<CMessageEventArgs>(this.NBWControl_HUB_MessageReceived);
- this._nbwControl.HUB.HostConnected += new EventHandler(this.NBWControl_HUB_HostConnected);
- this._nbwControl.HUB.HostInactivityDetected += new EventHandler(this.NBWControl_HUB_HostInactivityDetected);
- this._nbwControl.HUB.UserInactivityDetected += new EventHandler(this.NBWControl_HUB_UserInactivityDetected);
- this._nbwControl.HUB.HostConnectTimeout += new EventHandler(this.NBWControl_HUB_HostConnectTimeout);
- this._nbwControl.HUB.HostDisonnected += new EventHandler(this.NBWControl_HUB_HostDisonnected);
- this._nbwControl.GetSettingCommandResponse_WIFI_UserDefinedSSID += new EventHandler<CNBWControl.CGetSetSettingCommandResponseEventArgs>(this.NBWControl_GetSettingCommandResponse_WIFI_UserDefinedSSID);
- this._nbwControl.GetSettingCommandResponse_WIFI_TCPNoMessageReceivedTimeout += new EventHandler<CNBWControl.CGetSetSettingCommandResponseEventArgs>(this.NBWControl_GetSettingCommandResponse_WIFI_TCPNoMessageReceivedTimeout);
- this._nbwControl.GetSettingCommandResponse_HUB_DevicePrimaryKey += new EventHandler<CNBWControl.CGetSetSettingCommandResponseEventArgs>(this.NBWControl_GetSettingCommandResponse_HUB_DevicePrimaryKey);
- this._nbwControl.GetSettingCommandResponse_HUB_EventHubEndpoint += new EventHandler<CNBWControl.CGetSetSettingCommandResponseEventArgs>(this.NBWControl_GetSettingCommandResponse_HUB_EventHubEndpoint);
- this._nbwControl.GetSettingCommandResponse_HUB_UserInactivityTimeout += new EventHandler<CNBWControl.CGetSetSettingCommandResponseEventArgs>(this.NBWControl_GetSettingCommandResponse_HUB_UserInactivityTimeout);
- this._nbwControl.GetSettingCommandResponse_HUB_IOTHUBServicePrimaryKey += new EventHandler<CNBWControl.CGetSetSettingCommandResponseEventArgs>(this.NBWControl_GetSettingCommandResponse_HUB_IOTHUBServicePrimaryKey);
- this._nbwControl.GetSettingCommandResponse_HUB_IOTHUBServiceSecondaryKey += new EventHandler<CNBWControl.CGetSetSettingCommandResponseEventArgs>(this.NBWControl_GetSettingCommandResponse_HUB_IOTHUBServiceSecondaryKey);
- this._nbwControl.GetSettingCommandResponse_MQTT_Broker_ServerAddress += new EventHandler<CNBWControl.CGetSetSettingCommandResponseEventArgs>(this.NBWControl_GetSettingCommandResponse_MQTT_Broker_ServerAddress);
- this._nbwControl.GetSettingCommandResponse_MQTT_Config_ClientID += new EventHandler<CNBWControl.CGetSetSettingCommandResponseEventArgs>(this.NBWControl_GetSettingCommandResponse_MQTT_Config_ClientID);
- this._nbwControl.SetSettingCommandResponse_WIFI_UserDefinedSSID += new EventHandler<CNBWControl.CGetSetSettingCommandResponseEventArgs>(this.NBWControl_SetSettingCommandResponse_WIFI_UserDefinedSSID);
- this._nbwControl.SetSettingCommandResponse_WIFI_UserDefinedSSIDPassword += new EventHandler<CNBWControl.CGetSetSettingCommandResponseEventArgs>(this.NBWControl_SetSettingCommandResponse_WIFI_UserDefinedSSIDPassword);
- this._nbwControl.SetSettingCommandResponse_WIFI_JoinType += new EventHandler<CNBWControl.CGetSetSettingCommandResponseEventArgs>(this.NBWControl_SetSettingCommandResponse_WIFI_JoinType);
- this._nbwControl.SetSettingCommandResponse_MQTTGeneral_EnableConnection += new EventHandler<CNBWControl.CGetSetSettingCommandResponseEventArgs>(this.NBWControl_SetSettingCommandResponse_MQTTGeneral_EnableConnection);
- this._nbwControl.SetSettingCommandResponse_Save += new EventHandler<CNBWControl.CGetSetSettingCommandResponseEventArgs>(this.NBWControl_SetSettingCommandResponse_Save);
- this._nbwControl.SetSettingCommandResponse_Boot += new EventHandler<CNBWControl.CGetSetSettingCommandResponseEventArgs>(this.NBWControl_SetSettingCommandResponse_Boot);
- this._nbwControl.SetSettingCommandResponse_Hash += new EventHandler<CNBWControl.CGetSetSettingCommandResponseEventArgs>(this.NBWControl_SetSettingCommandResponse_Hash);
- this.CommandInterpreter_Init();
- this.SystemFunctional_Init();
- this.Connection_Init();
- }
- public bool NBWControlModuleInConfigMode
- {
- get
- {
- return this._nbwControl.ModuleInConfigMode;
- }
- }
- public byte NBWControlModuleVersion
- {
- get
- {
- return this._nbwControl.ModuleVersion;
- }
- }
- public byte NBWControlCC3200Version
- {
- get
- {
- return this._nbwControl.CC3200Version;
- }
- }
- public CWIFIAccess.WLANAccessMode NBWControlWiFiAccessMode
- {
- get
- {
- return this._nbwControl.WiFiAccessMode;
- }
- }
- public byte[] NBWControlHUBAccessHash
- {
- get
- {
- return this._nbwControl.HUBAccessHash;
- }
- }
- public string DeviceDefaultPassword
- {
- get
- {
- return this._nbwControl.DeviceDefaultPassword;
- }
- }
- public byte NBWControlNumberOfScannedSSIDs
- {
- get
- {
- return this._nbwControl.NumberOfScannedSSIDs;
- }
- }
- public CScannedSSID[] NBWControlScannedSSID
- {
- get
- {
- return this._nbwControl.ScannedSSID;
- }
- }
- public byte[] GenerateHUBAccessHashAsArray(string ssid, string ssidPassword)
- {
- return this._nbwControl.GenerateHUBAccessHashAsArray(ssid, ssidPassword);
- }
- public event EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> NBWControl_ConfigCommandResponseValid_GetUserDefinedSSID;
- public event EventHandler NBWControl_ConfigCommandResponseError_GetUserDefinedSSID;
- public event EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> NBWControl_ConfigCommandResponseValid_GetTCPNoMessageReceivedTimeout;
- public event EventHandler NBWControl_ConfigCommandResponseError_GetTCPNoMessageReceivedTimeout;
- public event EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> NBWControl_ConfigCommandResponseValid_GetIOTHUBServicePrimaryKey;
- public event EventHandler NBWControl_ConfigCommandResponseError_GetIOTHUBServicePrimaryKey;
- public event EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> NBWControl_ConfigCommandResponseValid_GetIOTHUBServiceSecondaryKey;
- public event EventHandler NBWControl_ConfigCommandResponseError_GetIOTHUBServiceSecondaryKey;
- public event EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> NBWControl_ConfigCommandResponseValid_GetDevicePrimaryKey;
- public event EventHandler NBWControl_ConfigCommandResponseError_GetDevicePrimaryKey;
- public event EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> NBWControl_ConfigCommandResponseValid_GetEventHubEndpoint;
- public event EventHandler NBWControl_ConfigCommandResponseError_GetEventHubEndpoint;
- public event EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> NBWControl_ConfigCommandResponseValid_GetUserInactivityTimeout;
- public event EventHandler NBWControl_ConfigCommandResponseError_GetUserInactivityTimeout;
- public event EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> NBWControl_ConfigCommandResponseValid_GetMQTTBrokerServerAddress;
- public event EventHandler NBWControl_ConfigCommandResponseError_GetMQTTBrokerServerAddress;
- public event EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> NBWControl_ConfigCommandResponseValid_GetMQTTConfigClientID;
- public event EventHandler NBWControl_ConfigCommandResponseError_GetMQTTConfigClientID;
- public void NBWControl_ConfigurationCommandIssue_GetUserDefinedSSID(string defaultAccessPassword)
- {
- this._nbwControl.ConfigurationCommandIssue_GetUserDefinedSSID(defaultAccessPassword);
- }
- private void NBWControl_GetSettingCommandResponse_WIFI_UserDefinedSSID(
- object sender,
- CNBWControl.CGetSetSettingCommandResponseEventArgs e)
- {
- if (e.TagResponse.ValueGetState == CTag.VALUE_GET_STATE.GOT)
- {
- CNetworker.CNetworkerNBWControlSettingAccessEventArgs e1 = new CNetworker.CNetworkerNBWControlSettingAccessEventArgs(e.TagResponse.Value);
- EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> getUserDefinedSsid = this.NBWControl_ConfigCommandResponseValid_GetUserDefinedSSID;
- if (getUserDefinedSsid == null)
- return;
- getUserDefinedSsid((object) this, e1);
- }
- else
- {
- EventHandler getUserDefinedSsid = this.NBWControl_ConfigCommandResponseError_GetUserDefinedSSID;
- if (getUserDefinedSsid != null)
- getUserDefinedSsid((object) this, (EventArgs) null);
- }
- }
- public void NBWControl_ConfigurationCommandIssue_GetTCPNoMessageReceivedTimeout(
- string defaultAccessPassword)
- {
- this._nbwControl.ConfigurationCommandIssue_GetTCPNoMessageReceivedTimeout(defaultAccessPassword);
- }
- private void NBWControl_GetSettingCommandResponse_WIFI_TCPNoMessageReceivedTimeout(
- object sender,
- CNBWControl.CGetSetSettingCommandResponseEventArgs e)
- {
- if (e.TagResponse.ValueGetState == CTag.VALUE_GET_STATE.GOT)
- {
- CNetworker.CNetworkerNBWControlSettingAccessEventArgs e1 = new CNetworker.CNetworkerNBWControlSettingAccessEventArgs(e.TagResponse.Value);
- EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> messageReceivedTimeout = this.NBWControl_ConfigCommandResponseValid_GetTCPNoMessageReceivedTimeout;
- if (messageReceivedTimeout == null)
- return;
- messageReceivedTimeout((object) this, e1);
- }
- else
- {
- EventHandler messageReceivedTimeout = this.NBWControl_ConfigCommandResponseError_GetTCPNoMessageReceivedTimeout;
- if (messageReceivedTimeout != null)
- messageReceivedTimeout((object) this, (EventArgs) null);
- }
- }
- public void NBWControl_ConfigurationCommandIssue_GetIOTHUBServicePrimaryKey(
- string defaultAccessPassword)
- {
- this._nbwControl.ConfigurationCommandIssue_GetIOTHUBServicePrimaryKey(defaultAccessPassword);
- }
- private void NBWControl_GetSettingCommandResponse_HUB_IOTHUBServicePrimaryKey(
- object sender,
- CNBWControl.CGetSetSettingCommandResponseEventArgs e)
- {
- if (e.TagResponse.ValueGetState == CTag.VALUE_GET_STATE.GOT)
- {
- CNetworker.CNetworkerNBWControlSettingAccessEventArgs e1 = new CNetworker.CNetworkerNBWControlSettingAccessEventArgs(e.TagResponse.Value);
- EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> servicePrimaryKey = this.NBWControl_ConfigCommandResponseValid_GetIOTHUBServicePrimaryKey;
- if (servicePrimaryKey == null)
- return;
- servicePrimaryKey((object) this, e1);
- }
- else
- {
- EventHandler servicePrimaryKey = this.NBWControl_ConfigCommandResponseError_GetIOTHUBServicePrimaryKey;
- if (servicePrimaryKey != null)
- servicePrimaryKey((object) this, (EventArgs) null);
- }
- }
- public void NBWControl_ConfigurationCommandIssue_GetIOTHUBServiceSecondaryKey(
- string defaultAccessPassword)
- {
- this._nbwControl.ConfigurationCommandIssue_GetIOTHUBServiceSecondaryKey(defaultAccessPassword);
- }
- private void NBWControl_GetSettingCommandResponse_HUB_IOTHUBServiceSecondaryKey(
- object sender,
- CNBWControl.CGetSetSettingCommandResponseEventArgs e)
- {
- if (e.TagResponse.ValueGetState == CTag.VALUE_GET_STATE.GOT)
- {
- CNetworker.CNetworkerNBWControlSettingAccessEventArgs e1 = new CNetworker.CNetworkerNBWControlSettingAccessEventArgs(e.TagResponse.Value);
- EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> serviceSecondaryKey = this.NBWControl_ConfigCommandResponseValid_GetIOTHUBServiceSecondaryKey;
- if (serviceSecondaryKey == null)
- return;
- serviceSecondaryKey((object) this, e1);
- }
- else
- {
- EventHandler serviceSecondaryKey = this.NBWControl_ConfigCommandResponseError_GetIOTHUBServiceSecondaryKey;
- if (serviceSecondaryKey != null)
- serviceSecondaryKey((object) this, (EventArgs) null);
- }
- }
- public void NBWControl_ConfigurationCommandIssue_GetDevicePrimaryKey(
- string defaultAccessPassword)
- {
- this._nbwControl.ConfigurationCommandIssue_GetDevicePrimaryKey(defaultAccessPassword);
- }
- private void NBWControl_GetSettingCommandResponse_HUB_DevicePrimaryKey(
- object sender,
- CNBWControl.CGetSetSettingCommandResponseEventArgs e)
- {
- if (e.TagResponse.ValueGetState == CTag.VALUE_GET_STATE.GOT)
- {
- CNetworker.CNetworkerNBWControlSettingAccessEventArgs e1 = new CNetworker.CNetworkerNBWControlSettingAccessEventArgs(e.TagResponse.Value);
- EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> devicePrimaryKey = this.NBWControl_ConfigCommandResponseValid_GetDevicePrimaryKey;
- if (devicePrimaryKey == null)
- return;
- devicePrimaryKey((object) this, e1);
- }
- else
- {
- EventHandler devicePrimaryKey = this.NBWControl_ConfigCommandResponseError_GetDevicePrimaryKey;
- if (devicePrimaryKey != null)
- devicePrimaryKey((object) this, (EventArgs) null);
- }
- }
- public void NBWControl_ConfigurationCommandIssue_GetEventHubEndpoint(
- string defaultAccessPassword)
- {
- this._nbwControl.ConfigurationCommandIssue_GetEventHubEndpoint(defaultAccessPassword);
- }
- private void NBWControl_GetSettingCommandResponse_HUB_EventHubEndpoint(
- object sender,
- CNBWControl.CGetSetSettingCommandResponseEventArgs e)
- {
- if (e.TagResponse.ValueGetState == CTag.VALUE_GET_STATE.GOT)
- {
- CNetworker.CNetworkerNBWControlSettingAccessEventArgs e1 = new CNetworker.CNetworkerNBWControlSettingAccessEventArgs(e.TagResponse.Value);
- EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> eventHubEndpoint = this.NBWControl_ConfigCommandResponseValid_GetEventHubEndpoint;
- if (eventHubEndpoint == null)
- return;
- eventHubEndpoint((object) this, e1);
- }
- else
- {
- EventHandler eventHubEndpoint = this.NBWControl_ConfigCommandResponseError_GetEventHubEndpoint;
- if (eventHubEndpoint != null)
- eventHubEndpoint((object) this, (EventArgs) null);
- }
- }
- public void NBWControl_ConfigurationCommandIssue_GetUserInactivityTimeout(
- string defaultAccessPassword)
- {
- this._nbwControl.ConfigurationCommandIssue_GetUserInactivityTimeout(defaultAccessPassword);
- }
- private void NBWControl_GetSettingCommandResponse_HUB_UserInactivityTimeout(
- object sender,
- CNBWControl.CGetSetSettingCommandResponseEventArgs e)
- {
- if (e.TagResponse.ValueGetState == CTag.VALUE_GET_STATE.GOT)
- {
- CNetworker.CNetworkerNBWControlSettingAccessEventArgs e1 = new CNetworker.CNetworkerNBWControlSettingAccessEventArgs(e.TagResponse.Value);
- EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> inactivityTimeout = this.NBWControl_ConfigCommandResponseValid_GetUserInactivityTimeout;
- if (inactivityTimeout == null)
- return;
- inactivityTimeout((object) this, e1);
- }
- else
- {
- EventHandler inactivityTimeout = this.NBWControl_ConfigCommandResponseError_GetUserInactivityTimeout;
- if (inactivityTimeout != null)
- inactivityTimeout((object) this, (EventArgs) null);
- }
- }
- public void NBWControl_ConfigurationCommandIssue_GetMQTTBrokerServerAddress(
- string defaultAccessPassword)
- {
- this._nbwControl.ConfigurationCommandIssue_GetMQTTBrokerServerAddress(defaultAccessPassword);
- }
- private void NBWControl_GetSettingCommandResponse_MQTT_Broker_ServerAddress(
- object sender,
- CNBWControl.CGetSetSettingCommandResponseEventArgs e)
- {
- if (e.TagResponse.ValueGetState == CTag.VALUE_GET_STATE.GOT)
- {
- CNetworker.CNetworkerNBWControlSettingAccessEventArgs e1 = new CNetworker.CNetworkerNBWControlSettingAccessEventArgs(e.TagResponse.Value);
- EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> brokerServerAddress = this.NBWControl_ConfigCommandResponseValid_GetMQTTBrokerServerAddress;
- if (brokerServerAddress == null)
- return;
- brokerServerAddress((object) this, e1);
- }
- else
- {
- EventHandler brokerServerAddress = this.NBWControl_ConfigCommandResponseError_GetMQTTBrokerServerAddress;
- if (brokerServerAddress != null)
- brokerServerAddress((object) this, (EventArgs) null);
- }
- }
- public void NBWControl_ConfigurationCommandIssue_GetMQTTConfigClientID(
- string defaultAccessPassword)
- {
- this._nbwControl.ConfigurationCommandIssue_GetMQTTConfigClientID(defaultAccessPassword);
- }
- private void NBWControl_GetSettingCommandResponse_MQTT_Config_ClientID(
- object sender,
- CNBWControl.CGetSetSettingCommandResponseEventArgs e)
- {
- if (e.TagResponse.ValueGetState == CTag.VALUE_GET_STATE.GOT)
- {
- CNetworker.CNetworkerNBWControlSettingAccessEventArgs e1 = new CNetworker.CNetworkerNBWControlSettingAccessEventArgs(e.TagResponse.Value);
- EventHandler<CNetworker.CNetworkerNBWControlSettingAccessEventArgs> mqttConfigClientId = this.NBWControl_ConfigCommandResponseValid_GetMQTTConfigClientID;
- if (mqttConfigClientId == null)
- return;
- mqttConfigClientId((object) this, e1);
- }
- else
- {
- EventHandler mqttConfigClientId = this.NBWControl_ConfigCommandResponseError_GetMQTTConfigClientID;
- if (mqttConfigClientId != null)
- mqttConfigClientId((object) this, (EventArgs) null);
- }
- }
- public event EventHandler NBWControl_ConfigCommandResponseValid_SetUserDefinedSSID;
- public event EventHandler NBWControl_ConfigCommandResponseError_SetUserDefinedSSID;
- public event EventHandler NBWControl_ConfigCommandResponseValid_SetUserDefinedSSIDPassword;
- public event EventHandler NBWControl_ConfigCommandResponseError_SetUserDefinedSSIDPassword;
- public event EventHandler NBWControl_ConfigCommandResponseValid_SetNetworkJoinType;
- public event EventHandler NBWControl_ConfigCommandResponseError_SetNetworkJoinType;
- public event EventHandler NBWControl_ConfigCommandResponseValid_SetMQTTGeneralEnableConnection;
- public event EventHandler NBWControl_ConfigCommandResponseError_SetMQTTGeneralEnableConnection;
- public event EventHandler NBWControl_ConfigCommandResponseValid_SaveSettings;
- public event EventHandler NBWControl_ConfigCommandResponseError_SaveSettings;
- public event EventHandler NBWControl_ConfigCommandResponseValid_RebootNoSaveSettings;
- public event EventHandler NBWControl_ConfigCommandResponseError_RebootNoSaveSettings;
- public event EventHandler NBWControl_ConfigCommandResponseValid_GenerateNewHUBAccessHash;
- public event EventHandler NBWControl_ConfigCommandResponseError_GenerateNewHUBAccessHash;
- public void NBWControl_ConfigurationCommandIssue_SetUserDefinedSSID(
- string defaultAccessPassword,
- string userDefinedSSID)
- {
- this._nbwControl.ConfigurationCommandIssue_SetUserDefinedSSID(defaultAccessPassword, userDefinedSSID);
- }
- private void NBWControl_SetSettingCommandResponse_WIFI_UserDefinedSSID(
- object sender,
- CNBWControl.CGetSetSettingCommandResponseEventArgs e)
- {
- if (e.TagResponse.ValueSetState == CTag.VALUE_SET_STATE.SET)
- {
- EventHandler setUserDefinedSsid = this.NBWControl_ConfigCommandResponseValid_SetUserDefinedSSID;
- if (setUserDefinedSsid == null)
- return;
- setUserDefinedSsid((object) this, (EventArgs) null);
- }
- else
- {
- EventHandler setUserDefinedSsid = this.NBWControl_ConfigCommandResponseError_SetUserDefinedSSID;
- if (setUserDefinedSsid != null)
- setUserDefinedSsid((object) this, (EventArgs) null);
- }
- }
- public void NBWControl_ConfigurationCommandIssue_SetUserDefinedSSIDPassword(
- string defaultAccessPassword,
- string userDefinedSSIDPassword)
- {
- this._nbwControl.ConfigurationCommandIssue_SetUserDefinedSSIDPassword(defaultAccessPassword, userDefinedSSIDPassword);
- }
- private void NBWControl_SetSettingCommandResponse_WIFI_UserDefinedSSIDPassword(
- object sender,
- CNBWControl.CGetSetSettingCommandResponseEventArgs e)
- {
- if (e.TagResponse.ValueSetState == CTag.VALUE_SET_STATE.SET)
- {
- EventHandler definedSsidPassword = this.NBWControl_ConfigCommandResponseValid_SetUserDefinedSSIDPassword;
- if (definedSsidPassword == null)
- return;
- definedSsidPassword((object) this, (EventArgs) null);
- }
- else
- {
- EventHandler definedSsidPassword = this.NBWControl_ConfigCommandResponseError_SetUserDefinedSSIDPassword;
- if (definedSsidPassword != null)
- definedSsidPassword((object) this, (EventArgs) null);
- }
- }
- public void NBWControl_ConfigurationCommandIssue_SetNetworkJoinType(
- string defaultAccessPassword,
- bool operateAsAccessPoint)
- {
- this._nbwControl.ConfigurationCommandIssue_SetNetworkJoinType(defaultAccessPassword, operateAsAccessPoint);
- }
- private void NBWControl_SetSettingCommandResponse_WIFI_JoinType(
- object sender,
- CNBWControl.CGetSetSettingCommandResponseEventArgs e)
- {
- if (e.TagResponse.ValueSetState == CTag.VALUE_SET_STATE.SET)
- {
- EventHandler setNetworkJoinType = this.NBWControl_ConfigCommandResponseValid_SetNetworkJoinType;
- if (setNetworkJoinType == null)
- return;
- setNetworkJoinType((object) this, (EventArgs) null);
- }
- else
- {
- EventHandler setNetworkJoinType = this.NBWControl_ConfigCommandResponseError_SetNetworkJoinType;
- if (setNetworkJoinType != null)
- setNetworkJoinType((object) this, (EventArgs) null);
- }
- }
- public void NBWControl_ConfigurationCommandIssue_SetMQTTGeneralEnableConnectionOption(
- string defaultAccessPassword,
- bool enableConnection)
- {
- this._nbwControl.ConfigurationCommandIssue_SetMQTTGeneralEnableConnection(defaultAccessPassword, enableConnection);
- }
- private void NBWControl_SetSettingCommandResponse_MQTTGeneral_EnableConnection(
- object sender,
- CNBWControl.CGetSetSettingCommandResponseEventArgs e)
- {
- if (e.TagResponse.ValueSetState == CTag.VALUE_SET_STATE.SET)
- {
- EventHandler enableConnection = this.NBWControl_ConfigCommandResponseValid_SetMQTTGeneralEnableConnection;
- if (enableConnection == null)
- return;
- enableConnection((object) this, (EventArgs) null);
- }
- else
- {
- EventHandler enableConnection = this.NBWControl_ConfigCommandResponseError_SetMQTTGeneralEnableConnection;
- if (enableConnection != null)
- enableConnection((object) this, (EventArgs) null);
- }
- }
- public void NBWControl_ConfigurationCommandIssue_SaveSettings(string defaultAccessPassword)
- {
- this._nbwControl.ConfigurationCommandIssue_SaveSettingsAndReboot(defaultAccessPassword);
- }
- private void NBWControl_SetSettingCommandResponse_Save(
- object sender,
- CNBWControl.CGetSetSettingCommandResponseEventArgs e)
- {
- if (e.TagResponse.ValueSetState == CTag.VALUE_SET_STATE.SET)
- {
- EventHandler validSaveSettings = this.NBWControl_ConfigCommandResponseValid_SaveSettings;
- if (validSaveSettings == null)
- return;
- validSaveSettings((object) this, (EventArgs) null);
- }
- else
- {
- EventHandler errorSaveSettings = this.NBWControl_ConfigCommandResponseError_SaveSettings;
- if (errorSaveSettings != null)
- errorSaveSettings((object) this, (EventArgs) null);
- }
- }
- public void NBWControl_ConfigurationCommandIssue_RebootNoSaveSettings(
- string defaultAccessPassword)
- {
- this._nbwControl.ConfigurationCommandIssue_RebootWithNoSaveOfSettings(defaultAccessPassword);
- }
- private void NBWControl_SetSettingCommandResponse_Boot(
- object sender,
- CNBWControl.CGetSetSettingCommandResponseEventArgs e)
- {
- if (e.TagResponse.ValueSetState == CTag.VALUE_SET_STATE.SET)
- {
- EventHandler rebootNoSaveSettings = this.NBWControl_ConfigCommandResponseValid_RebootNoSaveSettings;
- if (rebootNoSaveSettings == null)
- return;
- rebootNoSaveSettings((object) this, (EventArgs) null);
- }
- else
- {
- EventHandler rebootNoSaveSettings = this.NBWControl_ConfigCommandResponseError_RebootNoSaveSettings;
- if (rebootNoSaveSettings != null)
- rebootNoSaveSettings((object) this, (EventArgs) null);
- }
- }
- public void NBWControl_ConfigurationCommandIssue_GenerateNewHUBAccessHash(
- string defaultAccessPassword)
- {
- this._nbwControl.ConfigurationCommandIssue_GenerateNewHASH(defaultAccessPassword);
- }
- private void NBWControl_SetSettingCommandResponse_Hash(
- object sender,
- CNBWControl.CGetSetSettingCommandResponseEventArgs e)
- {
- if (e.TagResponse.ValueSetState == CTag.VALUE_SET_STATE.SET)
- {
- EventHandler newHubAccessHash = this.NBWControl_ConfigCommandResponseValid_GenerateNewHUBAccessHash;
- if (newHubAccessHash == null)
- return;
- newHubAccessHash((object) this, (EventArgs) null);
- }
- else
- {
- EventHandler newHubAccessHash = this.NBWControl_ConfigCommandResponseError_GenerateNewHUBAccessHash;
- if (newHubAccessHash != null)
- newHubAccessHash((object) this, (EventArgs) null);
- }
- }
- public CSystem System
- {
- get
- {
- return this._system;
- }
- }
- public CHeating Heating
- {
- get
- {
- return this._mode.Heating;
- }
- }
- public CCooling Cooling
- {
- get
- {
- return this._mode.Cooling;
- }
- }
- public CEvpCool EvpCool
- {
- get
- {
- return this._mode.Evpcool;
- }
- }
- private void SystemFunctional_Init()
- {
- this._system = new CSystem(this._commandInterface, this._transferControl, this._rxContainer);
- this._mode = new CMode(this._commandInterface, this._transferControl, this._rxContainer);
- }
- public event EventHandler<CNetworkerCommandTextEventArgs> CommandTextTx;
- public event EventHandler CommandTextTransferCompletedSuccessfully;
- public event EventHandler CommandTextTransferCompletedWithoutSuccess;
- public CTransferControl CommandTransfer
- {
- get
- {
- return this._transferControl;
- }
- }
- private void CommandInterpreter_Init()
- {
- this._commandInterface = new CCommandInterface();
- this._rxContainer = new CContainer(this._commandInterface);
- this._transferControl = new CTransferControl();
- this._transferControl.CommandTextToBeIssued += new EventHandler<CTransferControlCommandTextToBeIssuedEventArgs>(this.TransferControl_CommandTextToBeIssued);
- this._transferControl.CompletedSuccessfully += new EventHandler(this.TransferControl_CompletedSuccessfully);
- this._transferControl.CompletedWithoutSuccess += new EventHandler(this.TransferControl_CompletedWithoutSuccess);
- this._commandIssueTxResponseTimeoutTimer = new CTimer();
- this._commandIssueTxResponseTimeoutTimer.IntervalElapsed += new EventHandler<CTimerIntervalElapsedEventArgs>(this.CommandIssueTxResponseTimeoutTimer_IntervalElapsed);
- this._waitingForFirstCommand = true;
- }
- private void CommandIssueTxResponseTimeoutTimer_IntervalElapsed(
- object sender,
- CTimerIntervalElapsedEventArgs e)
- {
- if (!e.TimeLimitReached)
- return;
- this._transferControl.ResponseVerificationUpdate(true);
- }
- private string SequenceControlValueTxUpdate()
- {
- if (this._sequenceControlTxValue == 999999)
- this._sequenceControlTxValue = 1;
- else
- ++this._sequenceControlTxValue;
- if (this._sequenceControlTxValue < 10)
- return "00000" + this._sequenceControlTxValue.ToString();
- if (this._sequenceControlTxValue < 100)
- return "0000" + this._sequenceControlTxValue.ToString();
- if (this._sequenceControlTxValue < 1000)
- return "000" + this._sequenceControlTxValue.ToString();
- if (this._sequenceControlTxValue < 10000)
- return "00" + this._sequenceControlTxValue.ToString();
- if (this._sequenceControlTxValue < 100000)
- return "0" + this._sequenceControlTxValue.ToString();
- return this._sequenceControlTxValue.ToString() ?? "";
- }
- private int SequenceControlValueRxUpdate(string sequenceControlValue)
- {
- int num1 = 0;
- int num2;
- try
- {
- int num3 = (int) sequenceControlValue[0] - 48;
- num2 = num1 + 100000 * num3 + 10000 * ((int) sequenceControlValue[1] - 48) + 1000 * ((int) sequenceControlValue[2] - 48) + 100 * ((int) sequenceControlValue[3] - 48) + 10 * ((int) sequenceControlValue[4] - 48) + ((int) sequenceControlValue[5] - 48);
- }
- catch
- {
- num2 = 0;
- }
- return num2;
- }
- private void TransferControl_CommandTextToBeIssued(
- object sender,
- CTransferControlCommandTextToBeIssuedEventArgs e)
- {
- CNetworkerCommandTextEventArgs e1 = new CNetworkerCommandTextEventArgs(e.CommandText);
- if ((uint) (this._connectType - 1) > 1U)
- return;
- if (this._connectType == CNetworker.CONNECT_TYPE.TCP)
- this._nbwControl.WIFI.SendTextMessage("N" + this.SequenceControlValueTxUpdate() + e.CommandText);
- else
- this._nbwControl.HUB.SendTextMessage("N" + this.SequenceControlValueTxUpdate() + e.CommandText);
- this._commandIssueTxResponseTimeoutTimer.Start(true, this._commandResponseTimeoutSeconds);
- EventHandler<CNetworkerCommandTextEventArgs> commandTextTx = this.CommandTextTx;
- if (commandTextTx == null)
- return;
- commandTextTx((object) this, e1);
- }
- private void TransferControl_CompletedSuccessfully(object sender, EventArgs e)
- {
- this._commandIssueTxResponseTimeoutTimer.Stop();
- EventHandler completedSuccessfully = this.CommandTextTransferCompletedSuccessfully;
- if (completedSuccessfully == null)
- return;
- completedSuccessfully((object) this, EventArgs.Empty);
- }
- private void TransferControl_CompletedWithoutSuccess(object sender, EventArgs e)
- {
- EventHandler completedWithoutSuccess = this.CommandTextTransferCompletedWithoutSuccess;
- if (completedWithoutSuccess == null)
- return;
- completedWithoutSuccess((object) this, EventArgs.Empty);
- }
- private void UpdateUsingCommandTextReceived(string commandText)
- {
- this._rxContainer.DefineCommandText(commandText);
- this._rxContainer.GroupStartPosition(CContainer.RMTAXS_COMMON_GROUP_TYPES.GROUP_1, 1);
- this._rxContainer.GroupEndPosition(CContainer.RMTAXS_COMMON_GROUP_TYPES.GROUP_1, 1);
- while (this._rxContainer.DefinedNextGroupDetails(CContainer.RMTAXS_COMMON_GROUP_TYPES.GROUP_1))
- {
- string str = this._rxContainer.GroupDescriptor(CContainer.RMTAXS_COMMON_GROUP_TYPES.GROUP_1);
- if (str == this._system.Group1Descriptor)
- this._system.UpdateUsingCommandTextReceived();
- else if (str == this._mode.Heating.Group1Descriptor)
- this._mode.Heating.UpdateUsingCommandTextReceived();
- else if (str == this._mode.Evpcool.Group1Descriptor)
- this._mode.Evpcool.UpdateUsingCommandTextReceived();
- else if (str == this._mode.Cooling.Group1Descriptor)
- this._mode.Cooling.UpdateUsingCommandTextReceived();
- }
- this._transferControl.ResponseVerificationUpdate(false);
- }
- public event EventHandler Networker_NBWControl_TCPConnectionEstablished;
- public event EventHandler Networker_NBWControl_HUBConnectionEstablished;
- public event EventHandler Networker_NBWControl_NoConnectionEstablished;
- public event EventHandler Networker_NBWControl_HostInactivityDetected;
- public event EventHandler Networker_NBWControl_UserInactivityDetected;
- public event EventHandler Networker_NBWControl_HostConnectDisconnect;
- public async Task<bool> AccessedUsingNetworkConnection(
- CNetworker.NETWORK_CONNECT_MODE networkConnectMode,
- CConnectionDetails connectionDetails)
- {
- EventHandler<string> networkerDebugMessage = this.Networker_DebugMessage;
- if (networkerDebugMessage != null)
- networkerDebugMessage((object) this, string.Format("Connecting - Mode: {0}", (object) networkConnectMode));
- this._commandResponseTimeoutSeconds = connectionDetails.CommandResponseTimeoutSeconds;
- this._connectType = CNetworker.CONNECT_TYPE.NONE;
- if (networkConnectMode != CNetworker.NETWORK_CONNECT_MODE.HUB_ONLY)
- {
- bool flag = await this._nbwControl.WIFI.EstablishedConnection(connectionDetails.WIFI);
- if (flag)
- {
- this._waitingForFirstCommand = true;
- this._connectType = CNetworker.CONNECT_TYPE.TCP;
- EventHandler connectionEstablished = this.Networker_NBWControl_TCPConnectionEstablished;
- if (connectionEstablished != null)
- connectionEstablished((object) this, EventArgs.Empty);
- return true;
- }
- if (networkConnectMode == CNetworker.NETWORK_CONNECT_MODE.WIFI_ONLY)
- {
- EventHandler connectionEstablished = this.Networker_NBWControl_NoConnectionEstablished;
- if (connectionEstablished != null)
- connectionEstablished((object) this, EventArgs.Empty);
- return false;
- }
- }
- bool flag1 = await this._nbwControl.HUB.EstablishedConnection(connectionDetails);
- if (flag1)
- {
- this._waitingForFirstCommand = true;
- this._connectType = CNetworker.CONNECT_TYPE.HUB;
- EventHandler connectionEstablished = this.Networker_NBWControl_HUBConnectionEstablished;
- if (connectionEstablished != null)
- connectionEstablished((object) this, EventArgs.Empty);
- return true;
- }
- EventHandler connectionEstablished1 = this.Networker_NBWControl_NoConnectionEstablished;
- if (connectionEstablished1 != null)
- connectionEstablished1((object) this, EventArgs.Empty);
- return false;
- }
- public bool Connected
- {
- get
- {
- switch (this._connectType)
- {
- case CNetworker.CONNECT_TYPE.TCP:
- return this._nbwControl.WIFI.ConnectedToHost;
- case CNetworker.CONNECT_TYPE.HUB:
- return this._nbwControl.HUB.ConnectedToHost;
- default:
- return false;
- }
- }
- }
- public bool ConnectedUsingTCP
- {
- get
- {
- return this._connectType == CNetworker.CONNECT_TYPE.TCP;
- }
- }
- public bool ConnectedUsingHUB
- {
- get
- {
- return this._connectType == CNetworker.CONNECT_TYPE.HUB;
- }
- }
- public void Disconnect()
- {
- switch (this._connectType)
- {
- case CNetworker.CONNECT_TYPE.TCP:
- this._nbwControl.WIFI.CloseConnection();
- break;
- case CNetworker.CONNECT_TYPE.HUB:
- this._nbwControl.HUB.CloseConnection();
- break;
- }
- }
- private void Connection_Init()
- {
- this._connectType = CNetworker.CONNECT_TYPE.NONE;
- }
- public event EventHandler<string> Networker_DebugMessage;
- public event EventHandler Networker_NBWControl_WIFI_HostLocateFound;
- public event EventHandler Networker_NBWControl_WIFI_HostLocateError;
- public event EventHandler Networker_NBWControl_WIFI_HostConnectFound;
- public event EventHandler Networker_NBWControl_WIFI_HostConnectError;
- public event EventHandler Networker_NBWControl_WIFI_HostInactivityDetected;
- public event EventHandler Networker_NBWControl_WIFI_UserInactivityDetected;
- public event EventHandler Networker_NBWControl_WIFI_HostConnectDisconnect;
- private void NBWControl_WIFI_HostLocated(object sender, EventArgs e)
- {
- EventHandler wifiHostLocateFound = this.Networker_NBWControl_WIFI_HostLocateFound;
- if (wifiHostLocateFound == null)
- return;
- wifiHostLocateFound((object) this, e);
- }
- private void NBWControl_WIFI_HostLocateTimeout(object sender, EventArgs e)
- {
- EventHandler wifiHostLocateError = this.Networker_NBWControl_WIFI_HostLocateError;
- if (wifiHostLocateError == null)
- return;
- wifiHostLocateError((object) this, e);
- }
- private void NBWControl_WIFI_HostConnected(object sender, EventArgs e)
- {
- EventHandler hostConnectFound = this.Networker_NBWControl_WIFI_HostConnectFound;
- if (hostConnectFound == null)
- return;
- hostConnectFound((object) this, e);
- }
- private void NBWControl_WIFI_HostConnectTimeout(object sender, EventArgs e)
- {
- EventHandler hostConnectError = this.Networker_NBWControl_WIFI_HostConnectError;
- if (hostConnectError == null)
- return;
- hostConnectError((object) this, e);
- }
- private void NBWControl_WIFI_HostDisconnected(object sender, EventArgs e)
- {
- EventHandler connectDisconnect1 = this.Networker_NBWControl_WIFI_HostConnectDisconnect;
- if (connectDisconnect1 != null)
- connectDisconnect1((object) this, e);
- EventHandler connectDisconnect2 = this.Networker_NBWControl_HostConnectDisconnect;
- if (connectDisconnect2 == null)
- return;
- connectDisconnect2((object) this, e);
- }
- private void NBWControl_WIFI_HostInactivityDetected(object sender, EventArgs e)
- {
- EventHandler inactivityDetected1 = this.Networker_NBWControl_WIFI_HostInactivityDetected;
- if (inactivityDetected1 != null)
- inactivityDetected1((object) this, e);
- EventHandler inactivityDetected2 = this.Networker_NBWControl_HostInactivityDetected;
- if (inactivityDetected2 == null)
- return;
- inactivityDetected2((object) this, e);
- }
- private void NBWControl_WIFI_UserInactivityDetected(object sender, EventArgs e)
- {
- EventHandler inactivityDetected1 = this.Networker_NBWControl_WIFI_UserInactivityDetected;
- if (inactivityDetected1 != null)
- inactivityDetected1((object) this, e);
- EventHandler inactivityDetected2 = this.Networker_NBWControl_UserInactivityDetected;
- if (inactivityDetected2 == null)
- return;
- inactivityDetected2((object) this, e);
- }
- public event EventHandler Networker_NBWControl_HUB_HostConnectFound;
- public event EventHandler Networker_NBWControl_HUB_HostConnectError;
- public event EventHandler Networker_NBWControl_HUB_HostInactivityDetected;
- public event EventHandler Networker_NBWControl_HUB_UserInactivityDetected;
- public event EventHandler Networker_NBWControl_HUB_HostConnectDisconnect;
- private void NBWControl_HUB_HostConnected(object sender, EventArgs e)
- {
- EventHandler hostConnectFound = this.Networker_NBWControl_HUB_HostConnectFound;
- if (hostConnectFound == null)
- return;
- hostConnectFound((object) this, e);
- }
- private void NBWControl_HUB_HostConnectTimeout(object sender, EventArgs e)
- {
- EventHandler hostConnectError = this.Networker_NBWControl_HUB_HostConnectError;
- if (hostConnectError == null)
- return;
- hostConnectError((object) this, e);
- }
- private void NBWControl_HUB_HostDisonnected(object sender, EventArgs e)
- {
- EventHandler connectDisconnect1 = this.Networker_NBWControl_HUB_HostConnectDisconnect;
- if (connectDisconnect1 != null)
- connectDisconnect1((object) this, e);
- EventHandler connectDisconnect2 = this.Networker_NBWControl_HostConnectDisconnect;
- if (connectDisconnect2 == null)
- return;
- connectDisconnect2((object) this, e);
- }
- private void NBWControl_HUB_HostInactivityDetected(object sender, EventArgs e)
- {
- EventHandler inactivityDetected1 = this.Networker_NBWControl_HUB_HostInactivityDetected;
- if (inactivityDetected1 != null)
- inactivityDetected1((object) this, e);
- EventHandler inactivityDetected2 = this.Networker_NBWControl_HostInactivityDetected;
- if (inactivityDetected2 == null)
- return;
- inactivityDetected2((object) this, e);
- }
- private void NBWControl_HUB_UserInactivityDetected(object sender, EventArgs e)
- {
- EventHandler inactivityDetected1 = this.Networker_NBWControl_HUB_UserInactivityDetected;
- if (inactivityDetected1 != null)
- inactivityDetected1((object) this, e);
- EventHandler inactivityDetected2 = this.Networker_NBWControl_UserInactivityDetected;
- if (inactivityDetected2 == null)
- return;
- inactivityDetected2((object) this, e);
- }
- public event EventHandler<CNBWControlConfigurationCommandTextEventArgs> NBWControlConfigurationCommandTextRx;
- public event EventHandler<CNetworkerCommandTextEventArgs> CommandTextRx;
- public event EventHandler<CMessageEventArgs> HUBMessageSentAcknowledged;
- private void ProcessNetworkerMessageReceived(string responseText)
- {
- this._sequenceControlRxValue = this.SequenceControlValueRxUpdate(responseText.Substring(1, 6));
- if (this._waitingForFirstCommand)
- {
- this._sequenceControlTxValue = this._sequenceControlRxValue;
- this._waitingForFirstCommand = false;
- }
- string commandText = responseText.Substring(7).Trim();
- if (this._sequenceControlRxValue >= this._sequenceControlTxValue)
- {
- this._sequenceControlTxValue = this._sequenceControlRxValue;
- this.UpdateUsingCommandTextReceived(commandText);
- }
- CNetworkerCommandTextEventArgs e = new CNetworkerCommandTextEventArgs(commandText);
- EventHandler<CNetworkerCommandTextEventArgs> commandTextRx = this.CommandTextRx;
- if (commandTextRx == null)
- return;
- commandTextRx((object) this, e);
- }
- private void NBWControl_WIFI_MessageReceived(object sender, CMessageEventArgs e)
- {
- string responseText = Encoding.UTF8.GetString(e.Packet.Buffer, 0, e.Packet.BufferLength);
- string str1 = responseText.Substring(0, 1);
- if (!(str1 == "C"))
- {
- if (!(str1 == "N"))
- return;
- this.ProcessNetworkerMessageReceived(responseText);
- }
- else
- {
- string str2 = responseText.Substring(1);
- this._nbwControl.SettingsAccessUpdateAfterResponseTextReceived(str2);
- CNBWControlConfigurationCommandTextEventArgs e1 = new CNBWControlConfigurationCommandTextEventArgs(str2);
- EventHandler<CNBWControlConfigurationCommandTextEventArgs> configurationCommandTextRx = this.NBWControlConfigurationCommandTextRx;
- if (configurationCommandTextRx == null)
- return;
- configurationCommandTextRx((object) this, e1);
- }
- }
- private void NBWControl_HUB_MessageReceived(object sender, CMessageEventArgs e)
- {
- string responseText = Encoding.UTF8.GetString(e.Packet.Buffer, 0, e.Packet.BufferLength);
- if (!(responseText.Substring(0, 1) == "N"))
- return;
- this.ProcessNetworkerMessageReceived(responseText);
- }
- private void NBWControl_HUB_MessageSentAcknowledged(object sender, CMessageEventArgs e)
- {
- EventHandler<CMessageEventArgs> sentAcknowledged = this.HUBMessageSentAcknowledged;
- if (sentAcknowledged == null)
- return;
- sentAcknowledged((object) this, e);
- }
- public class CNetworkerNBWControlSettingAccessEventArgs : EventArgs
- {
- private string _commandResponseData;
- public CNetworkerNBWControlSettingAccessEventArgs(string commandResponseData)
- {
- this._commandResponseData = commandResponseData;
- }
- public string CommandResponseData
- {
- get
- {
- return this._commandResponseData;
- }
- }
- }
- public enum NETWORK_CONNECT_MODE
- {
- WIFI_ONLY,
- HUB_ONLY,
- HUB_AFTER_WIFI,
- }
- public enum CONNECT_TYPE
- {
- NONE,
- TCP,
- HUB,
- USB,
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment