2016-04-03 02:34:06 +02:00
|
|
|
// Auto-generated. Do not edit.
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-02 05:58:26 +01:00
|
|
|
//% color=#E3008C weight=96 icon="\uf012"
|
2016-04-03 02:34:06 +02:00
|
|
|
declare namespace radio {
|
|
|
|
|
|
|
|
/**
|
2019-12-02 05:58:26 +01:00
|
|
|
* Sends an event over radio to neigboring devices
|
2016-04-03 02:34:06 +02:00
|
|
|
*/
|
2019-12-02 05:58:26 +01:00
|
|
|
//% blockId=radioRaiseEvent block="radio raise event|from source %src=control_event_source_id|with value %value=control_event_value_id"
|
|
|
|
//% blockExternalInputs=1
|
|
|
|
//% advanced=true
|
|
|
|
//% weight=1
|
|
|
|
//% help=radio/raise-event shim=radio::raiseEvent
|
|
|
|
function raiseEvent(src: int32, value: int32): void;
|
2016-04-03 02:34:06 +02:00
|
|
|
|
2016-05-10 07:55:37 +02:00
|
|
|
/**
|
2019-12-02 05:58:26 +01:00
|
|
|
* Internal use only. Takes the next packet from the radio queue and returns its contents + RSSI in a Buffer
|
2016-05-10 07:55:37 +02:00
|
|
|
*/
|
2019-12-02 05:58:26 +01:00
|
|
|
//% shim=radio::readRawPacket
|
|
|
|
function readRawPacket(): Buffer;
|
2016-05-10 07:55:37 +02:00
|
|
|
|
2016-05-12 21:35:40 +02:00
|
|
|
/**
|
2019-12-02 05:58:26 +01:00
|
|
|
* Internal use only. Sends a raw packet through the radio (assumes RSSI appened to packet)
|
2016-05-12 21:35:40 +02:00
|
|
|
*/
|
2019-12-02 05:58:26 +01:00
|
|
|
//% async shim=radio::sendRawPacket
|
|
|
|
function sendRawPacket(msg: Buffer): void;
|
2016-04-03 02:34:06 +02:00
|
|
|
|
2016-08-09 01:54:43 +02:00
|
|
|
/**
|
2020-05-08 18:35:38 +02:00
|
|
|
* Used internally by the library.
|
2016-08-09 01:54:43 +02:00
|
|
|
*/
|
|
|
|
//% help=radio/on-data-received
|
2020-05-08 18:35:38 +02:00
|
|
|
//% weight=0
|
2016-10-24 21:55:44 +02:00
|
|
|
//% blockId=radio_datagram_received_event block="radio on data received" blockGap=8
|
2020-05-08 18:35:38 +02:00
|
|
|
//% deprecated=true blockHidden=1 shim=radio::onDataReceived
|
2016-08-09 01:54:43 +02:00
|
|
|
function onDataReceived(body: () => void): void;
|
|
|
|
|
2016-04-03 02:34:06 +02:00
|
|
|
/**
|
|
|
|
* Sets the group id for radio communications. A micro:bit can only listen to one group ID at any time.
|
2019-12-02 05:58:26 +01:00
|
|
|
* @param id the group id between ``0`` and ``255``, eg: 1
|
2016-04-03 02:34:06 +02:00
|
|
|
*/
|
|
|
|
//% help=radio/set-group
|
2019-12-02 05:58:26 +01:00
|
|
|
//% weight=100
|
|
|
|
//% blockId=radio_set_group block="radio set group %ID"
|
|
|
|
//% id.min=0 id.max=255 shim=radio::setGroup
|
|
|
|
function setGroup(id: int32): void;
|
2016-04-03 02:34:06 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Change the output power level of the transmitter to the given value.
|
2016-06-19 14:15:13 +02:00
|
|
|
* @param power a value in the range 0..7, where 0 is the lowest power and 7 is the highest. eg: 7
|
2016-04-03 02:34:06 +02:00
|
|
|
*/
|
|
|
|
//% help=radio/set-transmit-power
|
2016-08-02 01:02:06 +02:00
|
|
|
//% weight=9 blockGap=8
|
2016-10-11 22:48:25 +02:00
|
|
|
//% blockId=radio_set_transmit_power block="radio set transmit power %power"
|
2019-12-02 05:58:26 +01:00
|
|
|
//% power.min=0 power.max=7
|
2016-10-11 22:48:25 +02:00
|
|
|
//% advanced=true shim=radio::setTransmitPower
|
2019-12-02 05:58:26 +01:00
|
|
|
function setTransmitPower(power: int32): void;
|
2016-05-11 06:13:16 +02:00
|
|
|
|
|
|
|
/**
|
2019-12-02 05:58:26 +01:00
|
|
|
* Change the transmission and reception band of the radio to the given channel
|
|
|
|
* @param band a frequency band in the range 0 - 83. Each step is 1MHz wide, based at 2400MHz.
|
|
|
|
**/
|
|
|
|
//% help=radio/set-frequency-band
|
2016-08-02 01:02:06 +02:00
|
|
|
//% weight=8 blockGap=8
|
2019-12-02 05:58:26 +01:00
|
|
|
//% blockId=radio_set_frequency_band block="radio set frequency band %band"
|
|
|
|
//% band.min=0 band.max=83
|
|
|
|
//% advanced=true shim=radio::setFrequencyBand
|
|
|
|
function setFrequencyBand(band: int32): void;
|
2016-04-03 02:34:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Auto-generated. Do not edit. Really.
|