undusted BT docs

This commit is contained in:
Peli de Halleux
2017-03-27 15:43:37 -07:00
parent f3025c65c9
commit 24ecb14321
9 changed files with 59 additions and 31 deletions

View File

@ -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.
### ~

View File

@ -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, () => {})
```

View File

@ -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())
})
```

View File

@ -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

View File

@ -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())
})
```

View File

@ -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)
```

View File

@ -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)
```