upgraded to lancaster 2.0.0.rc3 (core 0.1.9)

added radio.send/receive string
This commit is contained in:
Peli de Halleux
2016-05-12 12:35:40 -07:00
parent 78f9af5bc2
commit b4bc985068
11 changed files with 125 additions and 158 deletions

View File

@@ -10,7 +10,7 @@ declare namespace radio {
*/
//% help=radio/send-number
//% weight=60
//% blockId=radio_datagram_send block="send number %MESSAGE" blockGap=8 shim=radio::sendNumber
//% blockId=radio_datagram_send block="send number %value" blockGap=8 shim=radio::sendNumber
function sendNumber(value: number): void;
/**
@@ -21,9 +21,17 @@ declare namespace radio {
*/
//% help=radio/send-value
//% weight=59
//% blockId=radio_datagram_send_value block="send|value %name|= %value" shim=radio::sendValue
//% blockId=radio_datagram_send_value block="send|value %name|= %value" blockGap=8 shim=radio::sendValue
function sendValue(name: string, value: number): void;
/**
* Broadcasts a number over radio to any connected micro:bit in the group.
*/
//% help=radio/send-string
//% weight=58
//% blockId=radio_datagram_send_string block="send string %msg" shim=radio::sendString
function sendString(msg: string): void;
/**
* Reads a value sent with `stream value` and writes it
* to the serial stream as JSON
@@ -58,6 +66,14 @@ declare namespace radio {
//% blockId=radio_datagram_receive block="receive number" blockGap=8 shim=radio::receiveNumber
function receiveNumber(): number;
/**
* Reads the next packet as a string and returns it.
*/
//% blockId=radio_datagram_receive_string block="receive string" blockGap=8
//% weight=44
//% help=radio/receive-string shim=radio::receiveString
function receiveString(): string;
/**
* Gets the received signal strength indicator (RSSI) from the packet received by ``receive number``. Not supported in simulator.
* namespace=radio