SNPS: an OSGi-based middleware for Wireless Sensor Networks