Your next iPhone could play double duty as a smoke detector. The smartphone could have the ability to take on a fire safety role, without the need to be mounted to a ceiling, an invention from Apple reveals.

A patent granted to Apple and published by the U.S. Patent and Trademark Office Tuesday, titled “Wireless Device Networks with Smoke Detection Capabilities,” details how the company could build in a smoke detector within its iPhones, iPads and Macs. Once smoke is picked up by the sensor, the device could transmit alerts to another electronic device along with a graphic or map displaying where the smoke alert was triggered.

Smoke Detector iPhone A cross-sectional view of the smoke detector mounted inside the speaker grill of a device. Photo: USPTO/Apple Inc.

The device also would be able to wirelessly transmit commands to a fire sprinkler and alert emergency services with details about where the smoke was detected along with how many occupants are present inside a building.

Apple Emergency An example of an alert that could be sent by a device to emergency personnel. Photo: USPTO/Apple Inc.

Apple could do this in multiple ways. In one version of the invention, it proposes installing the smoke detector sensor into the speaker port of an iPhone. The smoke detector feature also could be built into other devices, such as its wireless routers and the Apple TV.

As with many of Apple’s patents, it’s unknown if or when the company plans to use the invention in one of its products. But if were to bring it to market, one place the smoke detector feature could integrate well with is HomeKit -- Apple’s software framework for controlling and communicating with appliances and accessories throughout the home.

The Apple TV set-top box is a central part to HomeKit and can let iPhone users remotely control their appliances while away from home, according to a support document from Apple.

The application for the patent was first filed on May 20, 2013, and credits Apple engineer Paul G. Puskarich for the invention.

Apple is expected to unveil a number of products during a media event on Sept. 9, including the anticipated iPhone 6S and a revamped Apple TV.