From 24ecb143216ae1aa99f4869853bc2ed45e2e59f1 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Mon, 27 Mar 2017 15:43:37 -0700 Subject: [PATCH] undusted BT docs --- docs/SUMMARY.md | 29 +++++++++++++++++++ docs/reference/devices/on-gamepad-button.md | 5 ++-- docs/reference/devices/on-notified.md | 6 ++-- .../devices/on-signal-strength-changed.md | 8 ++--- docs/reference/devices/raise-alert-to.md | 20 ++++++------- docs/reference/devices/signal-strength.md | 8 ++--- docs/reference/devices/tell-camera-to.md | 6 ++-- .../devices/tell-remote-control-to.md | 6 ++-- libs/devices/shims.d.ts | 2 +- 9 files changed, 59 insertions(+), 31 deletions(-) diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index cbb20bb4..85a0c73c 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -88,6 +88,35 @@ * [set transmit power](/reference/radio/set-transmit-power) * [set transmit serial number](/reference/radio/set-transmit-serial-number) * [write received packet to serial](/reference/radio/write-received-packet-to-serial) + * [Bluetooth](/reference/bluetooth) + * [About](/reference/bluetooth/about-bluetooth) + * [Pairing](/reference/bluetooth/bluetooth-pairing) + * [on bluetooth connected](/reference/bluetooth/on-bluetooth-connected) + * [on bluetooth disconnected](/reference/bluetooth/on-bluetooth-disconnected) + * [start accelerometer service](/reference/bluetooth/start-accelerometer-service) + * [start button service](/reference/bluetooth/start-button-service) + * [start io pin service](/reference/bluetooth/start-io-pin-service) + * [start led service](/reference/bluetooth/start-led-service) + * [start magnetometer service](/reference/bluetooth/start-magnetometer-service) + * [start temperature service](/reference/bluetooth/start-temperature-service) + * [start uart service](/reference/bluetooth/start-uart-service) + * [uart read until](/reference/bluetooth/uart-read-until) + * [uart write string](/reference/bluetooth/uart-write-string) + * [uart write number](/reference/bluetooth/uart-write-number) + * [uart write value](/reference/bluetooth/uart-write-value) + * [advertise url](/reference/bluetooth/advertise-url) + * [stop advertising](/reference/bluetooth/stop-advertising) + * [advertise uid](/reference/bluetooth/advertise-uid) + * [advertise-uid-buffer](/reference/bluetooth/advertise-uid-buffer) + * [Devices](/reference/devices) + * [tell camera to](/reference/devices/tell-camera-to) + * [tell remote control to](/reference/devices/tell-remote-control-to) + * [raise alert to](/reference/devices/raise-alert-to) + * [on notified](/reference/devices/on-notified) + * [on gamepad button](/reference/devices/on-gamepad-button) + * [signal strength](/reference/devices/signal-strength) + * [on signal strength changed](/reference/devices/on-signal-strength-changed) + ## #other diff --git a/docs/reference/devices/on-gamepad-button.md b/docs/reference/devices/on-gamepad-button.md index 6eede4cc..adbb0551 100644 --- a/docs/reference/devices/on-gamepad-button.md +++ b/docs/reference/devices/on-gamepad-button.md @@ -3,10 +3,9 @@ Register code to run when the @boardname@ receives a command from the paired gamepad. ### ~hint +![](/static/bluetooth/Bluetooth_SIG.png) -The functions in the ``devices`` namespace allow the @boardname@ to communicate with a separate (remote) device, -such as a smartphone, over Bluetooth (Smart). -The set of supported events will depend on the remote device and the @boardname@ apps available for the remote device. +For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features. ### ~ diff --git a/docs/reference/devices/on-notified.md b/docs/reference/devices/on-notified.md index 456d88af..70a72270 100644 --- a/docs/reference/devices/on-notified.md +++ b/docs/reference/devices/on-notified.md @@ -3,14 +3,14 @@ Register code to run when the signal strength of the paired device changes. ### ~hint +![](/static/bluetooth/Bluetooth_SIG.png) -The functions in the ``devices`` namespace allow the @boardname@ to communicate with a separate (remote) device, -such as a smartphone, over Bluetooth (Smart). -The set of supported events will depend on the remote device and the @boardname@ apps available for the remote device. +For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features. ### ~ + ```sig devices.onNotified(MesDeviceInfo.IncomingCall, () => {}) ``` diff --git a/docs/reference/devices/on-signal-strength-changed.md b/docs/reference/devices/on-signal-strength-changed.md index b51b3345..09ab34f2 100644 --- a/docs/reference/devices/on-signal-strength-changed.md +++ b/docs/reference/devices/on-signal-strength-changed.md @@ -3,14 +3,14 @@ Register code to run when the signal strength of the paired device changes. ### ~hint +![](/static/bluetooth/Bluetooth_SIG.png) -The functions in the ``devices`` namespace allow the @boardname@ to communicate with a separate (remote) device, -such as a smartphone, over Bluetooth (Smart). -The set of supported events will depend on the remote device and the @boardname@ apps available for the remote device. +For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features. ### ~ + ```sig devices.onSignalStrengthChanged(() => {}) ``` @@ -25,7 +25,7 @@ Display the signal strength on screen: ```blocks devices.onSignalStrengthChanged(() => { - basic.showNumber(devices.signalStrength(), 150) + basic.showNumber(devices.signalStrength()) }) ``` diff --git a/docs/reference/devices/raise-alert-to.md b/docs/reference/devices/raise-alert-to.md index a0fabbab..76bb0755 100644 --- a/docs/reference/devices/raise-alert-to.md +++ b/docs/reference/devices/raise-alert-to.md @@ -3,16 +3,16 @@ Raise an alert on a remote device. ### ~hint +![](/static/bluetooth/Bluetooth_SIG.png) -The functions in the ``devices`` namespace allow the @boardname@ to communicate with a separate (remote) device, -such as a smartphone, over Bluetooth (Smart). -The set of supported events will depend on the remote device and the @boardname@ apps available for the remote device. +For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features. ### ~ + ```sig -export function raiseAlertTo(event: string) +devices.raiseAlertTo(MesAlertEvent.Vibrate) ``` ### Parameters @@ -24,37 +24,37 @@ export function raiseAlertTo(event: string) To tell the connected device to display toast ```blocks -devices.raiseAlertTo("display toast") +devices.raiseAlertTo(MesAlertEvent.DisplayToast) ``` To tell the connected device to vibrate ```blocks -devices.raiseAlertTo("vibrate") +devices.raiseAlertTo(MesAlertEvent.Vibrate) ``` To tell the connected device to play a sound ```blocks -devices.raiseAlertTo("play sound") +devices.raiseAlertTo(MesAlertEvent.PlaySound) ``` To tell the connected device to play a ringtone ```blocks -devices.raiseAlertTo("play ringtone") +devices.raiseAlertTo(MesAlertEvent.PlayRingtone) ``` To tell the connected device to find my phone ```blocks -devices.raiseAlertTo("find my phone") +devices.raiseAlertTo(MesAlertEvent.FindMyPhone) ``` To tell the connected device to ring alarm ```blocks -devices.raiseAlertTo("ring alarm") +devices.raiseAlertTo(MesAlertEvent.RingAlarm) ``` ### See also diff --git a/docs/reference/devices/signal-strength.md b/docs/reference/devices/signal-strength.md index 7df8b9f4..0e87fc16 100644 --- a/docs/reference/devices/signal-strength.md +++ b/docs/reference/devices/signal-strength.md @@ -3,13 +3,13 @@ Returns the signal strength reported by the paired device from ``0`` (no signal) to ``4`` (full strength). ### ~hint +![](/static/bluetooth/Bluetooth_SIG.png) -The functions in the ``devices`` namespace allow the @boardname@ to communicate with a separate (remote) device, -such as a smartphone, over Bluetooth (Smart). -The set of supported events will depend on the remote device and the @boardname@ apps available for the remote device. +For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features. ### ~ + ```sig devices.signalStrength(); ``` @@ -24,7 +24,7 @@ Display the signal strength on screen: ```blocks devices.onSignalStrengthChanged(() => { - basic.showNumber(devices.signalStrength(), 150) + basic.showNumber(devices.signalStrength()) }) ``` diff --git a/docs/reference/devices/tell-camera-to.md b/docs/reference/devices/tell-camera-to.md index 56895623..13ebcea8 100644 --- a/docs/reference/devices/tell-camera-to.md +++ b/docs/reference/devices/tell-camera-to.md @@ -3,13 +3,13 @@ Access the photo/video-taking functionality of a remote device using the ``tell camera to`` function. ### ~hint +![](/static/bluetooth/Bluetooth_SIG.png) -The functions in the ``devices`` namespace allow the @boardname@ to communicate with a separate (remote) device, -such as a smartphone, over Bluetooth (Smart). -The set of supported events will depend on the remote device and the @boardname@ apps available for the remote device. +For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features. ### ~ + ```sig devices.tellCameraTo(MesCameraEvent.TakePhoto) ``` diff --git a/docs/reference/devices/tell-remote-control-to.md b/docs/reference/devices/tell-remote-control-to.md index 26ca3032..bf05e8d4 100644 --- a/docs/reference/devices/tell-remote-control-to.md +++ b/docs/reference/devices/tell-remote-control-to.md @@ -3,13 +3,13 @@ Control the presentation of media content available on a remote device using the `tell remote control` to function. ### ~hint +![](/static/bluetooth/Bluetooth_SIG.png) -The functions in the ``devices`` namespace allow the @boardname@ to communicate with a separate (remote) device, -such as a smartphone, over Bluetooth (Smart). -The set of supported events will depend on the remote device and the @boardname@ apps available for the remote device. +For another device like a smartphone to use any of the Bluetooth "services" which the @boardname@ has, it must first be [paired with the @boardname@](/reference/bluetooth/bluetooth-pairing). Once paired, the other device may connect to the @boardname@ and exchange data relating to many of the @boardname@'s features. ### ~ + ```sig devices.tellRemoteControlTo(MesRemoteControlEvent.play) ``` diff --git a/libs/devices/shims.d.ts b/libs/devices/shims.d.ts index 9b152593..3c8887f5 100644 --- a/libs/devices/shims.d.ts +++ b/libs/devices/shims.d.ts @@ -4,7 +4,7 @@ /** * Control a phone with the BBC micro:bit via Bluetooth. */ - //% color=156 weight=80 + //% color=#008272 weight=80 icon="\uf10b" declare namespace devices { /**