This commit is contained in:
Juri
2020-08-19 22:03:58 +02:00
parent 4ef7b9318f
commit 3152215415
291 changed files with 9511 additions and 2966 deletions

View File

@ -19,7 +19,7 @@
"radio.onReceivedValue": "Registers code to run when the radio receives a key value pair.",
"radio.onReceivedValueDeprecated": "Registers code to run when the radio receives a key value pair. Deprecated, use\nonReceivedValue instead.",
"radio.raiseEvent": "Sends an event over radio to neigboring devices",
"radio.readRawPacket": "Internal use only. Takes the next packet from the radio queue and returns its contents + RSSI in a Buffer",
"radio.readRawPacket": "Internal use only. Takes the next packet from the radio queue and returns its contents + RSSI in a Buffer.\n@returns NULL if no packet available",
"radio.receiveNumber": "Reads the next packet from the radio queue and returns the packet's number\npayload or 0 if the packet did not contain a number.",
"radio.receiveString": "Reads the next packet from the radio queue and returns the packet's string\npayload or the empty string if the packet did not contain a string.",
"radio.receivedBuffer": "Returns the buffer payload from the last packet taken from the radio queue\n(via ``receiveNumber``, ``receiveString``, etc) or the empty string if that\npacket did not contain a string.",

View File

@ -16,7 +16,8 @@ declare namespace radio {
function raiseEvent(src: int32, value: int32): void;
/**
* Internal use only. Takes the next packet from the radio queue and returns its contents + RSSI in a Buffer
* Internal use only. Takes the next packet from the radio queue and returns its contents + RSSI in a Buffer.
* @returns NULL if no packet available
*/
//% shim=radio::readRawPacket
function readRawPacket(): Buffer;

View File

@ -195,7 +195,8 @@ namespace radio {
//% deprecated=true
export function writeValueToSerial() {
const p = RadioPacket.getPacket(radio.readRawPacket());
writeToSerial(p);
if(p)
writeToSerial(p);
}
/**