     }
     
     func socket(_ sock: GCDAsyncSocket, didRead data: Data, withTag tag: Int) {
-        print("command did read")
+        print("command did read size \(data.count)")
         
         if step == 0
         {

            
            print("header and payload:\(header)")
            
            sock.readData(withTimeout:1000, tag:0)
        }
        else if step == 3
        {
            step = 4
            
            let header = data.withUnsafeBytes {
                
                Array(UnsafeBufferPointer<UInt32>(start: $0, count: 2))
            }
            
            //[size, response:10 or 12, PTPIP_DATA_PACKET]
            
            print("data:\(header)")
            
            // size should be equal to payload if not read again if true read to next step
            
            guard
                
                let receivingString:String = String(
                    data:data,
                    encoding:String.Encoding.utf8)
                
                else
            {
                print("can't create string")
                return
            }
            
            print("data in xml:")
            print(receivingString)
            
            sock.readData(withTimeout:1000, tag:0)
        }
        else if step == 4
        {

    
    func commandAck()
    {
        readCommand()
    }
    
    func commandAckRead()
