Who was behind July 15th coup has become less important than what is going on after it in Turkey. For all we know, Erdogan himself may have staged or induced the failed military coup (whose structure is still unknown) in order to make a much hardest putsch from the government. About one third of all state officers at nearly all levels are being purged (either arrested, dismissed or ordered to resign), including not just military officers but police, judges, civil servants and lots of teachers. Right in the aftermath of the putsch, massive purge lists, obviously prepared long before, were issued so Erdogan and his islamo-fascists can take full control of the state, beginning by the judiciary.
The fact that the military putsch failed to achieve anything of note, not capturing a single minister or taking any institution other than, briefly, a few media outlets, strongly suggests that the coup was staged or induced by the Machiavellian Hitler-loving Turkish President, although direct, definite, evidence of this has not yet surfaced.
In any case, real or fake, the military uprising has led to another much more clear type of putsch, a self-coup by Erdogan himself against the last remnants of democracy and secularism in Turkey. The first stage, that of taking full control of the state apparatus is well under way, while a second stage is foreseeable and will begin with the illegalization of the multiethnic, left-wing federalist party HDP, which represents the spirit of the 2013 popular uprising against Erdogan's islamo-fascism. As happened with the rise of Hitler, openly admired by Erdogan, the social-democratic (and Kemalist) CHP, the largest opposition party, will be left in limbo, boiling in internal contradictions, until the final decree of dissolution is issued in due time. The secularist fascist MHP will be in turn forced into assimilation to the AKP, purging any dissidence.
Alternatively a soft fascism will be implemented instead (as in Iran, Russia or Hungary), allowing token democracy and only illegalizing the HDP, whose legal fate is surely sealed. This option would allow for Turkey to remain in NATO without causing excessive scandal (not that outright dictatorships have been absent of NATO in the past but it seems harder to defend nowadays). In any case Erdogan's hold on power and the political islamization and fascistization of Turkey can be taken for granted.
Whatever the case, it seems that Erdogan's islamo-fascism is becoming entrenched in the Turkish state and that this failed coup is serving his totalitarian pursuit as the Reichstag's fire served his admired precursor Adolf Hitler.