Update the max length of a name in a sendValue packet (#1965)
This commit is contained in:
parent
c2c4554e84
commit
3761d1282a
@ -1,7 +1,7 @@
|
|||||||
# send Value
|
# send Value
|
||||||
|
|
||||||
Send a [string]() and [number]() together by ``radio`` to other @boardname@s.
|
Send a [string]() and [number]() together by ``radio`` to other @boardname@s.
|
||||||
The maximum [string]() length is 12 characters.
|
The maximum [string]() length is 8 characters.
|
||||||
|
|
||||||
```sig
|
```sig
|
||||||
radio.sendValue("name", 0);
|
radio.sendValue("name", 0);
|
||||||
|
@ -259,8 +259,9 @@ namespace radio {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Broadcasts a name / value pair along with the device serial number
|
* Broadcasts a name / value pair along with the device serial number
|
||||||
* and running time to any connected micro:bit in the group.
|
* and running time to any connected micro:bit in the group. The name can
|
||||||
* @param name the field name (max 12 characters), eg: "name"
|
* include no more than 8 characters.
|
||||||
|
* @param name the field name (max 8 characters), eg: "name"
|
||||||
* @param value the numeric value
|
* @param value the numeric value
|
||||||
*/
|
*/
|
||||||
//% help=radio/send-value
|
//% help=radio/send-value
|
||||||
|
@ -160,7 +160,7 @@ namespace pxsim.radio {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function sendValue(name: string, value: number) {
|
export function sendValue(name: string, value: number) {
|
||||||
name = name.substr(0, 12);
|
name = name.substr(0, 8);
|
||||||
const msg: number[] = [];
|
const msg: number[] = [];
|
||||||
msg.push()
|
msg.push()
|
||||||
board().radioState.datagram.send({
|
board().radioState.datagram.send({
|
||||||
|
Loading…
Reference in New Issue
Block a user