public CommsDecoder(string BaudRate, string COMport, Library.PacketStates.PacketState SendPacketState) { //Set Communication Properties _BaudRate = BaudRate; _COMport = COMport; //Set Current Communication States CurrentState = SendPacketState; //Initialise timers timerClock = new System.Timers.Timer(); }
public void Get_RTC() { try { _SendPacketState = Library.PacketStates.PacketState.READ_RTC; Send_Command_Data("!B"); } catch (Exception) { throw; } }
public void Send_Download_EEPROM() { try { _SendPacketState = Library.PacketStates.PacketState.DOWNLOAD_EEPROM; Send_Command_Data("!D"); } catch (Exception) { throw; } }
public void Send_Clear_EEPROM() { try { _SendPacketState = Library.PacketStates.PacketState.CLEAR_EEPROM; Send_Command_Data("!A"); } catch { throw; } }
public void Set_RTC() { try { _SendPacketState = Library.PacketStates.PacketState.WRITE_RTC; string YearMonthDay = DateTime.Now.ToString("yyMMdd"); string DayoftheWeek = GetDayOfWeek(); string HourMinute = DateTime.Now.ToString("HHmm"); // System.Diagnostics.Debug.WriteLine(DateTime.Now.); Send_Command_Data("!C" + YearMonthDay + DayoftheWeek + HourMinute); } catch (Exception) { throw; } }
public void ClearEEPROM() { //CLEAR EEPROM CurrentState = PacketStates.PacketState.CLEAR_EEPROM; _SerialInstance.WriteCLREEPROM(); }