Need some code to detect registered MAC addresses when in/out of range from WiFI router

When a wireless signal (WiFi or Bluetooth) comes within range of your home’s WiFi router, it is checked against previously registered MAC addresses such as a smartphone coming within range of the home WiFI network.
Is there some code that could be resident on Electric Imp WiFi to detect other mobile addresses coming withinor out of range from the network?

Not really. The imp is a client device, so it looks for routers, not other client devices. There is an imp API call, imp.scanwifinetworks(), which lists nearby wireless networks and this will pick up a smartphone or tablet that is operating as a hotspot.

Thank you for your response. So I was wondering if I can detect the MAC address to be able to register them in an app (for a smartphone that is)

iOS doesn’t let you scan for wifi APs (and as smittytone says, you’d only be able to “See” APs from a client; clients can’t see each other without essentially doing wireless trace)

Can EIMP modules notify the agent when wifi becomes connected (in range) disconnected (out of range)?

Consider device.isconnected(), device.onconnect() and device.ondisconnect(), all available in the agent. ondisconnect is effectively called after a timeout or after explicit instruction from the device that it is going offline. So, if your imp loses connection with its Access Point, it may be a few minutes before your agent is notified.