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 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
|
||||
radio.sendValue("name", 0);
|
||||
|
@ -259,8 +259,9 @@ namespace radio {
|
||||
|
||||
/**
|
||||
* Broadcasts a name / value pair along with the device serial number
|
||||
* and running time to any connected micro:bit in the group.
|
||||
* @param name the field name (max 12 characters), eg: "name"
|
||||
* and running time to any connected micro:bit in the group. The name can
|
||||
* include no more than 8 characters.
|
||||
* @param name the field name (max 8 characters), eg: "name"
|
||||
* @param value the numeric value
|
||||
*/
|
||||
//% help=radio/send-value
|
||||
|
@ -160,7 +160,7 @@ namespace pxsim.radio {
|
||||
}
|
||||
|
||||
export function sendValue(name: string, value: number) {
|
||||
name = name.substr(0, 12);
|
||||
name = name.substr(0, 8);
|
||||
const msg: number[] = [];
|
||||
msg.push()
|
||||
board().radioState.datagram.send({
|
||||
|
Loading…
Reference in New Issue
Block a user