Fork from https://github.com/RedBearLab/BLEFramework