In [1]:
import datetime, math, time

In [2]:
def exec_ipynb(url):
    import json, re, urllib2
    nb = (urllib2.urlopen(url) if re.match(r'https?:', url) else open(url)).read()
    exec '\n'.join([''.join(cell['input']) for cell in json.loads(nb)['worksheets'][0]['cells'] if cell['cell_type'] == 'code']) in globals()

exec_ipynb('Fluxtream-Library.ipynb')
fluxtream_login()


Out[2]:
Fluxtream username:
Fluxtream password:

Pull data from Hexoskin API


In [3]:
def hexoskin_authenticate(username, password):
    global hexoskin_username, hexoskin_password
    hexoskin_username = username
    hexoskin_password = password
    # TODO: catch exception here and complain about auth
    hexoskin_get_datatype()
    return True

def hexoskin_headers():
    auth = base64.encodestring('%s:%s' % (hexoskin_username, hexoskin_password)).replace('\n', '')
    return {'Authorization': 'Basic ' + auth}

def hexoskin_get_datatype():
    req = urllib2.Request('https://api.hexoskin.com/api/v1/datatype/?limit=1000', headers = hexoskin_headers())
    return json.loads(urllib2.urlopen(req).read())

In [4]:
%%HTML
Hexoskin email: <input id="hexoskin_username" type="text"></input><br>
Hexoskin password: <input id="hexoskin_password" type="password"></input><br>
<button id = "hexoskin_authenticate">Authenticate</button> <span id="hexoskin_auth_result"></span>
<script>

// Send username and password to python
function hexoskin_authenticate(username, password, callback) {
  cmd =  'hexoskin_authenticate(' + JSON.stringify(username) + ',' +
         JSON.stringify(password) + ')'
  console.log(cmd);
  function cb(msg) {
    console.log(msg);
    console.log(msg.content.data['text/plain'] == 'True');
    callback(msg.content.data['text/plain'] == 'True')
  }
  IPython.notebook.kernel.execute(cmd, 
                                  {iopub: {output: cb}}, {silent: false});
}

$('#hexoskin_authenticate').click(function() {
    $('#hexoskin_auth_result').text('...');
    hexoskin_authenticate($('#hexoskin_username').val(),
                           $('#hexoskin_password').val(),
                           function(success) {
                             $('#hexoskin_auth_result').text(success ? 'Success' : 'Failed');
                           });
});
</script>


Hexoskin email:
Hexoskin password:

In [6]:
def sync_hexoskin_to_fluxtream(source, device, dest, sources_list):
    info = fluxtream_get_channel_info(device, dest, sources_list)
    if info == None:
        start = 1
    else:
        start = info['max_time']

    end = time.time()

    params = {
        'datatype': source,
        'user': hexoskin_username,
        'start': int(start * 256),
        'end': int(math.ceil(end * 256))
    }
    url = 'https://api.hexoskin.com/api/v1/data/?' + urllib.urlencode(params)
    req = urllib2.Request(url, headers = hexoskin_headers())
    data = json.loads(urllib2.urlopen(req).read())
    if len(data) != 1:
        raise Exception('unexpected format')

    samples = data[0]['data'][str(source)]

    print '%s: read %d samples since time %s' % (dest, len(samples), datetime.datetime.fromtimestamp(start).strftime('%Y-%m-%d %H:%M:%S'))
    for sample in samples:
        sample[0] /= 256.0
    
    fluxtream_upload(device, [dest], samples)

device = 'Hexoskin'

hexoskin_to_fluxtream = {
    '18': 'BeatSpacing',
    '19': 'HeartRate',
    '37': 'TidalVolume',
    '4129': 'RespChest',
    '4130': 'RespAbdomen',
    '4145': 'AccelX',
    '4146': 'AccelY',
    '4147': 'AccelZ'
}

sources_list = fluxtream_get_sources_list(fluxtream_guest_id)

for source in sorted(hexoskin_to_fluxtream.keys()):
    sync_hexoskin_to_fluxtream(source, device, hexoskin_to_fluxtream[source], sources_list)
    
print 'Done'


BeatSpacing: read 81624 samples since time 2015-02-10 10:35:32
Uploading 81624 data points to test's account on server fluxtream.org, device Hexoskin, channels ['BeatSpacing']
HeartRate: read 65132 samples since time 2015-02-10 10:35:35
Uploading 65132 data points to test's account on server fluxtream.org, device Hexoskin, channels ['HeartRate']
TidalVolume: read 65132 samples since time 2015-02-10 10:35:35
Uploading 65132 data points to test's account on server fluxtream.org, device Hexoskin, channels ['TidalVolume']
RespChest: read 267744 samples since time 2015-02-10 10:35:35
Uploading 267744 data points to test's account on server fluxtream.org, device Hexoskin, channels ['RespChest']
RespAbdomen: read 267744 samples since time 2015-02-10 10:35:35
Uploading 267744 data points to test's account on server fluxtream.org, device Hexoskin, channels ['RespAbdomen']
AccelX: read 255028 samples since time 2015-02-10 10:35:35
Uploading 255028 data points to test's account on server fluxtream.org, device Hexoskin, channels ['AccelX']
AccelY: read 255028 samples since time 2015-02-10 10:35:35
Uploading 255028 data points to test's account on server fluxtream.org, device Hexoskin, channels ['AccelY']
AccelZ: read 255028 samples since time 2015-02-10 10:35:35
Uploading 255028 data points to test's account on server fluxtream.org, device Hexoskin, channels ['AccelZ']
Done

In [19]:
print json.dumps(hexoskin_get_datatype(), sort_keys=True, indent=4)


{
    "meta": {
        "limit": 1000, 
        "next": null, 
        "offset": 0, 
        "previous": null, 
        "total_count": 95
    }, 
    "objects": [
        {
            "dataid": 208, 
            "hexo_freq": null, 
            "info": "Recorder start annotation.", 
            "name": "RECSTR_ANNOT_CHAR", 
            "resource_uri": "/api/v1/datatype/208/"
        }, 
        {
            "dataid": 16, 
            "hexo_freq": 1, 
            "info": "1 to 3 leads ECG channel(s).", 
            "name": "ECG_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/16/"
        }, 
        {
            "dataid": 17, 
            "hexo_freq": null, 
            "info": "QRS channel, ECG ventricular contraction (heart be... deprecated", 
            "name": "QRS", 
            "resource_uri": "/api/v1/datatype/17/"
        }, 
        {
            "dataid": 18, 
            "hexo_freq": null, 
            "info": "RR interval channel, time between to heart beat detections, calc", 
            "name": "RR_interval", 
            "resource_uri": "/api/v1/datatype/18/"
        }, 
        {
            "dataid": 19, 
            "hexo_freq": 256, 
            "info": "Heart Rate (HR) channel.", 
            "name": "heart_rate", 
            "resource_uri": "/api/v1/datatype/19/"
        }, 
        {
            "dataid": 20, 
            "hexo_freq": null, 
            "info": "Heart Rate Variability (HRV) channel. DEPRECATED", 
            "name": "HRV_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/20/"
        }, 
        {
            "dataid": 21, 
            "hexo_freq": null, 
            "info": "Heart Rate Recovery (HRR) channel.DEPRECATED", 
            "name": "HRR_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/21/"
        }, 
        {
            "dataid": 22, 
            "hexo_freq": null, 
            "info": "The QRS with Amplitude Channel code (replaces QRS_CHANNEL_CHAR).", 
            "name": "QRS_AMP_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/22/"
        }, 
        {
            "dataid": 32, 
            "hexo_freq": 2, 
            "info": "1 or 2 RIP sensor respiration channel(s).", 
            "name": "RESP_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/32/"
        }, 
        {
            "dataid": 33, 
            "hexo_freq": 256, 
            "info": "(Respiration Rate) or breathing rate channel (R for Respirati", 
            "name": "breathing_rate", 
            "resource_uri": "/api/v1/datatype/33/"
        }, 
        {
            "dataid": 34, 
            "hexo_freq": null, 
            "info": "Inspiration channels, detection of an inspiration start event", 
            "name": "inspiration", 
            "resource_uri": "/api/v1/datatype/34/"
        }, 
        {
            "dataid": 35, 
            "hexo_freq": null, 
            "info": "Expiration channel, detection of an expiration start event.", 
            "name": "expiration", 
            "resource_uri": "/api/v1/datatype/35/"
        }, 
        {
            "dataid": 36, 
            "hexo_freq": 256, 
            "info": "Minute Ventilation (MV) channel.", 
            "name": "minute_ventilation", 
            "resource_uri": "/api/v1/datatype/36/"
        }, 
        {
            "dataid": 37, 
            "hexo_freq": 256, 
            "info": "Volume Tidal (VT) channel.", 
            "name": "tidal_volume", 
            "resource_uri": "/api/v1/datatype/37/"
        }, 
        {
            "dataid": 48, 
            "hexo_freq": 4, 
            "info": "3-axis accelerometer channels.", 
            "name": "ACC_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/48/"
        }, 
        {
            "dataid": 49, 
            "hexo_freq": 256, 
            "info": "Activity 1s Channel code.", 
            "name": "activity", 
            "resource_uri": "/api/v1/datatype/49/"
        }, 
        {
            "dataid": 1000, 
            "hexo_freq": 256, 
            "info": "The heartrate data quality channel code.", 
            "name": "heart_rate_quality", 
            "resource_uri": "/api/v1/datatype/1000/"
        }, 
        {
            "dataid": 1001, 
            "hexo_freq": 256, 
            "info": "The breathing rate quality channel code.", 
            "name": "breathing_rate_quality", 
            "resource_uri": "/api/v1/datatype/1001/"
        }, 
        {
            "dataid": 1002, 
            "hexo_freq": 256, 
            "info": "The SPO2 quality channel code.", 
            "name": "SPO2_quality", 
            "resource_uri": "/api/v1/datatype/1002/"
        }, 
        {
            "dataid": 1003, 
            "hexo_freq": 256, 
            "info": "The temperature quality channel code.", 
            "name": "temperature_quality", 
            "resource_uri": "/api/v1/datatype/1003/"
        }, 
        {
            "dataid": 1004, 
            "hexo_freq": null, 
            "info": "The RR quality channel code. Async", 
            "name": "RR_interval_quality", 
            "resource_uri": "/api/v1/datatype/1004/"
        }, 
        {
            "dataid": 1019, 
            "hexo_freq": 256, 
            "info": "Energy based on HR DEPRECATED", 
            "name": "ENERGY_ECG", 
            "resource_uri": "/api/v1/datatype/1019/"
        }, 
        {
            "dataid": 1049, 
            "hexo_freq": 256, 
            "info": "Energy based on acc1s DEPRECATED", 
            "name": "ENERGY_ACTIVITY", 
            "resource_uri": "/api/v1/datatype/1049/"
        }, 
        {
            "dataid": 1053, 
            "hexo_freq": 256, 
            "info": "Energy based on cadence DEPRECATED", 
            "name": "ENERGY_CADENCE", 
            "resource_uri": "/api/v1/datatype/1053/"
        }, 
        {
            "dataid": 1200, 
            "hexo_freq": null, 
            "info": "Minimum Heart Rate statistic on a period DEPRECATED", 
            "name": "HR_CHANNEL_CHAR_MIN", 
            "resource_uri": "/api/v1/datatype/1200/"
        }, 
        {
            "dataid": 1201, 
            "hexo_freq": null, 
            "info": "Maximum Heart Rate statistic on a period DEPRECATED", 
            "name": "HR_CHANNEL_CHAR_MAX", 
            "resource_uri": "/api/v1/datatype/1201/"
        }, 
        {
            "dataid": 1202, 
            "hexo_freq": null, 
            "info": "Average Heart Rate statistic on a period DEPRECATED", 
            "name": "HR_CHANNEL_CHAR_AVG", 
            "resource_uri": "/api/v1/datatype/1202/"
        }, 
        {
            "dataid": 1300, 
            "hexo_freq": null, 
            "info": "Calories burned related to activity DEPRECATED", 
            "name": "ACT_CALORIES_CHAR", 
            "resource_uri": "/api/v1/datatype/1300/"
        }, 
        {
            "dataid": 50, 
            "hexo_freq": 230400, 
            "info": "Activity 15s Channel code.DEPRECATED", 
            "name": "ACT15S_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/50/"
        }, 
        {
            "dataid": 51, 
            "hexo_freq": 76800, 
            "info": "Activity 5m Channel code. DEPRECATED", 
            "name": "ACT5M_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/51/"
        }, 
        {
            "dataid": 52, 
            "hexo_freq": null, 
            "info": "Step channel, event detection, also returns the number of steps ", 
            "name": "step", 
            "resource_uri": "/api/v1/datatype/52/"
        }, 
        {
            "dataid": 53, 
            "hexo_freq": 64, 
            "info": "Cadence channel (cadence = step/min) Channel character code.", 
            "name": "cadence", 
            "resource_uri": "/api/v1/datatype/53/"
        }, 
        {
            "dataid": 64, 
            "hexo_freq": 4, 
            "info": "Photo Plethysmography (PPG) channel.", 
            "name": "PPG", 
            "resource_uri": "/api/v1/datatype/64/"
        }, 
        {
            "dataid": 65, 
            "hexo_freq": 256, 
            "info": "Pulse oximetry derivated HR channel.", 
            "name": "P_HR_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/65/"
        }, 
        {
            "dataid": 66, 
            "hexo_freq": 256, 
            "info": "SPO2 channel, Oxygen saturation.", 
            "name": "SPO2", 
            "resource_uri": "/api/v1/datatype/66/"
        }, 
        {
            "dataid": 80, 
            "hexo_freq": 256, 
            "info": "Temperature channel, thermistor sensor raw value.", 
            "name": "temperature", 
            "resource_uri": "/api/v1/datatype/80/"
        }, 
        {
            "dataid": 81, 
            "hexo_freq": 256, 
            "info": "Temperature channel in Celsius.", 
            "name": "temperature_celcius", 
            "resource_uri": "/api/v1/datatype/81/"
        }, 
        {
            "dataid": 97, 
            "hexo_freq": null, 
            "info": "Pulse Transit Time.", 
            "name": "PTT", 
            "resource_uri": "/api/v1/datatype/97/"
        }, 
        {
            "dataid": 98, 
            "hexo_freq": 256, 
            "info": "Blood Pressure.", 
            "name": "systolic_pressure", 
            "resource_uri": "/api/v1/datatype/98/"
        }, 
        {
            "dataid": 209, 
            "hexo_freq": null, 
            "info": "Recorder stop annotation. INTERNAL USE", 
            "name": "RECSTP_ANNOT_CHAR", 
            "resource_uri": "/api/v1/datatype/209/"
        }, 
        {
            "dataid": 4096, 
            "hexo_freq": null, 
            "info": "Manual start annotation.", 
            "name": "ANNOT_TYPE_START", 
            "resource_uri": "/api/v1/datatype/4096/"
        }, 
        {
            "dataid": 4097, 
            "hexo_freq": null, 
            "info": "Manual stop annotation.", 
            "name": "ANNOT_TYPE_STOP", 
            "resource_uri": "/api/v1/datatype/4097/"
        }, 
        {
            "dataid": 4098, 
            "hexo_freq": null, 
            "info": "Manual Comment annotation.", 
            "name": "ANNOT_TYPE_COMMENT", 
            "resource_uri": "/api/v1/datatype/4098/"
        }, 
        {
            "dataid": 4113, 
            "hexo_freq": 1, 
            "info": "A channel char for the ECG Channel I data", 
            "name": "ECG_I", 
            "resource_uri": "/api/v1/datatype/4113/"
        }, 
        {
            "dataid": 4114, 
            "hexo_freq": 1, 
            "info": "A channel char for the ECG Channel II data", 
            "name": "ECG_II", 
            "resource_uri": "/api/v1/datatype/4114/"
        }, 
        {
            "dataid": 4115, 
            "hexo_freq": 1, 
            "info": "A channel char for the ECG Channel III data", 
            "name": "ECG_III", 
            "resource_uri": "/api/v1/datatype/4115/"
        }, 
        {
            "dataid": 4129, 
            "hexo_freq": 2, 
            "info": "A channel char for the thoracic belt data.", 
            "name": "respiration_thoracic", 
            "resource_uri": "/api/v1/datatype/4129/"
        }, 
        {
            "dataid": 4130, 
            "hexo_freq": 2, 
            "info": "A channel char for the abdominal belt data.", 
            "name": "respiration_abdominal", 
            "resource_uri": "/api/v1/datatype/4130/"
        }, 
        {
            "dataid": 4145, 
            "hexo_freq": 4, 
            "info": "A channel char for the x axis accelerometer data.", 
            "name": "acceleration_X", 
            "resource_uri": "/api/v1/datatype/4145/"
        }, 
        {
            "dataid": 4146, 
            "hexo_freq": 4, 
            "info": "A channel char for the y axis accelerometer data.", 
            "name": "acceleration_Y", 
            "resource_uri": "/api/v1/datatype/4146/"
        }, 
        {
            "dataid": 4147, 
            "hexo_freq": 4, 
            "info": "A channel char for the z axis accelerometer data.", 
            "name": "acceleration_Z", 
            "resource_uri": "/api/v1/datatype/4147/"
        }, 
        {
            "dataid": 8192, 
            "hexo_freq": null, 
            "info": "Latitude", 
            "name": "GPS_latitude", 
            "resource_uri": "/api/v1/datatype/8192/"
        }, 
        {
            "dataid": 8193, 
            "hexo_freq": null, 
            "info": "Longitude", 
            "name": "GPS_longitude", 
            "resource_uri": "/api/v1/datatype/8193/"
        }, 
        {
            "dataid": 8194, 
            "hexo_freq": null, 
            "info": "Altitude", 
            "name": "GPS_altitude", 
            "resource_uri": "/api/v1/datatype/8194/"
        }, 
        {
            "dataid": 10000, 
            "hexo_freq": null, 
            "info": "User weight in kg", 
            "name": "USER_WEIGHT", 
            "resource_uri": "/api/v1/datatype/10000/"
        }, 
        {
            "dataid": 10001, 
            "hexo_freq": null, 
            "info": "User height in m", 
            "name": "USER_HEIGHT", 
            "resource_uri": "/api/v1/datatype/10001/"
        }, 
        {
            "dataid": 10002, 
            "hexo_freq": null, 
            "info": "VO2Max, reference", 
            "name": "AGGREGATE_VO2MAX", 
            "resource_uri": "/api/v1/datatype/10002/"
        }, 
        {
            "dataid": 10003, 
            "hexo_freq": null, 
            "info": "HRmin_basal, reference", 
            "name": "AGGREGATE_HRMIN", 
            "resource_uri": "/api/v1/datatype/10003/"
        }, 
        {
            "dataid": 10004, 
            "hexo_freq": null, 
            "info": "HRmax, reference", 
            "name": "AGGREGATE_HRMAX", 
            "resource_uri": "/api/v1/datatype/10004/"
        }, 
        {
            "dataid": 10005, 
            "hexo_freq": null, 
            "info": "fitness Percentile", 
            "name": "USER_FITNESS_PCT", 
            "resource_uri": "/api/v1/datatype/10005/"
        }, 
        {
            "dataid": 10006, 
            "hexo_freq": null, 
            "info": "Heart rate recovery, reference", 
            "name": "AGGREGATE_HRR", 
            "resource_uri": "/api/v1/datatype/10006/"
        }, 
        {
            "dataid": 10102, 
            "hexo_freq": null, 
            "info": "VO2Max_manual", 
            "name": "USER_VO2MAX_MANUAL", 
            "resource_uri": "/api/v1/datatype/10102/"
        }, 
        {
            "dataid": 10103, 
            "hexo_freq": null, 
            "info": "HRMin_manual", 
            "name": "USER_HRMIN_MANUAL", 
            "resource_uri": "/api/v1/datatype/10103/"
        }, 
        {
            "dataid": 10104, 
            "hexo_freq": null, 
            "info": "HRMax_manual", 
            "name": "USER_HRMAX_MANUAL", 
            "resource_uri": "/api/v1/datatype/10104/"
        }, 
        {
            "dataid": 10106, 
            "hexo_freq": null, 
            "info": "HRRecovery 2 minute_manual", 
            "name": "USER_HRR_MANUAL", 
            "resource_uri": "/api/v1/datatype/10106/"
        }, 
        {
            "dataid": 11001, 
            "hexo_freq": null, 
            "info": "VO2Max Leger test _actAttr#??", 
            "name": "VO2MAX_LEGER_TEST", 
            "resource_uri": "/api/v1/datatype/11001/"
        }, 
        {
            "dataid": 11002, 
            "hexo_freq": null, 
            "info": "VO2Max Rockport test _actAttr#??", 
            "name": "VO2MAX_ROCKPORT_TEST", 
            "resource_uri": "/api/v1/datatype/11002/"
        }, 
        {
            "dataid": 11003, 
            "hexo_freq": null, 
            "info": "VO2Max 1.5 mile test _actAttr#??", 
            "name": "VO2MAX_ONE_AND_HALF_MILE_TEST", 
            "resource_uri": "/api/v1/datatype/11003/"
        }, 
        {
            "dataid": 11004, 
            "hexo_freq": null, 
            "info": "VO2Max, Cooper test _actAttr#73", 
            "name": "VO2MAX_COOPER_TEST", 
            "resource_uri": "/api/v1/datatype/11004/"
        }, 
        {
            "dataid": 11005, 
            "hexo_freq": null, 
            "info": "HRMin, Rest test _actAttr#77", 
            "name": "HRMIN_TEST", 
            "resource_uri": "/api/v1/datatype/11005/"
        }, 
        {
            "dataid": 11006, 
            "hexo_freq": null, 
            "info": "HRMax, sprinttest _actAttr#79", 
            "name": "HRMAX_SPRINT_TEST", 
            "resource_uri": "/api/v1/datatype/11006/"
        }, 
        {
            "dataid": 11007, 
            "hexo_freq": null, 
            "info": "HRMax, any high HR test _actAttr#??", 
            "name": "HRMAX_TEST", 
            "resource_uri": "/api/v1/datatype/11007/"
        }, 
        {
            "dataid": 11008, 
            "hexo_freq": null, 
            "info": "HRR, Autodetect _actAttr#72", 
            "name": "HRR_AUTODETECT", 
            "resource_uri": "/api/v1/datatype/11008/"
        }, 
        {
            "dataid": 11009, 
            "hexo_freq": null, 
            "info": "HRR1min, 400m Sprint test _actAttr#80", 
            "name": "HRR_400MSPRINTTEST", 
            "resource_uri": "/api/v1/datatype/11009/"
        }, 
        {
            "dataid": 210, 
            "hexo_freq": null, 
            "info": "USB Cable connection annotation. INTERNAL USE", 
            "name": "USBCONN_ANNOT_CHAR", 
            "resource_uri": "/api/v1/datatype/210/"
        }, 
        {
            "dataid": 211, 
            "hexo_freq": null, 
            "info": "USB Cable disconnection annotation. INTERNAL USE", 
            "name": "USBDISC_ANNOT_CHAR", 
            "resource_uri": "/api/v1/datatype/211/"
        }, 
        {
            "dataid": 212, 
            "hexo_freq": null, 
            "info": "Garment connection annotation. INTERNAL USE", 
            "name": "GARDISC_ANNOT_CHAR", 
            "resource_uri": "/api/v1/datatype/212/"
        }, 
        {
            "dataid": 213, 
            "hexo_freq": null, 
            "info": "Garment disconnection annotation. INTERNAL USE", 
            "name": "GARDISC_ANNOT_CHAR", 
            "resource_uri": "/api/v1/datatype/213/"
        }, 
        {
            "dataid": 215, 
            "hexo_freq": null, 
            "info": "User logged an event with button. INTERNAL USE", 
            "name": "USRBTN_ANNOT_CHAR", 
            "resource_uri": "/api/v1/datatype/215/"
        }, 
        {
            "dataid": 241, 
            "hexo_freq": null, 
            "info": "Various circular buffer maximum usage maxed to 255 count. INTERNAL USE", 
            "name": "BUFF_ST_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/241/"
        }, 
        {
            "dataid": 242, 
            "hexo_freq": null, 
            "info": "16 bits record CRC. Saved with every stop. INTERNAL USE", 
            "name": "CRC_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/242/"
        }, 
        {
            "dataid": 243, 
            "hexo_freq": null, 
            "info": "Data loss (Buffer overrun) status word. Saved with every stop. INTERNAL USE", 
            "name": "LOSS_ST_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/243/"
        }, 
        {
            "dataid": 244, 
            "hexo_freq": null, 
            "info": "USB cable connection status changed. INTERNAL USE", 
            "name": "USB_ST_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/244/"
        }, 
        {
            "dataid": 245, 
            "hexo_freq": null, 
            "info": "The CPU core boot character code. INTERNAL USE", 
            "name": "BOOT_ST_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/245/"
        }, 
        {
            "dataid": 246, 
            "hexo_freq": null, 
            "info": "The CPU core temperature channel code. INTERNAL USE", 
            "name": "TEMP_ST_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/246/"
        }, 
        {
            "dataid": 247, 
            "hexo_freq": null, 
            "info": "The battery level Channel code.", 
            "name": "BATT_ST_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/247/"
        }, 
        {
            "dataid": 260, 
            "hexo_freq": 15360, 
            "info": "SDANN on last 1 min, DEPRECATED", 
            "name": "HRV_SDANN_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/260/"
        }, 
        {
            "dataid": 261, 
            "hexo_freq": 256, 
            "info": "Heart Rate Variability LF Ratio(HRV) .DEPRECATED", 
            "name": "HRV_LF_RATIO_CHANNEL_CHAR", 
            "resource_uri": "/api/v1/datatype/261/"
        }, 
        {
            "dataid": 262, 
            "hexo_freq": 15360, 
            "info": "HRV LF Norm(HRV),at 1/60 Hz . DEPRECATED", 
            "name": "HRV_LF_RATIO_CHANNEL_ONE_MIN", 
            "resource_uri": "/api/v1/datatype/262/"
        }, 
        {
            "dataid": 270, 
            "hexo_freq": null, 
            "info": "SleepPosition", 
            "name": "sleep_position", 
            "resource_uri": "/api/v1/datatype/270/"
        }, 
        {
            "dataid": 271, 
            "hexo_freq": 76800, 
            "info": "Average of NN interval over 5 min", 
            "name": "ANN", 
            "resource_uri": "/api/v1/datatype/271/"
        }, 
        {
            "dataid": 272, 
            "hexo_freq": 76800, 
            "info": "Standard deviation of NN interval over 5 min", 
            "name": "SDNN", 
            "resource_uri": "/api/v1/datatype/272/"
        }, 
        {
            "dataid": 273, 
            "hexo_freq": 76800, 
            "info": "HRV LF NORM(HRV) over 5 min", 
            "name": "HRV_LF_normalized", 
            "resource_uri": "/api/v1/datatype/273/"
        }, 
        {
            "dataid": 274, 
            "hexo_freq": 76800, 
            "info": "nn/rr over 5 min", 
            "name": "NN_over_RR", 
            "resource_uri": "/api/v1/datatype/274/"
        }, 
        {
            "dataid": 318, 
            "hexo_freq": null, 
            "info": "NN interval channel, time between to heart beat detections, serverCalculation", 
            "name": "NN_interval", 
            "resource_uri": "/api/v1/datatype/318/"
        }
    ]
}