Text this: A cross-layer approach for optimizing the efficiency of wireless sensor and actor networks