|
|
@@ -0,0 +1,133 @@
|
|
|
+#include "Slave_Ports_Status.h"
|
|
|
+
|
|
|
+/*Slave_Ports_Status::Slave_Ports_Status(Client& client) : m_client(client) {
|
|
|
+ m_accountName = NULL;
|
|
|
+ m_appKeyName = NULL;
|
|
|
+ m_appKeyValue = NULL;
|
|
|
+ m_path = NULL;
|
|
|
+ m_nextChar = NULL;
|
|
|
+ m_nextState = END;
|
|
|
+}
|
|
|
+*/
|
|
|
+
|
|
|
+/*
|
|
|
+Slave_Ports_Status::Slave_Ports_Status(Client& client) : m_client(client) {
|
|
|
+ m_accountName = NULL;
|
|
|
+ m_appKeyName = NULL;
|
|
|
+ m_appKeyValue = NULL;
|
|
|
+ m_path = NULL;
|
|
|
+ m_nextChar = NULL;
|
|
|
+ m_nextState = END;
|
|
|
+}
|
|
|
+*/
|
|
|
+/*
|
|
|
+
|
|
|
+void Slave_Ports_Status::push() { //
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+*/
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+Slave_Ports_Status::Slave_Ports_Status(){
|
|
|
+ Serial.print("#35 Slave_Ports_Status::Slave_Ports_Status():");
|
|
|
+ _count = 0 ;
|
|
|
+ //Slave_Ports_Status_T Slave_Ports_Status_A[10];
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/*
|
|
|
+inline int Slave_Ports_Status::add(Slave_Ports_Status_T item)
|
|
|
+{
|
|
|
+
|
|
|
+ Serial.print("Add item... _count["); Serial.print(item.Port_ID);
|
|
|
+
|
|
|
+ Serial.print("] 0 ["); Serial.print(item.Port_ID);
|
|
|
+ Serial.print("1 ["); Serial.print(item._Slave_ID);
|
|
|
+ Serial.print("2 ["); Serial.print(item.PortTypes);
|
|
|
+ Serial.print("3 ["); Serial.print(item.Address);
|
|
|
+ Serial.print("4 ["); Serial.print(item.LocalPort);
|
|
|
+ Serial.print("5 ["); Serial.print(item.Exp_state);
|
|
|
+ Serial.print("6 ["); Serial.print(item.Exp_state_ttl);
|
|
|
+ Serial.print("7 ["); Serial.print(item.Broadcast_state);
|
|
|
+ Serial.println("]");
|
|
|
+
|
|
|
+ return 1 ;
|
|
|
+}
|
|
|
+*/
|
|
|
+
|
|
|
+ void Slave_Ports_Status::add_port(
|
|
|
+ int Port_ID,
|
|
|
+ int _Slave_ID,
|
|
|
+ int PortTypes,
|
|
|
+ int Address,
|
|
|
+ int LocalPort,
|
|
|
+ int Exp_state,
|
|
|
+ int Exp_state_ttl,
|
|
|
+ int Broadcast_state
|
|
|
+ )
|
|
|
+{
|
|
|
+
|
|
|
+ Serial.print("add_port _count["); Serial.print(_count);
|
|
|
+ Serial.print("] Port_ID["); Serial.print(Port_ID);
|
|
|
+ Serial.print("] _Slave_ID[0x"); Serial.print( _Slave_ID, HEX );
|
|
|
+ Serial.print("] PortTypes["); Serial.print(PortTypes, HEX);
|
|
|
+ Serial.print("] Address["); Serial.print(Address, HEX);
|
|
|
+ Serial.print("] LocalPort["); Serial.print(LocalPort, HEX);
|
|
|
+ Serial.print("] Exp_state["); Serial.print(Exp_state, HEX);
|
|
|
+ Serial.print("] Exp_state_ttl["); Serial.print(Exp_state_ttl, HEX);
|
|
|
+ Serial.print("] Broadcast_state["); Serial.print(Broadcast_state, HEX);
|
|
|
+ Serial.println("]");
|
|
|
+ //Slave_Ports_Status_A[_count + 1].Port_ID = Port_ID ;
|
|
|
+
|
|
|
+
|
|
|
+ this->Slave_Ports_Status_A[_count + 1].Port_ID = Port_ID ;
|
|
|
+ this->Slave_Ports_Status_A[_count + 1]._Slave_ID = _Slave_ID ;
|
|
|
+ this->Slave_Ports_Status_A[_count + 1].PortTypes = PortTypes ;
|
|
|
+ this->Slave_Ports_Status_A[_count + 1].Address = Address ;
|
|
|
+ this->Slave_Ports_Status_A[_count + 1].LocalPort = LocalPort ;
|
|
|
+ this->Slave_Ports_Status_A[_count + 1].Exp_state = Exp_state ;
|
|
|
+ this->Slave_Ports_Status_A[_count + 1].Broadcast_state = Broadcast_state ;
|
|
|
+
|
|
|
+ this->_count ++;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+bool Slave_Ports_Status::add_empty()
|
|
|
+{
|
|
|
+ Serial.println("add_empty");
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+void Slave_Ports_Status::list_ports()
|
|
|
+{
|
|
|
+ Serial.print("list_ports _count["); Serial.print(_count); Serial.println("] ");
|
|
|
+ int i;
|
|
|
+ for(i=1;i<=_count;i++) {
|
|
|
+
|
|
|
+ Serial.print(" #IND["); Serial.print(i);
|
|
|
+ Serial.print("] Port_ID["); Serial.print(Slave_Ports_Status_A[i].Port_ID, HEX);
|
|
|
+ Serial.print("] _Slave_ID[0x"); Serial.print( Slave_Ports_Status_A[i]._Slave_ID, HEX );
|
|
|
+ Serial.print("] PortTypes["); Serial.print(Slave_Ports_Status_A[i].PortTypes, HEX);
|
|
|
+ Serial.print("] Address["); Serial.print(Slave_Ports_Status_A[i].Address, HEX);
|
|
|
+ Serial.print("] LocalPort["); Serial.print(Slave_Ports_Status_A[i].LocalPort, HEX);
|
|
|
+ Serial.print("] Exp_state["); Serial.print(Slave_Ports_Status_A[i].Exp_state, HEX);
|
|
|
+ Serial.print("] Exp_state_ttl["); Serial.print(Slave_Ports_Status_A[i].Exp_state_ttl, HEX);
|
|
|
+ Serial.print("] Broadcast_state["); Serial.print(Slave_Ports_Status_A[i].Broadcast_state, HEX);
|
|
|
+ Serial.println("]");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+Slave_Ports_Status::~Slave_Ports_Status(){
|
|
|
+ delete[] Slave_Ports_Status_A;
|
|
|
+ //Serial.print("#40 free ~Slave_Ports_Status");
|
|
|
+}
|
|
|
+
|