Not with Edge. It doesn't permit gateway scripting, nor does it permit SQL access.
In a standard install, this is relatively easy in combination with the Serial Module. Or if you are using a TCP-to-serial converter, with native Java networking.
This topic might be helpful: