Wireless connectivity for the Internet of Things (IoT) requires combining low latency and high reliability with power and cost constraints. On top of that, diverse applications and end-to-end services with very different performance requirements should ideally share the same network infrastructure. Software defined networks (SDN) were defined to allow this coexistence, but they have seen very limited adoption in IoT systems due to the inherent resource constrained nature of the wireless devices. Additionally, the low-power nature of IoT communication standards does not usually allow for physically separated control and data channels, which is a basic requirement for real-time network slicing. In this work, we propose a SDN implementation for Bluetooth Low Energy (BLE), which has become the de-facto technology for IoT applications. The proposed BLE mesh structure is able to use different protocols for different services, ensuring a clear separation between control and data channels while still being sent over the wireless medium. A proof-of-concept for the proposed SDN implementation is given in a real BLE mesh testbed, where measurements show how the system is able to automatically detect and recover from network congestion by identifying the nodes responsible of such situation and reconfiguring their parameters over the air.