This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sketch to publish MQTT message with queue, if MQTT is not connected | |
// when connected, on every try to pubslish a message, eventually queued | |
// messages will be published fist | |
let mqtt_test = { | |
_queue: [], // a simple filo queue by array | |
_mqttConected: false, // will be set in other function by event | |
publishMsgQueued: function (topic, payload) { | |
if (this.handleQueue(topic, payload)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("api_config.js"); | |
let protQueue = { | |
_queue: [], | |
isEmpty: function() { | |
return (this._queue.length === 0); | |
}, | |
add: function(obj) { | |
this._queue.push(obj); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load('api_http.js'); | |
load('api_config.js'); | |
let connected = 0; | |
let step = 3; | |
let started = false; | |
let watchDog = 0; | |
let timeOut = 30; // might be defined in the configuration ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool mgos_draw_dif_zipped(uint16_t x, uint16_t y, const char * difName) { | |
struct mbuf *picRead = NULL; | |
struct mbuf *picCache = NULL; | |
char *bmpBuf = NULL; | |
char *dif_hdr = NULL; | |
char *dif_start = NULL; | |
size_t bufLen = 0; | |
size_t picLen = 0; | |
size_t difhLen = 16; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Copyright 2018 M.Mueller-Spaeth <fms1961+github@gmail.com> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Created by M.MUeller-Spaeth on 07.12.15. | |
* Copyright 2015 by M.Mueller-Spath, fms1961@gmail.com | |
* | |
* usage: node extract.js <HTML file> <output path> <attribute name for file names> | |
* | |
*/ | |
var fs = require('fs'); | |
var cheerio = require('cheerio'); |