Energy-efficient device discovery is vital in public-safety systems. We investigate the problem of maximizing the number of discovered users under the major constraint of overlay interference, which occurs in device-to-device (D2D) communications, from users simultaneously accessing the resources. To solve this problem, we propose a D2D discovery maximization (D2D-DM) iterative algorithm, which provides the capability to switch the discovery mode from half-duplex to in-band full-duplex, when signal-to-interference-noise ratio falls below a predefined threshold. Moreover, the open-loop power control scheme is adopted for power-limited users. Simulation results demonstrate that the proposed D2D-DM scheme significantly enhances the number of discovered users as compared to conventional static resource allocation and the random backoff schemes.