Being mobile, the wireless sensors must adapt to the changing environment. Therefore, in the first part of this thesis we propose a mechanism to adapt the WSN architecture dynamically based on the detected context; this includes the dynamic detection of the topology change, the detection of the new context and consequently the dynamic adaptation of the communication layer. All of these actions are executed under constraints on energy consumption. The work done in this part poses the question of detecting the new context. This is a rather difficult question because it is unclear. The purpose of the second part is to detect on the fly the type of the competitor technology generating a traffic that interferes with the WSN. The proposed mechanism, FIM, identifies the cause of interference from errors model observed in the corrupt data packets. The context detection allows the nodes of the sensor network to obtain information about the environment. Some nodes must have more reliable information on the environment than others. How to retrieve the information? From which neighboring nodes? And what information to keep as safe and useful? Are the questions that are addressed in the third part. We propose a mechanism to dynamically decide if docition mechanisms should be used or not