update osem block

This commit is contained in:
Mario
2020-10-29 10:50:48 +01:00
parent 14947267d1
commit cc54c18b47
7 changed files with 101 additions and 5 deletions
@@ -18,6 +18,7 @@ Blockly.Arduino.sensebox_osem_connection = function (Block) {
var box_id = this.getFieldValue('BoxID');
var host = this.getFieldValue('host');
var branch = Blockly.Arduino.statementToCode(Block, 'DO');
var access_token = this.getFieldValue('access_token');
var blocks = this.getDescendants();
var type = this.getFieldValue('type');
var ssl = this.getFieldValue('SSL');
@@ -86,7 +87,7 @@ Blockly.Arduino.sensebox_osem_connection = function (Block) {
if (connected == true) {
// construct the HTTP POST request:
sprintf_P(buffer,
PSTR("POST /boxes/%s/data HTTP/1.1\\nHost: %s\\nContent-Type: "
PSTR("POST /boxes/%s/data HTTP/1.1\\nAuthorization: ${access_token}\\nHost: %s\\nContent-Type: "
"text/csv\\nConnection: close\\nContent-Length: %i\\n\\n"),
SENSEBOX_ID, server, num_measurements * lengthMultiplikator);
// send the HTTP POST request:
@@ -146,7 +147,7 @@ Blockly.Arduino.sensebox_osem_connection = function (Block) {
if (connected == true) {
// construct the HTTP POST request:
sprintf_P(buffer,
PSTR("POST /boxes/%s/data HTTP/1.1\\nHost: %s\\nContent-Type: "
PSTR("POST /boxes/%s/data HTTP/1.1\\nAuthorization: ${access_token}\\nHost: %s\\nContent-Type: "
"text/csv\\nConnection: close\\nContent-Length: %i\\n\\n"),
SENSEBOX_ID, server, num_measurements * lengthMultiplikator);
// send the HTTP POST request: