Update the max length of a name in a sendValue packet (#1965)

This commit is contained in:
Richard Knoll 2019-04-05 10:45:06 -07:00 committed by GitHub
parent c2c4554e84
commit 3761d1282a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View File

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

View File

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

View File

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