<commit_before>function WSClient(url, debug) {
    var self = this;
    this.debug = Boolean(debug);
    this.ws = new WebSocket(url);
    this.ws.onopen = function() {
        self.ws_onopen();
    };
    this.ws.onclose = function() {
        self.ws_onclose();
    };
    this.ws.onmessage = function(msg) {
        self.ws_onmessage(msg);
    };
    this.ws.onerror = function(error) {
        self.ws_onerror(error);
    };

    // callback for errors
    this.onerror = undefined;

    this.datamsgcount_ack = 0;

    this.clientcmds = {
        'CONNECT_MSP430':'msp430_connect',
        'ACK_DATA':'ack_data',
        'WRITE_DATA':'writedata'
    };
    this.servercmds = {
        'MSP430_STATE_CHANGE':'msp430_schange',
        'WRITE_DATA':'writedata'
    };
}

WSClient.prototype.ws_onmessage = function(msg) {
    var parsedMsg = jQuery.parseJSON(msg.data);

    if (this.debug)
        console.log(parsedMsg);

    switch (parsedMsg.cmd) {
        case this.servercmds.MSP430_STATE_CHANGE:
            // for now i don't care, just refresh menu
            switch(parsedMsg.msp430_state)
            {
                case 'drop_stream':
                    // When any MSP430 drops from its streaming state
                    // This occurs when a MSP430 gets reconfigured (admin change)
                    if (this.e_msp430_drop_stream) this.e_msp430_drop_stream(parsedMsg.msp430_mac);
                    break;
                case 'stream':
                    // When any MSP430 begins streaming
                    if (this.e_msp430_stream) this.e_msp430_stream(parsedMsg.msp430_mac);
                    break;<commit_msg>Aligned cmd names for "ACK_DATA"<commit_after>function WSClient(url, debug) {
    var self = this;
    this.debug = Boolean(debug);
    this.ws = new WebSocket(url);
    this.ws.onopen = function() {
        self.ws_onopen();
    };
    this.ws.onclose = function() {
        self.ws_onclose();
    };
    this.ws.onmessage = function(msg) {
        self.ws_onmessage(msg);
    };
    this.ws.onerror = function(error) {
        self.ws_onerror(error);
    };

    // callback for errors
    this.onerror = undefined;

    this.datamsgcount_ack = 0;

    this.clientcmds = {
        'CONNECT_MSP430':'msp430_connect',
        'ACK_DATA':'ackdata',
        'WRITE_DATA':'writedata'
    };

    this.servercmds = {
        'MSP430_STATE_CHANGE':'msp430_schange',
        'WRITE_DATA':'writedata'
    };
}

WSClient.prototype.ws_onmessage = function(msg) {
    var parsedMsg = jQuery.parseJSON(msg.data);

    if (this.debug)
        console.log(parsedMsg);

    switch (parsedMsg.cmd) {
        case this.servercmds.MSP430_STATE_CHANGE:
            // for now i don't care, just refresh menu
            switch(parsedMsg.msp430_state)
            {
                case 'drop_stream':
                    // When any MSP430 drops from its streaming state
                    // This occurs when a MSP430 gets reconfigured (admin change)
                    if (this.e_msp430_drop_stream) this.e_msp430_drop_stream(parsedMsg.msp430_mac);
                    break;
                case 'stream':
                    // When any MSP430 begins streaming
                    if (this.e_msp430_stream) this.e_msp430_stream(parsedMsg.msp430_mac);
                    break;
{'fraction_non_alphanumeric': 0.1093325279371791, 'fraction_numerical': 0.02778616732105104, 'mean_word_length': 1.962432915921288, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5928095', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1039, 'n_words': 187}