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
trigger: | |
- main | |
pool: | |
vmImage: ubuntu-latest | |
steps: | |
- task: NodeTool@0 | |
inputs: | |
versionSpec: '14.x' |
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
FROM node:10-slim | |
RUN apt-get update || : && apt-get -y install bluetooth bluez libbluetooth-dev libudev-dev build-essential make python | |
WORKDIR /app/ | |
COPY package*.json ./ | |
RUN npm install --production |
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
Client.fromEnvironment(Transport, function (err, client) { | |
if (err) { | |
throw err; | |
} else { | |
client.on('error', function (err) { | |
throw err; | |
}); | |
// connect to the Edge instance | |
client.open(function (err) { |
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
"modules": { | |
"BLEModule": { | |
"version": "1.0", | |
"type": "docker", | |
"status": "running", | |
"restartPolicy": "always", | |
"settings": { | |
"image": "${MODULES.BLEModule}", | |
"createOptions": { | |
"NetworkingConfig": { |
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
{ | |
"$schema-template": "2.0.0", | |
"modulesContent": { | |
"$edgeAgent": { | |
"properties.desired": { | |
"schemaVersion": "1.0", | |
"runtime": { | |
"type": "docker", | |
"settings": { | |
"minDockerVersion": "v1.25", |
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
"$edgeHub": { | |
"properties.desired": { | |
"schemaVersion": "1.0", | |
"routes": { | |
"IdentityTranslationModuleToIoTHub": "FROM /messages/modules/IdentityTranslationModule/outputs/* INTO $upstream", | |
"sensorToIdentityTranslationModule": "FROM /messages/modules/SimulatedTemperatureSensor/outputs/temperatureOutput INTO BrokeredEndpoint(\"/modules/IdentityTranslationModule/inputs/input1\")" | |
}, | |
"storeAndForwardConfiguration": { | |
"timeToLiveSecs": 7200 | |
} |
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
"modules": { | |
"IdentityTranslationModule": { | |
"version": "1.0", | |
"type": "docker", | |
"status": "running", | |
"restartPolicy": "always", | |
"settings": { | |
"image": "${MODULES.IdentityTranslationModule}", | |
"createOptions": {} | |
}, |
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
'use strict'; | |
const Transport = require('azure-iot-device-mqtt').Mqtt; | |
const ModuleClient = require('azure-iot-device').ModuleClient; | |
const Message = require('azure-iot-device').Message; | |
const DeviceClient = require('azure-iot-device').Client; | |
let simulatedTemperatureClient; | |
ModuleClient.fromEnvironment(Transport, function (err, moduleClient) { |
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 azure = require('azure-storage'); | |
const tableService = azure.createTableService(); | |
const tableName = "mytable"; | |
module.exports = function (context, req) { | |
context.log('Start ItemDelete'); | |
const id = req.query.id; | |
if (id) { |
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 azure = require('azure-storage'); | |
const tableService = azure.createTableService(); | |
const tableName = "mytable"; | |
module.exports = function (context, req) { | |
context.log('Start ItemUpdate'); | |
if (req.body) { |
NewerOlder