     /* the number of meaningfull parameters */
     var Nparam:UInt8 = 0
 };
+

    func socket(_ sock: GCDAsyncSocket, didRead data: Data, withTag tag: Int) {
        print("command did read")
        
        if first
        {
            first = false
            
            if data.count != 12
            {

    func eventReadDataConnection()
    {
        connect?.stopBroadcast()
        
        
        var code:UInt16 = 38161 //PTP_OC_VITA_GetVitaInfo
        let type:UInt32 = 6 // PTPIP_CMD_REQUEST
        let dataPhase:UInt32 = 1//ptpip_cmd_dataphase
        let tranId:UInt32 = 2//ptpip_cmd_transid
        
        var request:[UInt32] = [22,type,dataPhase]
        var trans:[UInt32] = [tranId]
        
        var data = Data(buffer: UnsafeBufferPointer(start: &request, count: request.count))
        
        data.append(UnsafeBufferPointer(start:&code, count:1))
        data.append(UnsafeBufferPointer(start: &trans, count: trans.count))
        
        socketCommand?.write(data, withTimeout:100, tag:0)
        socketCommand?.readData(withTimeout:1000, tag:0)
    }
}

class SocketCommandDelegate:NSObject, GCDAsyncSocketDelegate
{
    var step:Int = 0
    weak var connected:MConnectConnected?
    
    func socketDidCloseReadStream(_ sock: GCDAsyncSocket) {
