Application-derived communication protocol selection in M2M platforms for smart cities