Updating radio JSON writing API (#290)

This commit is contained in:
Richard Knoll
2016-10-25 16:38:01 -07:00
committed by Peli de Halleux
parent 7d912110f4
commit f191d9033d
6 changed files with 118 additions and 34 deletions

12
libs/radio/shims.d.ts vendored
View File

@ -40,9 +40,19 @@ declare namespace radio {
//% help=radio/write-value-to-serial
//% weight=3
//% blockId=radio_write_value_serial block="radio write value to serial"
//% advanced=true shim=radio::writeValueToSerial
//% deprecated=true shim=radio::writeValueToSerial
function writeValueToSerial(): void;
/**
* Writes the last received packet to serial as JSON. This should be called
* within an ``onDataPacketReceived`` callback.
*/
//% help=radio/write-received-packet-to-serial
//% weight=3
//% blockId=radio_write_packet_serial block="radio write received packet to serial"
//% advanced=true shim=radio::writeReceivedPacketToSerial
function writeReceivedPacketToSerial(): void;
/**
* Reads the next packet from the radio queue and returns the packet's number
* payload or 0 if the packet did not contain a number.