If you wanted to sell an application for customers to download into their own units, how could you prevent them from just buying one copy and then loading it into multiple units?
I thought of having something like a “licence code” that relates to the IMEI:
The customer would have to specify the IMEI, and would receive a “licence code” calculated from it;
There would need to be an AT Command or something to store this into Flash;
The application would then check the code in Flash against the IMEI, and only run (properly) if they matched.
But I wouldn’t lock it simply to the IMEI, but to the internal serial number of the module instead.
That way the customer can, if they need to, change IMEI of the module without disabling the application.
For the calculation I can only recommend you look at some cryptographic signature methods.
No matter what you do though, if the customer really wants to, they’ll find a way to bypass your protections. Most don’t really have the know-how though, so the above should work reasonably well.