Skip to content

Instantly share code, notes, and snippets.

@adrianfaciu
Created October 5, 2016 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianfaciu/14a2bcadbfdc8dc669801ecd66193f82 to your computer and use it in GitHub Desktop.
Save adrianfaciu/14a2bcadbfdc8dc669801ecd66193f82 to your computer and use it in GitHub Desktop.
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