Resistive switching in optoelectronic III-V materials based on deep traps