Exemplo n.º 1
0
 public bool updatePowerUsage(int watt, short socketid)
 {
     for (int i = 0; i < m_Wallsockets.Count; i++)
     {
         wallSocket sock = m_Wallsockets[i];
         if (sock.id == socketid)
         {
             // this is the socket
             packet pck = new packet(PACKET_TYPE.C_SOCKET_POWER_UPDATE);
             pck.writeShort(socketid);
             pck.writeLong(watt);
             send(pck);
             //print("send updatePowerUsage watt = " + watt);
             return true;
         }
     }
     return false;
 }
Exemplo n.º 2
0
 void sendUpdateSocketState(WALLSOCKET_STATE newstate, short socketid)
 {
     packet pck = new packet(PACKET_TYPE.C_UPDATE_SOCKET_STATE);
     pck.writeShort(socketid);
     pck.writeByte((byte)newstate);
     send(pck);
 }
Exemplo n.º 3
0
 public void requestPowerInformation(short socketid)
 {
     packet pck = new packet(PACKET_TYPE.C_REQUEST_SOCKET_INFO);
     pck.writeShort(socketid);
     send(pck);
     //print("request power information");
 }