Created
October 5, 2016 20:43
-
-
Save adrianfaciu/14a2bcadbfdc8dc669801ecd66193f82 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update(red: number, green: number, blue: number, white: number) { | |
const color = [86, red, green, blue, white, 240, 170].map(param => { | |
return this.convertToHexString(param); | |
}).join(","); | |
const updateMessage = this.getMessage(this.magicBlue.UUID, color); | |
this.bluetoothService.write(updateMessage); | |
} | |
getMessage(UUID: string, value: string): any { | |
return { | |
peripheralUUID: UUID, | |
serviceUUID: 'ffe5', | |
characteristicUUID: 'ffe9', | |
value: value | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment