Skip to main content

hardware.getdeviceid()

Returns the device’s unique ID code

Availability

Device

Returns

String — the device’s ID code

Description

The device ID is the imp-enabled device’s authentication code, generated by imp modules themselves, or from a security chip built into devices designed to take imp001 cards. For example, the device ID is used to identify which devices are tied to your developer account and to ensure production devices are supplied the correct the application firmware. You can view a developer device’s device ID in the IDE, at the top of the device code pane. A device’s ID never changes.

This method is only available on the device. If an agent needs to know the ID of the device to which it is paired, it can use the imp object’s property imp.configparams which includes the device ID in its deviceid key:

local myDevId = imp.configparams.deviceid;

hardware.getdeviceid() returns the same ID as that returned by the deprecated getimpeeid() method.