From 633522c80007c2cf1900b09d4816c1054d2a1f67 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Mon, 7 Nov 2016 13:31:24 -0800 Subject: [PATCH] removing dangling file --- libs/core/messages.ts | 51 ------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 libs/core/messages.ts diff --git a/libs/core/messages.ts b/libs/core/messages.ts deleted file mode 100644 index 6d674823..00000000 --- a/libs/core/messages.ts +++ /dev/null @@ -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 + '}'; - } - } -} \ No newline at end of file