From 03f9830ca9386f81c18abcf5aec90e5eefa2f48d Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Mon, 14 May 2018 13:50:39 -0700 Subject: [PATCH] Custom handler key --- libs/radio/radio.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/radio/radio.ts b/libs/radio/radio.ts index e820cef5..a2c91f64 100644 --- a/libs/radio/radio.ts +++ b/libs/radio/radio.ts @@ -49,7 +49,7 @@ namespace radio { * Registers code to run when the radio receives a packet. Also takes the * received packet from the radio queue. */ - //% help=radio/on-data-packet-received deprecated=true + //% help=radio/on-data-packet-received blockHandlerKey="radioreceived" deprecated=true //% mutate=objectdestructuring //% mutateText=Packet //% mutateDefaults="receivedNumber;receivedString:name,receivedNumber:value;receivedString" @@ -72,7 +72,7 @@ namespace radio { /** * Registers code to run when the radio receives a number. */ - //% help=radio/on-radio-received-number + //% help=radio/on-radio-received-number blockHandlerKey="radioreceived" //% blockId=radio_on_number block="on radio received" blockGap=8 export function onReceivedNumber(cb: (receivedNumber: number) => void) { onDataReceived(() => { @@ -90,7 +90,7 @@ namespace radio { /** * Registers code to run when the radio receives a key value pair. */ - //% help=radio/on-radio-received-value + //% help=radio/on-radio-received-value blockHandlerKey="radioreceived" //% blockId=radio_on_value block="on radio received" blockGap=8 export function onReceivedValue(cb: (name: string, value: number) => void) { onDataReceived(() => { @@ -109,7 +109,7 @@ namespace radio { /** * Registers code to run when the radio receives a string. */ - //% help=radio/on-radio-received-string + //% help=radio/on-radio-received-string blockHandlerKey="radioreceived" //% blockId=radio_on_string block="on radio received" blockGap=8 export function onReceivedString(cb: (receivedString: string) => void) { onDataReceived(() => { @@ -127,7 +127,7 @@ namespace radio { /** * Registers code to run when the radio receives a buffer. */ - //% help=radio/on-radio-received-buffer blockHidden=1 + //% help=radio/on-radio-received-buffer blockHandlerKey="radioreceived" blockHidden=1 //% blockId=radio_on_buffer block="on radio received" blockGap=8 export function onReceivedBuffer(cb: (buffer: Buffer) => void) { onDataReceived(() => {