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
const https = require('https'); | |
const token = '<jwt>'; | |
const requestOptions = { | |
hostname: 'remote.macchina.io', | |
port: 443, | |
path: '/my-devices/api/devices?status=all', | |
method: 'GET', | |
headers: { |
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
var net = require('net'); | |
// | |
// An object for writing measurements to InfluxDB | |
// | |
const InfluxDB = { | |
formatValue: function(value) { | |
if (typeof value === 'number') | |
{ | |
return value.toString(); |
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
// g++ -o coap-server coap-server.cpp -lcoap-2-openssl -lPocoNet -lPocoFoundation | |
#include <Poco/Net/SocketAddress.h> | |
#include <Poco/Random.h> | |
#include <Poco/NumberFormatter.h> | |
#include <Poco/Exception.h> | |
#include <coap2/coap.h> | |
#include <iostream> |
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
// g++ -o coap-get coap-get.cpp -lcoap-2-openssl -lPocoNet -lPocoFoundation | |
#include <Poco/Net/SocketAddress.h> | |
#include <Poco/Exception.h> | |
#include <coap2/coap.h> | |
#include <cstring> | |
#include <iostream> | |
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
// | |
// SAXParser.cpp | |
// | |
// This sample demonstrates the SAXParser class. | |
// | |
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. | |
// and Contributors. | |
// | |
// SPDX-License-Identifier: BSL-1.0 | |
// |
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
var sensorRef = serviceRegistry.findByName('io.macchina.btle.peripheral.58:2D:34:35:D7:1D'); | |
var sensor = sensorRef.instance(); | |
const CHAR_BATTERY_LEVEL = 0x0018; // characteristic for reading battery level (0-99) | |
const CHAR_NOTIFICATION = 0x0010; // characteristic for enabling temperature/humidity notifications | |
console.log('connecting...'); | |
function parseValue(str) | |
{ |
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
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
int main(int argc, char* argv[]) |
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
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
int main(int argc, char* argv[]) |
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
#include <memory> | |
#include <iostream> | |
struct Acceleration | |
{ | |
float x; | |
float y; | |
float z; | |
}; |
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
var net = require('net'); | |
var sensors = [ | |
{ | |
name: 'temperature', | |
id: 'io.macchina.bluePillar.temperature#lamp1', | |
sensor: null, | |
validRange: { min: -40, max: 50 } | |
}, | |
{ |
NewerOlder