Added most of peripheral bluetooth functionality.