merging microbit
This commit is contained in:
		@@ -140,6 +140,7 @@
 | 
			
		||||
  "input.temperature": "Gets the temperature in Celsius degrees (°C).",
 | 
			
		||||
  "led": "Control of the LED screen.",
 | 
			
		||||
  "led.brightness": "Get the screen brightness from 0 (off) to 255 (full bright).",
 | 
			
		||||
  "led.enable": "Turns on or off the display",
 | 
			
		||||
  "led.fadeIn": "Fades in the screen display.",
 | 
			
		||||
  "led.fadeIn|param|ms": "TODO",
 | 
			
		||||
  "led.fadeOut": "Fades out the screen brightness.",
 | 
			
		||||
@@ -158,7 +159,7 @@
 | 
			
		||||
  "led.setBrightness": "Set the screen brightness from 0 (off) to 255 (full bright).",
 | 
			
		||||
  "led.setBrightness|param|value": "the brightness value, eg:255, 127, 0",
 | 
			
		||||
  "led.setDisplayMode": "Sets the display mode between black and white and greyscale for rendering LEDs.",
 | 
			
		||||
  "led.setDisplayMode|param|mode": "TODO",
 | 
			
		||||
  "led.setDisplayMode|param|mode": "mode the display mode in which the screen operates",
 | 
			
		||||
  "led.stopAnimation": "Cancels the current animation and clears other pending animations.",
 | 
			
		||||
  "led.toggle": "Toggles a particular pixel",
 | 
			
		||||
  "led.toggleAll": "Inverts the current LED display",
 | 
			
		||||
 
 | 
			
		||||
@@ -1,38 +1,95 @@
 | 
			
		||||
{
 | 
			
		||||
  "Math.abs": "",
 | 
			
		||||
  "Math.abs|param|x": "",
 | 
			
		||||
  "Math.max": "",
 | 
			
		||||
  "Math.min": "",
 | 
			
		||||
  "Math.pow": "",
 | 
			
		||||
  "Math.pow|param|x": "",
 | 
			
		||||
  "Math.pow|param|y": "",
 | 
			
		||||
  "Math.random": "",
 | 
			
		||||
  "Math.randomBoolean": "Génère une valeur « true » ou « false » au hasard, comme si vous lanciez une pièce de monnaie.",
 | 
			
		||||
  "String.fromCharCode": "",
 | 
			
		||||
  "basic": "",
 | 
			
		||||
  "basic.clearScreen": "",
 | 
			
		||||
  "Math.sign": "",
 | 
			
		||||
  "Math.sign|param|x": "",
 | 
			
		||||
  "Math.sqrt": "",
 | 
			
		||||
  "Math.sqrt|param|x": "",
 | 
			
		||||
  "String.charAt": "",
 | 
			
		||||
  "String.charAt|param|index": "",
 | 
			
		||||
  "String.charCodeAt": "",
 | 
			
		||||
  "String.charCodeAt|param|index": "",
 | 
			
		||||
  "String.compare": "",
 | 
			
		||||
  "String.compare|param|that": "",
 | 
			
		||||
  "String.concat": "",
 | 
			
		||||
  "String.concat|param|other": "",
 | 
			
		||||
  "String.fromCharCode": "Construit une chaîne à partir du code ASCII d'un caractère donné.",
 | 
			
		||||
  "String.isEmpty": "",
 | 
			
		||||
  "String.length": "",
 | 
			
		||||
  "String.substr": "",
 | 
			
		||||
  "String.substr|param|length": "",
 | 
			
		||||
  "String.substr|param|start": "",
 | 
			
		||||
  "basic": "Permet d’accéder aux fonctionnalités de base de la micro:bit.",
 | 
			
		||||
  "basic.clearScreen": "Éteindre toutes les LEDs",
 | 
			
		||||
  "basic.forever": "Répète le code indéfiniment en tâche de fond. A chaque itération, permet aux autres codes de s’exécuter.",
 | 
			
		||||
  "basic.pause": "Pause pendant la durée indiquée en millisecondes",
 | 
			
		||||
  "basic.pause|param|ms": "",
 | 
			
		||||
  "basic.plotLeds": "",
 | 
			
		||||
  "basic.plotLeds|param|leds": "",
 | 
			
		||||
  "basic.showAnimation": "",
 | 
			
		||||
  "basic.showAnimation|param|interval": "",
 | 
			
		||||
  "basic.showAnimation|param|leds": "",
 | 
			
		||||
  "basic.showLeds": "",
 | 
			
		||||
  "basic.showLeds|param|interval": "",
 | 
			
		||||
  "basic.showLeds|param|leds": "",
 | 
			
		||||
  "basic.showNumber": "",
 | 
			
		||||
  "basic.showNumber|param|interval": "",
 | 
			
		||||
  "basic.showString": "",
 | 
			
		||||
  "basic.showString|param|interval": "",
 | 
			
		||||
  "basic.showString|param|text": "",
 | 
			
		||||
  "basic.pause|param|ms": "combien de temps dure une pause, par ex. : 100, 200, 500, 1000, 2000",
 | 
			
		||||
  "basic.plotLeds": "Dessine une image sur l’écran de LEDs.",
 | 
			
		||||
  "basic.plotLeds|param|leds": "motif de LEDs à allumer/éteindre",
 | 
			
		||||
  "basic.showAnimation": "Montre une séquence de motifs LED comme une animation.",
 | 
			
		||||
  "basic.showAnimation|param|interval": "temps en millisecondes entre chaque rafraîchissement",
 | 
			
		||||
  "basic.showAnimation|param|leds": "motif de LEDs à allumer/éteindre",
 | 
			
		||||
  "basic.showLeds": "Dessine une image sur l’écran de LEDs.",
 | 
			
		||||
  "basic.showLeds|param|interval": "temps de pause en millisecondes après avoir dessiné",
 | 
			
		||||
  "basic.showLeds|param|leds": "le motif de LED à allumer/éteindre",
 | 
			
		||||
  "basic.showNumber": "Fait défiler un nombre à l'écran. Si le nombre rentre dans l'écran (i.e. un seul chiffre), ne défile pas.",
 | 
			
		||||
  "basic.showNumber|param|interval": "vitesse de défilement ; par ex : 150, 100, 200, -100",
 | 
			
		||||
  "basic.showString": "Afficher du texte à l’écran, un caractère à la fois. Si la chaîne rentre sur l’écran (c'est-à-dire une seule lettre), ne défile pas.",
 | 
			
		||||
  "basic.showString|param|interval": "à quelle vitesse se déplacent les caractères ; par ex. : 150, 100, 200, -100",
 | 
			
		||||
  "basic.showString|param|text": "le texte à faire défiler sur l’écran, par exemple : « Bonjour ! »",
 | 
			
		||||
  "control": "",
 | 
			
		||||
  "control.inBackground": "",
 | 
			
		||||
  "control.reset": "",
 | 
			
		||||
  "control.assert": "",
 | 
			
		||||
  "control.deviceName": "",
 | 
			
		||||
  "control.deviceSerialNumber": "",
 | 
			
		||||
  "control.eventSourceId": "",
 | 
			
		||||
  "control.eventTimestamp": "",
 | 
			
		||||
  "control.eventValue": "",
 | 
			
		||||
  "control.eventValueId": "",
 | 
			
		||||
  "control.inBackground": "Planifie le code qui s’exécute en arrière-plan.",
 | 
			
		||||
  "control.onEvent": "",
 | 
			
		||||
  "control.panic": "",
 | 
			
		||||
  "control.raiseEvent": "",
 | 
			
		||||
  "control.raiseEvent|param|mode": "",
 | 
			
		||||
  "control.raiseEvent|param|src": "",
 | 
			
		||||
  "control.raiseEvent|param|value": "",
 | 
			
		||||
  "control.reset": "Réinitialise le micro:bit de BBC.",
 | 
			
		||||
  "control.runtimeWarning": "",
 | 
			
		||||
  "control.waitMicros": "",
 | 
			
		||||
  "control.waitMicros|param|micros": "",
 | 
			
		||||
  "game": "",
 | 
			
		||||
  "game.addScore": "",
 | 
			
		||||
  "game.addScore|param|points": "",
 | 
			
		||||
  "game.gameOver": "",
 | 
			
		||||
  "game.score": "",
 | 
			
		||||
  "game.setScore": "",
 | 
			
		||||
  "control.waitMicros|param|micros": "nombre de microsecondes à attendre. par ex. : 4",
 | 
			
		||||
  "game": "Un moteur de jeu avec une unique LED",
 | 
			
		||||
  "game.addLife": "",
 | 
			
		||||
  "game.addLife|param|lives": "",
 | 
			
		||||
  "game.addScore": "Ajoute des points au score actuel",
 | 
			
		||||
  "game.addScore|param|points": "nombre de points à changer, par ex. : 1",
 | 
			
		||||
  "game.createSprite": "",
 | 
			
		||||
  "game.createSprite|param|x": "",
 | 
			
		||||
  "game.createSprite|param|y": "",
 | 
			
		||||
  "game.currentTime": "",
 | 
			
		||||
  "game.gameOver": "Affiche un animation de fin de jeu.",
 | 
			
		||||
  "game.invalidSprite": "",
 | 
			
		||||
  "game.isGameOver": "",
 | 
			
		||||
  "game.isRunning": "",
 | 
			
		||||
  "game.level": "",
 | 
			
		||||
  "game.levelUp": "",
 | 
			
		||||
  "game.life": "",
 | 
			
		||||
  "game.removeLife": "",
 | 
			
		||||
  "game.removeLife|param|life": "",
 | 
			
		||||
  "game.score": "Obtient le score actuel",
 | 
			
		||||
  "game.setLife": "",
 | 
			
		||||
  "game.setLife|param|value": "",
 | 
			
		||||
  "game.setScore": "Définit la valeur du score actuel",
 | 
			
		||||
  "game.setScore|param|value": "",
 | 
			
		||||
  "game.showScore": "",
 | 
			
		||||
  "game.startCountdown": "",
 | 
			
		||||
  "game.startCountdown|param|ms": "",
 | 
			
		||||
  "game.startStopwatch": "",
 | 
			
		||||
  "images": "",
 | 
			
		||||
  "images.createBigImage": "",
 | 
			
		||||
  "images.createImage": "",
 | 
			
		||||
@@ -76,6 +133,7 @@
 | 
			
		||||
  "input.temperature": "",
 | 
			
		||||
  "led": "",
 | 
			
		||||
  "led.brightness": "",
 | 
			
		||||
  "led.enable": "",
 | 
			
		||||
  "led.fadeIn": "",
 | 
			
		||||
  "led.fadeIn|param|ms": "",
 | 
			
		||||
  "led.fadeOut": "",
 | 
			
		||||
@@ -133,12 +191,16 @@
 | 
			
		||||
  "pins.analogWritePin": "",
 | 
			
		||||
  "pins.analogWritePin|param|name": "",
 | 
			
		||||
  "pins.analogWritePin|param|value": "",
 | 
			
		||||
  "pins.createBuffer": "",
 | 
			
		||||
  "pins.createBuffer|param|size": "",
 | 
			
		||||
  "pins.digitalReadPin": "",
 | 
			
		||||
  "pins.digitalReadPin|param|name": "",
 | 
			
		||||
  "pins.digitalWritePin": "",
 | 
			
		||||
  "pins.digitalWritePin|param|name": "",
 | 
			
		||||
  "pins.digitalWritePin|param|value": "",
 | 
			
		||||
  "pins.i2cReadNumber": "",
 | 
			
		||||
  "pins.i2cReadBuffer": "",
 | 
			
		||||
  "pins.i2cWriteBuffer": "",
 | 
			
		||||
  "pins.i2cWriteNumber": "",
 | 
			
		||||
  "pins.map": "",
 | 
			
		||||
  "pins.map|param|fromHigh": "",
 | 
			
		||||
@@ -148,6 +210,9 @@
 | 
			
		||||
  "pins.map|param|value": "",
 | 
			
		||||
  "pins.onPulsed": "",
 | 
			
		||||
  "pins.pulseDuration": "",
 | 
			
		||||
  "pins.pulseIn": "",
 | 
			
		||||
  "pins.pulseIn|param|name": "",
 | 
			
		||||
  "pins.pulseIn|param|value": "",
 | 
			
		||||
  "pins.servoSetPulse": "",
 | 
			
		||||
  "pins.servoSetPulse|param|micros": "",
 | 
			
		||||
  "pins.servoSetPulse|param|name": "",
 | 
			
		||||
@@ -160,6 +225,9 @@
 | 
			
		||||
  "pins.spiWrite": "",
 | 
			
		||||
  "pins.spiWrite|param|value": "",
 | 
			
		||||
  "serial": "",
 | 
			
		||||
  "pins.sizeOf": "",
 | 
			
		||||
  "serial.delimiters": "",
 | 
			
		||||
  "serial.onLineReceived": "",
 | 
			
		||||
  "serial.readLine": "",
 | 
			
		||||
  "serial.readUntil": "",
 | 
			
		||||
  "serial.readUntil|param|delimiter": "",
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,17 @@
 | 
			
		||||
{
 | 
			
		||||
  "Math.randomBoolean|block": "choisir au hasard vrai ou faux",
 | 
			
		||||
  "Math|block": "Maths",
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
  "String.fromCharCode|block": "texte du code de charactère %code",
 | 
			
		||||
=======
 | 
			
		||||
  "String.charAt|block": "",
 | 
			
		||||
  "String.compare|block": "",
 | 
			
		||||
  "String.concat|block": "",
 | 
			
		||||
  "String.fromCharCode|block": "texte du code de charactère %code",
 | 
			
		||||
  "String.isEmpty|block": "",
 | 
			
		||||
  "String.length|block": "",
 | 
			
		||||
  "String.substr|block": "",
 | 
			
		||||
>>>>>>> microbit/master
 | 
			
		||||
  "String|block": "Texte",
 | 
			
		||||
  "basic.clearScreen|block": "effacer l’écran",
 | 
			
		||||
  "basic.forever|block": "toujours",
 | 
			
		||||
@@ -10,11 +20,27 @@
 | 
			
		||||
  "basic.showNumber|block": "montrer|nombre %number",
 | 
			
		||||
  "basic.showString|block": "montrer|texte %text",
 | 
			
		||||
  "basic|block": "base",
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
  "control.inBackground|block": "exécuter en arrière-plan",
 | 
			
		||||
=======
 | 
			
		||||
  "control.deviceName|block": "",
 | 
			
		||||
  "control.deviceSerialNumber|block": "",
 | 
			
		||||
  "control.eventSourceId|block": "",
 | 
			
		||||
  "control.eventTimestamp|block": "",
 | 
			
		||||
  "control.eventValueId|block": "",
 | 
			
		||||
  "control.eventValue|block": "",
 | 
			
		||||
  "control.inBackground|block": "exécuter en arrière-plan",
 | 
			
		||||
  "control.onEvent|block": "",
 | 
			
		||||
  "control.raiseEvent|block": "",
 | 
			
		||||
>>>>>>> microbit/master
 | 
			
		||||
  "control.reset|block": "remise à zéro",
 | 
			
		||||
  "control.waitMicros|block": "attendre (µs) %micros",
 | 
			
		||||
  "control|block": "contrôle",
 | 
			
		||||
  "game.addScore|block": "changer le score par|%points",
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
=======
 | 
			
		||||
  "game.createSprite|block": "",
 | 
			
		||||
>>>>>>> microbit/master
 | 
			
		||||
  "game.gameOver|block": "fin du jeu",
 | 
			
		||||
  "game.score|block": "score",
 | 
			
		||||
  "game.startCountdown|block": "commencer compte à rebours|(ms) %duration",
 | 
			
		||||
@@ -59,17 +85,29 @@
 | 
			
		||||
  "pins.analogSetPeriod|block": "",
 | 
			
		||||
  "pins.analogWritePin|block": "",
 | 
			
		||||
  "pins.digitalReadPin|block": "lire en numérique|broche %name",
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
  "pins.digitalWritePin|block": "écrire en numérique|la broche %name|%value",
 | 
			
		||||
=======
 | 
			
		||||
  "pins.digitalWritePin|block": "écrire en numérique|la broche %name|à %value",
 | 
			
		||||
>>>>>>> microbit/master
 | 
			
		||||
  "pins.i2cReadNumber|block": "i2c lire nombre|à l’adresse %address|de format %format=i2c_sizeof",
 | 
			
		||||
  "pins.i2cWriteNumber|block": "i2c écrire nombre|à l’adresse %address|avec value %value|de format %format=i2c_sizeof",
 | 
			
		||||
  "pins.map|block": "",
 | 
			
		||||
  "pins.onPulsed|block": "lorsque|la broche %pin|est pulsée %pulse",
 | 
			
		||||
  "pins.pulseDuration|block": "durée de l’impulsion (µs)",
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
=======
 | 
			
		||||
  "pins.pulseIn|block": "",
 | 
			
		||||
>>>>>>> microbit/master
 | 
			
		||||
  "pins.servoSetPulse|block": "",
 | 
			
		||||
  "pins.servoWritePin|block": "servo écrire|broche %name|à %value",
 | 
			
		||||
  "pins.setPull|block": "",
 | 
			
		||||
  "pins.spiWrite|block": "spi écrire %value",
 | 
			
		||||
  "pins|block": "broches",
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
=======
 | 
			
		||||
  "serial.delimiters|block": "",
 | 
			
		||||
>>>>>>> microbit/master
 | 
			
		||||
  "serial.readLine|block": "série|lire ligne",
 | 
			
		||||
  "serial.readUntil|block": "série|lire jusque %delimiter=serial_delimiter_conv",
 | 
			
		||||
  "serial.redirect|block": "série|rediriger vers|TX %tx|RX %rx|au débit en baudes %rate",
 | 
			
		||||
@@ -87,5 +125,11 @@
 | 
			
		||||
  "{id:category}Math": "Maths",
 | 
			
		||||
  "{id:category}Music": "Musique",
 | 
			
		||||
  "{id:category}Pins": "Broches",
 | 
			
		||||
<<<<<<< HEAD
 | 
			
		||||
  "{id:category}Serial": "Communication Série"
 | 
			
		||||
=======
 | 
			
		||||
  "{id:category}Serial": "Communication Série",
 | 
			
		||||
  "{id:category}String": "Texte",
 | 
			
		||||
  "{id:category}Text": ""
 | 
			
		||||
>>>>>>> microbit/master
 | 
			
		||||
}
 | 
			
		||||
@@ -203,6 +203,19 @@ namespace pxt {
 | 
			
		||||
  void *ptrOfLiteral(int offset);
 | 
			
		||||
  //%
 | 
			
		||||
  int getNumGlobals();
 | 
			
		||||
 | 
			
		||||
  //%
 | 
			
		||||
  uint32_t programSize() {
 | 
			
		||||
    return bytecode[17] * 2;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  //%
 | 
			
		||||
  uint32_t afterProgramPage() {
 | 
			
		||||
    uint32_t ptr = (uint32_t)&bytecode[0];
 | 
			
		||||
    ptr += programSize();
 | 
			
		||||
    ptr = (ptr + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
 | 
			
		||||
    return ptr;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
namespace pxtrt {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										136
									
								
								libs/core/dal.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										136
									
								
								libs/core/dal.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -1,11 +1,11 @@
 | 
			
		||||
// Auto-generated. Do not edit.
 | 
			
		||||
declare const enum DAL {
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//bluetooth/ExternalEvents.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\bluetooth\ExternalEvents.h
 | 
			
		||||
    MICROBIT_ID_BLE = 1000,
 | 
			
		||||
    MICROBIT_ID_BLE_UART = 1200,
 | 
			
		||||
    MICROBIT_BLE_EVT_CONNECTED = 1,
 | 
			
		||||
    MICROBIT_BLE_EVT_DISCONNECTED = 2,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//bluetooth/MESEvents.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\bluetooth\MESEvents.h
 | 
			
		||||
    MES_REMOTE_CONTROL_ID = 1001,
 | 
			
		||||
    MES_REMOTE_CONTROL_EVT_PLAY = 1,
 | 
			
		||||
    MES_REMOTE_CONTROL_EVT_PAUSE = 2,
 | 
			
		||||
@@ -70,8 +70,8 @@ declare const enum DAL {
 | 
			
		||||
    MES_DPAD_BUTTON_4_DOWN = 15,
 | 
			
		||||
    MES_DPAD_BUTTON_4_UP = 16,
 | 
			
		||||
    MES_BROADCAST_GENERAL_ID = 2000,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//bluetooth/MicroBitAccelerometerService.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//bluetooth/MicroBitBLEManager.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\bluetooth\MicroBitAccelerometerService.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\bluetooth\MicroBitBLEManager.h
 | 
			
		||||
    MICROBIT_BLE_PAIR_REQUEST = 0x01,
 | 
			
		||||
    MICROBIT_BLE_PAIR_COMPLETE = 0x02,
 | 
			
		||||
    MICROBIT_BLE_PAIR_PASSCODE = 0x04,
 | 
			
		||||
@@ -85,21 +85,21 @@ declare const enum DAL {
 | 
			
		||||
    MICROBIT_DFU_OPCODE_START_DFU = 1,
 | 
			
		||||
    MICROBIT_DFU_HISTOGRAM_WIDTH = 5,
 | 
			
		||||
    MICROBIT_DFU_HISTOGRAM_HEIGHT = 5,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//bluetooth/MicroBitEventService.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//bluetooth/MicroBitIOPinService.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\bluetooth\MicroBitEventService.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\bluetooth\MicroBitIOPinService.h
 | 
			
		||||
    MICROBIT_IO_PIN_SERVICE_PINCOUNT = 19,
 | 
			
		||||
    MICROBIT_IO_PIN_SERVICE_DATA_SIZE = 10,
 | 
			
		||||
    MICROBIT_PWM_PIN_SERVICE_DATA_SIZE = 2,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//bluetooth/MicroBitLEDService.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\bluetooth\MicroBitLEDService.h
 | 
			
		||||
    MICROBIT_BLE_MAXIMUM_SCROLLTEXT = 20,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//bluetooth/MicroBitMagnetometerService.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//bluetooth/MicroBitTemperatureService.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//bluetooth/MicroBitUARTService.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\bluetooth\MicroBitMagnetometerService.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\bluetooth\MicroBitTemperatureService.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\bluetooth\MicroBitUARTService.h
 | 
			
		||||
    MICROBIT_UART_S_DEFAULT_BUF_SIZE = 20,
 | 
			
		||||
    MICROBIT_UART_S_EVT_DELIM_MATCH = 1,
 | 
			
		||||
    MICROBIT_UART_S_EVT_HEAD_MATCH = 2,
 | 
			
		||||
    MICROBIT_UART_S_EVT_RX_FULL = 3,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//core/ErrorNo.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\core\ErrorNo.h
 | 
			
		||||
    MICROBIT_OK = 0,
 | 
			
		||||
    MICROBIT_INVALID_PARAMETER = -1001,
 | 
			
		||||
    MICROBIT_NOT_SUPPORTED = -1002,
 | 
			
		||||
@@ -114,10 +114,10 @@ declare const enum DAL {
 | 
			
		||||
    MICROBIT_OOM = 20,
 | 
			
		||||
    MICROBIT_HEAP_ERROR = 30,
 | 
			
		||||
    MICROBIT_NULL_DEREFERENCE = 40,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//core/EventModel.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//core/MemberFunctionCallback.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//core/MicroBitCompat.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//core/MicroBitComponent.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\core\EventModel.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\core\MemberFunctionCallback.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\core\MicroBitCompat.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\core\MicroBitComponent.h
 | 
			
		||||
    MICROBIT_ID_BUTTON_A = 1,
 | 
			
		||||
    MICROBIT_ID_BUTTON_B = 2,
 | 
			
		||||
    MICROBIT_ID_BUTTON_RESET = 3,
 | 
			
		||||
@@ -157,25 +157,25 @@ declare const enum DAL {
 | 
			
		||||
    MICROBIT_ID_NOTIFY_ONE = 1022,
 | 
			
		||||
    MICROBIT_ID_NOTIFY = 1023,
 | 
			
		||||
    MICROBIT_COMPONENT_RUNNING = 0x01,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//core/MicroBitDevice.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\core\MicroBitDevice.h
 | 
			
		||||
    MICROBIT_NAME_LENGTH = 5,
 | 
			
		||||
    MICROBIT_NAME_CODE_LETTERS = 5,
 | 
			
		||||
    MICROBIT_PANIC_ERROR_CHARS = 4,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//core/MicroBitFiber.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\core\MicroBitFiber.h
 | 
			
		||||
    MICROBIT_SCHEDULER_RUNNING = 0x01,
 | 
			
		||||
    MICROBIT_FIBER_FLAG_FOB = 0x01,
 | 
			
		||||
    MICROBIT_FIBER_FLAG_PARENT = 0x02,
 | 
			
		||||
    MICROBIT_FIBER_FLAG_CHILD = 0x04,
 | 
			
		||||
    MICROBIT_FIBER_FLAG_DO_NOT_PAGE = 0x08,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//core/MicroBitFont.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\core\MicroBitFont.h
 | 
			
		||||
    MICROBIT_FONT_WIDTH = 5,
 | 
			
		||||
    MICROBIT_FONT_HEIGHT = 5,
 | 
			
		||||
    MICROBIT_FONT_ASCII_START = 32,
 | 
			
		||||
    MICROBIT_FONT_ASCII_END = 126,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//core/MicroBitHeapAllocator.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\core\MicroBitHeapAllocator.h
 | 
			
		||||
    MICROBIT_MAXIMUM_HEAPS = 2,
 | 
			
		||||
    MICROBIT_HEAP_BLOCK_FREE = 0x80000000,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//core/MicroBitListener.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\core\MicroBitListener.h
 | 
			
		||||
    MESSAGE_BUS_LISTENER_PARAMETERISED = 0x0001,
 | 
			
		||||
    MESSAGE_BUS_LISTENER_METHOD = 0x0002,
 | 
			
		||||
    MESSAGE_BUS_LISTENER_BUSY = 0x0004,
 | 
			
		||||
@@ -185,26 +185,11 @@ declare const enum DAL {
 | 
			
		||||
    MESSAGE_BUS_LISTENER_NONBLOCKING = 0x0040,
 | 
			
		||||
    MESSAGE_BUS_LISTENER_URGENT = 0x0080,
 | 
			
		||||
    MESSAGE_BUS_LISTENER_DELETING = 0x8000,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//core/MicroBitSystemTimer.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//core/NotifyEvents.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\core\MicroBitSystemTimer.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\core\NotifyEvents.h
 | 
			
		||||
    MICROBIT_DISPLAY_EVT_FREE = 1,
 | 
			
		||||
    MICROBIT_SERIAL_EVT_TX_EMPTY = 2,
 | 
			
		||||
    MICROBIT_UART_S_EVT_TX_EMPTY = 3,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/CalliopeRGB.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/CalliopeSoundMotor.h
 | 
			
		||||
    CALLIOPE_SM_DEFAULT_DUTY_M = 50,
 | 
			
		||||
    CALLIOPE_SM_DEFAULT_DUTY_S = 100,
 | 
			
		||||
    CALLIOPE_SM_DEFAULT_FREQUENCY_S = 4000,
 | 
			
		||||
    CALLIOPE_SM_DEFAULT_SILENT_MODE = 1,
 | 
			
		||||
    CALLIOPE_SM_PRESCALER_M = 2,
 | 
			
		||||
    CALLIOPE_SM_PRESCALER_S = 0,
 | 
			
		||||
    CALLIOPE_SM_PRESCALER_S_LF = 4,
 | 
			
		||||
    CALLIOPE_SM_PERIOD_M = 100,
 | 
			
		||||
    CALLIOPE_MIN_FREQUENCY_HZ_S_NP = 245,
 | 
			
		||||
    CALLIOPE_MIN_FREQUENCY_HZ_S = 20,
 | 
			
		||||
    CALLIOPE_MAX_FREQUENCY_HZ_S = 20000,
 | 
			
		||||
    CALLIOPE_BOARD_FREQUENCY = 16000000,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/DynamicPwm.h
 | 
			
		||||
    NO_PWMS = 3,
 | 
			
		||||
    MICROBIT_DEFAULT_PWM_PERIOD = 20000,
 | 
			
		||||
    PWM_PERSISTENCE_TRANSIENT = 1,
 | 
			
		||||
@@ -435,8 +420,6 @@ declare const enum DAL {
 | 
			
		||||
    MICROBIT_ACCELEROMETER_SHAKE_DAMPING = 10,
 | 
			
		||||
    MICROBIT_ACCELEROMETER_SHAKE_RTX = 30,
 | 
			
		||||
    MICROBIT_ACCELEROMETER_SHAKE_COUNT_THRESHOLD = 4,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitAccelerometer.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitButton.h
 | 
			
		||||
    MICROBIT_BUTTON_EVT_DOWN = 1,
 | 
			
		||||
    MICROBIT_BUTTON_EVT_UP = 2,
 | 
			
		||||
    MICROBIT_BUTTON_EVT_CLICK = 3,
 | 
			
		||||
@@ -456,7 +439,7 @@ declare const enum DAL {
 | 
			
		||||
    MICROBIT_BUTTON_DOUBLE_CLICK_THRESH = 50,
 | 
			
		||||
    MICROBIT_BUTTON_SIMPLE_EVENTS = 0,
 | 
			
		||||
    MICROBIT_BUTTON_ALL_EVENTS = 1,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitCompass.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitCompass.h
 | 
			
		||||
    MAG3110_DEFAULT_ADDR = 0x1D,
 | 
			
		||||
    MAG_DR_STATUS = 0x00,
 | 
			
		||||
    MAG_OUT_X_MSB = 0x01,
 | 
			
		||||
@@ -487,8 +470,8 @@ declare const enum DAL {
 | 
			
		||||
    MICROBIT_COMPASS_STATUS_CALIBRATING = 4,
 | 
			
		||||
    MICROBIT_COMPASS_STATUS_ADDED_TO_IDLE = 8,
 | 
			
		||||
    MAG3110_WHOAMI_VAL = 0xC4,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitCompassCalibrator.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitDisplay.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitCompassCalibrator.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitDisplay.h
 | 
			
		||||
    MICROBIT_DISPLAY_EVT_ANIMATION_COMPLETE = 1,
 | 
			
		||||
    MICROBIT_DISPLAY_EVT_LIGHT_SENSE = 2,
 | 
			
		||||
    MICROBIT_DISPLAY_DEFAULT_AUTOCLEAR = 1,
 | 
			
		||||
@@ -510,21 +493,45 @@ declare const enum DAL {
 | 
			
		||||
    MICROBIT_DISPLAY_ROTATION_90 = 1,
 | 
			
		||||
    MICROBIT_DISPLAY_ROTATION_180 = 2,
 | 
			
		||||
    MICROBIT_DISPLAY_ROTATION_270 = 3,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitI2C.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitFile.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitFileSystem.h
 | 
			
		||||
    MBFS_FILENAME_LENGTH = 16,
 | 
			
		||||
    MB_READ = 0x01,
 | 
			
		||||
    MB_WRITE = 0x02,
 | 
			
		||||
    MB_CREAT = 0x04,
 | 
			
		||||
    MB_APPEND = 0x08,
 | 
			
		||||
    MB_SEEK_SET = 0x01,
 | 
			
		||||
    MB_SEEK_END = 0x02,
 | 
			
		||||
    MB_SEEK_CUR = 0x04,
 | 
			
		||||
    MBFS_STATUS_INITIALISED = 0x01,
 | 
			
		||||
    MBFS_UNUSED = 0xFFFF,
 | 
			
		||||
    MBFS_EOF = 0xEFFF,
 | 
			
		||||
    MBFS_DELETED = 0x0000,
 | 
			
		||||
    MBFS_DIRECTORY_ENTRY_FREE = 0x8000,
 | 
			
		||||
    MBFS_DIRECTORY_ENTRY_VALID = 0x4000,
 | 
			
		||||
    MBFS_DIRECTORY_ENTRY_DIRECTORY = 0x2000,
 | 
			
		||||
    MBFS_DIRECTORY_ENTRY_NEW = 0xffff,
 | 
			
		||||
    MBFS_DIRECTORY_ENTRY_DELETED = 0x0000,
 | 
			
		||||
    MBFS_BLOCK_TYPE_FILE = 1,
 | 
			
		||||
    MBFS_BLOCK_TYPE_DIRECTORY = 2,
 | 
			
		||||
    MBFS_BLOCK_TYPE_FILETABLE = 3,
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitFlash.h
 | 
			
		||||
    PAGE_SIZE = 1024,
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitI2C.h
 | 
			
		||||
    MICROBIT_I2C_MAX_RETRIES = 9,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitIO.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitLightSensor.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitIO.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitLightSensor.h
 | 
			
		||||
    MICROBIT_LIGHT_SENSOR_CHAN_NUM = 3,
 | 
			
		||||
    MICROBIT_LIGHT_SENSOR_AN_SET_TIME = 4000,
 | 
			
		||||
    MICROBIT_LIGHT_SENSOR_TICK_PERIOD = 5,
 | 
			
		||||
    MICROBIT_LIGHT_SENSOR_MAX_VALUE = 338,
 | 
			
		||||
    MICROBIT_LIGHT_SENSOR_MIN_VALUE = 75,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitMatrixMaps.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitMatrixMaps.h
 | 
			
		||||
    NO_CONN = 0,
 | 
			
		||||
    MICROBIT_DISPLAY_WIDTH = 5,
 | 
			
		||||
    MICROBIT_DISPLAY_HEIGHT = 5,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitMessageBus.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitMultiButton.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitMessageBus.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitMultiButton.h
 | 
			
		||||
    MICROBIT_MULTI_BUTTON_STATE_1 = 0x01,
 | 
			
		||||
    MICROBIT_MULTI_BUTTON_STATE_2 = 0x02,
 | 
			
		||||
    MICROBIT_MULTI_BUTTON_HOLD_TRIGGERED_1 = 0x04,
 | 
			
		||||
@@ -532,7 +539,7 @@ declare const enum DAL {
 | 
			
		||||
    MICROBIT_MULTI_BUTTON_SUPRESSED_1 = 0X10,
 | 
			
		||||
    MICROBIT_MULTI_BUTTON_SUPRESSED_2 = 0x20,
 | 
			
		||||
    MICROBIT_MULTI_BUTTON_ATTACHED = 0x40,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitPin.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitPin.h
 | 
			
		||||
    IO_STATUS_DIGITAL_IN = 0x01,
 | 
			
		||||
    IO_STATUS_DIGITAL_OUT = 0x02,
 | 
			
		||||
    IO_STATUS_ANALOG_IN = 0x04,
 | 
			
		||||
@@ -556,7 +563,6 @@ declare const enum DAL {
 | 
			
		||||
    PIN_CAPABILITY_DIGITAL = 0x01,
 | 
			
		||||
    PIN_CAPABILITY_ANALOG = 0x02,
 | 
			
		||||
    PIN_CAPABILITY_TOUCH = 0x04,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitRadio.h
 | 
			
		||||
    MICROBIT_RADIO_STATUS_INITIALISED = 0x0001,
 | 
			
		||||
    MICROBIT_RADIO_BASE_ADDRESS = 0x75626974,
 | 
			
		||||
    MICROBIT_RADIO_DEFAULT_GROUP = 0,
 | 
			
		||||
@@ -568,9 +574,9 @@ declare const enum DAL {
 | 
			
		||||
    MICROBIT_RADIO_PROTOCOL_DATAGRAM = 1,
 | 
			
		||||
    MICROBIT_RADIO_PROTOCOL_EVENTBUS = 2,
 | 
			
		||||
    MICROBIT_RADIO_EVT_DATAGRAM = 1,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitRadioDatagram.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitRadioEvent.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitSerial.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitRadioDatagram.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitRadioEvent.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitSerial.h
 | 
			
		||||
    MICROBIT_SERIAL_DEFAULT_BAUD_RATE = 115200,
 | 
			
		||||
    MICROBIT_SERIAL_DEFAULT_BUFFER_SIZE = 20,
 | 
			
		||||
    MICROBIT_SERIAL_EVT_DELIM_MATCH = 1,
 | 
			
		||||
@@ -583,31 +589,31 @@ declare const enum DAL {
 | 
			
		||||
    ASYNC = 0,
 | 
			
		||||
    SYNC_SPINWAIT = 1,
 | 
			
		||||
    SYNC_SLEEP = 2,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitStorage.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitStorage.h
 | 
			
		||||
    MICROBIT_STORAGE_MAGIC = 0xCAFE,
 | 
			
		||||
    MICROBIT_STORAGE_BLOCK_SIZE = 48,
 | 
			
		||||
    MICROBIT_STORAGE_KEY_SIZE = 16,
 | 
			
		||||
    MICROBIT_STORAGE_STORE_PAGE_OFFSET = 17,
 | 
			
		||||
    MICROBIT_STORAGE_SCRATCH_PAGE_OFFSET = 19,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/MicroBitThermometer.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\MicroBitThermometer.h
 | 
			
		||||
    MICROBIT_THERMOMETER_PERIOD = 1000,
 | 
			
		||||
    MICROBIT_THERMOMETER_EVT_UPDATE = 1,
 | 
			
		||||
    MICROBIT_THERMOMETER_ADDED_TO_IDLE = 2,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//drivers/TimedInterruptIn.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//platform/yotta_cfg_mappings.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//types/ManagedString.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//types/ManagedType.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//types/Matrix4.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//types/MicroBitCoordinateSystem.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\drivers\TimedInterruptIn.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\platform\yotta_cfg_mappings.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\types\ManagedString.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\types\ManagedType.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\types\Matrix4.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\types\MicroBitCoordinateSystem.h
 | 
			
		||||
    RAW = 0,
 | 
			
		||||
    SIMPLE_CARTESIAN = 1,
 | 
			
		||||
    NORTH_EAST_DOWN = 2,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//types/MicroBitEvent.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\types\MicroBitEvent.h
 | 
			
		||||
    MICROBIT_ID_ANY = 0,
 | 
			
		||||
    MICROBIT_EVT_ANY = 0,
 | 
			
		||||
    CREATE_ONLY = 0,
 | 
			
		||||
    CREATE_AND_FIRE = 1,
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//types/MicroBitImage.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//types/PacketBuffer.h
 | 
			
		||||
    // built/yt/yotta_modules/microbit-dal/inc//types/RefCounted.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\types\MicroBitImage.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\types\PacketBuffer.h
 | 
			
		||||
    // built\yt\yotta_modules\microbit-dal\inc\types\RefCounted.h
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -6,3 +6,7 @@ MicroBitPin *getPin(int id);
 | 
			
		||||
typedef ImageData* Image;
 | 
			
		||||
typedef BufferData* Buffer;
 | 
			
		||||
 | 
			
		||||
namespace pxt {
 | 
			
		||||
  uint32_t programSize();
 | 
			
		||||
  uint32_t afterProgramPage();    
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,51 +0,0 @@
 | 
			
		||||
namespace messages {
 | 
			
		||||
    var streamid: string;
 | 
			
		||||
        
 | 
			
		||||
    export function setStreamId(id: string) {
 | 
			
		||||
        streamid = id;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * Creates a new message that includes the board serial number and the stream id if any
 | 
			
		||||
     */
 | 
			
		||||
    export function createMessage() : Message {
 | 
			
		||||
        let m = new Message();
 | 
			
		||||
        m.addNumber('board', control.deviceSerialNumber());
 | 
			
		||||
        if (streamid != null && streamid.length > 0)
 | 
			
		||||
            m.addString('stream', streamid);
 | 
			
		||||
        return m;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    /**
 | 
			
		||||
     * A message containig custom data
 | 
			
		||||
     */
 | 
			
		||||
    export class Message {
 | 
			
		||||
        private buffer:string = '';
 | 
			
		||||
        
 | 
			
		||||
        /**
 | 
			
		||||
         * Adds a string field to the message
 | 
			
		||||
         */
 | 
			
		||||
        //%
 | 
			
		||||
        public addString(name:string, value:string) {
 | 
			
		||||
            if (this.buffer.length > 0) this.buffer += ',';
 | 
			
		||||
            this.buffer += name + ':"' + value + '"';
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        /**
 | 
			
		||||
         * Adds a number field to the message
 | 
			
		||||
         */
 | 
			
		||||
        //%
 | 
			
		||||
        public addNumber(name:string, value: number) {
 | 
			
		||||
            if (this.buffer.length > 0) this.buffer += ',';
 | 
			
		||||
            this.buffer += name + ':' + value;            
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        /**
 | 
			
		||||
         * Converts the message to a JSON payload
 | 
			
		||||
         */
 | 
			
		||||
        //%
 | 
			
		||||
        public toJSON() : string {
 | 
			
		||||
            return '{' + this.buffer + '}';
 | 
			
		||||
        }        
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user