<commit_before>var assert = require('chai').assert;
var util = require('util');

describe('Hello', function() {
    
    it('Reflecta', function(done) {
        
      var Reflecta = require('../reflecta.js');
      var reflecta = new Reflecta("COM10", function(err) {
        if (err) {
          reflecta.close(function() { done(err); });
          return;
        }

        reflecta.on('response', function(response) {
          // console.log(response.sequence + " : " + response.message);
          reflecta.close(done);
        });
        
        reflecta.sendFrame([1]);
      });
      
      reflecta.on('error', function(err) { console.log(err); });
      reflecta.on('portError', function(err) { console.log(err); });

      reflecta.on('message', function(message) { console.log(message); });
      reflecta.on('frame', function(frame) { console.log(frame.sequence + " : " + frame.data); });
      reflecta.on('portClose', function() { console.log('portClose'); });
      reflecta.on('portEnd', function() { console.log('portEnd'); });
      reflecta.on('portOpen', function() { console.log('portOpen'); });
    });
    
    it('Blinky', function(done) {

        var Reflecta = require('../reflecta.js');
        var reflecta = new Reflecta("COM10", function(err) {
          if (err) {
            reflecta.close(function() { done(err); });
            return;
          }

          reflecta.on('error', function(err) { console.log(err); });
          reflecta.on('portError', function(err) { console.log(err); });
          
          setInterval(function() { reflecta.ardu1.gpio.digitalWrite(11, 1); }, 199);
          setInterval(function() { reflecta.ardu1.gpio.digitalWrite(11, 0); }, 400);
          
          setTimeout(function() { reflecta.close(done); }, 1700);
        });
    });
    
    // Meant to be run when Reflecta has the ReflectaHeartbeat turned on and running
    it('Heartbeat', function(done) {

      var Reflecta = require('../reflecta.js');
      var reflecta = new Reflecta("COM10", function(err) {
        if (err) {
          reflecta.close(function() { done(err); });
          return;
        }

        reflecta.on('error', function(err, frame, checksum) { console.log(err + ' - ' + util.inspect(frame) + ' - ' + checksum); });
        reflecta.on('portError', function(err) { console.log(err); });
        
        reflecta.on('message', function(message) { console.log(message); });
        reflecta.on('frame', function(frame) { console.log(frame.sequence + " : " + frame.data + ' : ' + util.inspect(frame.frame)); });
        
        setTimeout(function() { reflecta.close(done); }, 1700);
      });
  });

});<commit_msg>Add placeholder test for IMU Heartbeat<commit_after>var assert = require('chai').assert;
var util = require('util');

describe('Hello', function() {
    
    it('Reflecta', function(done) {
        
      var Reflecta = require('../reflecta.js');
      var reflecta = new Reflecta("COM10", function(err) {
        if (err) {
          reflecta.close(function() { done(err); });
          return;
        }

        reflecta.on('response', function(response) {
          // console.log(response.sequence + " : " + response.message);
          reflecta.close(done);
        });
        
        reflecta.sendFrame([1]);
      });
      
      reflecta.on('error', function(err) { console.log(err); });
      reflecta.on('portError', function(err) { console.log(err); });

      reflecta.on('message', function(message) { console.log(message); });
      reflecta.on('frame', function(frame) { console.log(frame.sequence + " : " + frame.data); });
      reflecta.on('portClose', function() { console.log('portClose'); });
      reflecta.on('portEnd', function() { console.log('portEnd'); });
      reflecta.on('portOpen', function() { console.log('portOpen'); });
    });
    
    it('Blinky', function(done) {

        var Reflecta = require('../reflecta.js');
        var reflecta = new Reflecta("COM10", function(err) {
          if (err) {
            reflecta.close(function() { done(err); });
            return;
          }

          reflecta.on('error', function(err) { console.log(err); });
          reflecta.on('portError', function(err) { console.log(err); });
          
          setInterval(function() { reflecta.ardu1.gpio.digitalWrite(11, 1); }, 199);
          setInterval(function() { reflecta.ardu1.gpio.digitalWrite(11, 0); }, 400);
          
          setTimeout(function() { reflecta.close(done); }, 1700);
        });
    });
    
    // Meant to be run when Reflecta has the ReflectaHeartbeat turned on and running
    it('BasicHeartbeat', function(done) {

      var Reflecta = require('../reflecta.js');
      var reflecta = new Reflecta("COM10", function(err) {
        if (err) {
          reflecta.close(function() { done(err); });
          return;
        }

        reflecta.on('error', function(err, frame, checksum) { console.log(err + ' - ' + util.inspect(frame) + ' - ' + checksum); });
        reflecta.on('portError', function(err) { console.log(err); });
        
        reflecta.on('message', function(message) { console.log(message); });
        reflecta.on('frame', function(frame) { console.log(frame.sequence + " : " + frame.data + ' : ' + util.inspect(frame.frame)); });
        
        setTimeout(function() { reflecta.close(done); }, 1700);
      });
    });

    // Meant to be run as the client for BasicIMU
    it('HeartbeatIMU', function(done) {

      var Reflecta = require('../reflecta.js');
      var reflecta = new Reflecta("COM10", function(err) {
        if (err) {
          reflecta.close(function() { done(err); });
          return;
        }

        reflecta.on('error', function(err, frame, checksum) { console.log(err + ' - ' + util.inspect(frame) + ' - ' + checksum); });
        reflecta.on('portError', function(err) { console.log(err); });
        
        reflecta.on('message', function(message) { console.log(message); });
        reflecta.on('heartbeat', function(heartbeat) { console.log(heartbeat.freeCycles + " : " + util.inspect(heartbeat.data)); });
        
        setTimeout(function() { reflecta.close(done); }, 1700);
      });
    });
});
{'fraction_non_alphanumeric': 0.18345961631468644, 'fraction_numerical': 0.01031758826374335, 'mean_word_length': 2.5011286681715577, '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': '1649202', 'n_tokens_mistral': 1935, 'n_tokens_neox': 1870, 'n_words': 313}