I’m in IoT

Vadim Makeev, HTML Academy

A person hugging smiling diod

I’m in IoT

HTML Academy logo
A boy standing next to a griffin
Bluetooth logo Haglaz rune Bjarkan rune
Bearded viking

Harald
Bluetooth

Bluetooth

2.4 GHz

Radio wave

Bluetooth EDR

Bluetooth EDR

Wireless headphones

Bluetooth LE

Bluetooth LE

Beacon
Bluetooth Smart logo

GATT

nRF Connect

nRF Connect logo

Services

Unknown Service in most cases, although there are 35 standard ones.

Characteristics

Unknown Characteristic in most cases, although there are 179 standard ones.

Characteristics

Read Write Notify
Playbulb Sphere lamp

Lamp!

Web Bluetooth

Flight mode icon
Seat belt icon

Lamp

			navigator.bluetooth.requestDevice({
				filters: [{ name: 'Bulb' }],
				optionalServices: [0xFF08]
			}).then(device => {
				return device.gatt.connect();
			}).then(server)
		

Lamp

			.then(server => {
				return server.getPrimaryService(0xFF08);
			}).then(service => {
				return service.getCharacteristic(0xFFFC);
			}).then(characteristic)
		

Color validation

			<input type="text"
				pattern="^#(?:[0-9a-fA-F]{3}){1,2}$"
				required value="#FFF">
			<script>
				if (event.target.checkValidity()) {
					// …
			</script>
		

Lamp

			.then(characteristic => {
				return characteristic.writeValue(
					new Uint8Array([0, 255, 0, 0])
				);
			});
		

Rainbow

			const LAMP_EFFECT = [ 0x00, // ?
			                      0xFF, // Red
			                      0xFF, // Green
			                      0xFF, // Blue
			                      0x03, // Type
			                      0x00, // ?
			                      0x06, 0x06 // Speed ];
		

Drone!

Parrot Mars drone
Drone with a stormtrooper

webdr.one

WebDrone PWA
Can I Use saying NO Web Bluetooth on Can I Use
Chrome logo Opera logo Samsung Internet logo

Bluetooth 5.0

More? Sure!

sokr.me/iot

@pepelsbey

Shower logo

Shower

Questions?