summaryrefslogtreecommitdiffstats
path: root/templates/wandboard/conf/bblayers.conf.sample
diff options
context:
space:
mode:
authorLeon Anavi <leon.anavi@konsulko.com>2016-05-04 12:50:57 +0000
committerGerrit Code Review <gerrit@172.30.200.200>2016-05-06 13:30:47 +0000
commit27d10e87ed68653f010df94a699f80d4811ff007 (patch)
tree1d0cb1c36b686737817d8332bf66243f3da821e3 /templates/wandboard/conf/bblayers.conf.sample
parente153e638d0dafcc85afb2e55ec59ef2859c59fb9 (diff)
bblayers.conf.sample: Add meta-rust
Add meta-rust to bblayers.conf because the layer is required for building RVI SOTA Client. Bug-AGL: SPEC-176 Change-Id: I577ea56ca043f541c8cad5e5e03c9182e03946e9 Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Diffstat (limited to 'templates/wandboard/conf/bblayers.conf.sample')
-rw-r--r--templates/wandboard/conf/bblayers.conf.sample1
1 files changed, 1 insertions, 0 deletions
diff --git a/templates/wandboard/conf/bblayers.conf.sample b/templates/wandboard/conf/bblayers.conf.sample
index 4a577bc4..b6dce262 100644
--- a/templates/wandboard/conf/bblayers.conf.sample
+++ b/templates/wandboard/conf/bblayers.conf.sample
@@ -23,6 +23,7 @@ BBLAYERS ?= " \
##OEROOT##/../meta-agl-demo \
##OEROOT##/../meta-openembedded/meta-ruby \
##OEROOT##/../meta-qt5 \
+ ##OEROOT##/../meta-rust \
"
BBLAYERS_NON_REMOVABLE ?= " \
##OEROOT##/meta \
/ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * Copyright (C) 2018 "IoT.bzh"
 * Author "Romain Forlot" <romain.forlot@iot.bzh>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *	 http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#define _GNU_SOURCE
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>

#include "influxdb.h"
#include "tsdb.h"
#include "wrap-json.h"
#include "../utils/list.h"

void concatenate(char* dest, const char* source, const char *sep)
{
	strncat(dest, sep, strlen(sep));
	strncat(dest, source, strlen(source));
}

size_t make_url(char *url, size_t l_url, const char *host, const char *port, const char *endpoint)
{
	bzero(url, l_url);

	/* Handle default host and port */
	host = host ? host : DEFAULT_DBHOST;
	port = port ? port : DEFAULT_DBPORT;

	strncat(url, host, strlen(host));
	strncat(url, ":", 1);
	strncat(url, port, strlen(port));
	strncat(url, "/", 1);
	strncat(url, endpoint, strlen(endpoint));
	strncat(url, "?db="DEFAULT_DB, strlen("?db="DEFAULT_DB));

	return strlen(url);
}


int create_database()
{
	int ret = 0;
	char *result;
	size_t result_size;

	// Declare query to be posted
	const char *post_data[2];
	post_data[0] = "q=CREATE DATABASE \""DEFAULT_DB"\"";
	post_data[1] = NULL;

	CURL *request = curl_wrap_prepare_post("localhost:"DEFAULT_DBPORT"/query",NULL, 1, post_data);
	curl_wrap_perform(request, &result, &result_size);

	if(curl_wrap_response_code_get(request) != 200) {
		AFB_ERROR("Can't create database.");
		ret = ERROR;
	}

	curl_easy_cleanup(request);

	if(ret == 0)
		AFB_NOTICE("Database '"DEFAULT_DB"' created");

	return ret;
}

void unpacking_from_api(void *s, json_object *valueJ, const char *key)
{
	size_t key_length = strlen(key);
	struct series_t *serie = (struct series_t*)s;

	/* Treat the 2 static key that could have been specified */
	if(strcasecmp("name", key) == 0)
		serie->name = json_object_get_string(valueJ);
	else if(strcasecmp("timestamp", key) == 0)
		serie->timestamp = get_ts();
	/* Treat all key looking for tag and field object. Those ones could be find
	   with the last 2 character. '_t' for tag and '_f' that are the keys that
	   could be indefinite. Cf influxdb documentation:
	   https://docs.influxdata.com/influxdb/v1.5/write_protocols/line_protocol_reference/ */
	else if(strncasecmp(&key[key_length-2], "_t", 2) == 0)
		add_elt(&serie->serie_columns.tags, key, valueJ);
	else if(strncasecmp(&key[key_length-2], "_f", 2) == 0)
		add_elt(&serie->serie_columns.fields, key, valueJ);
}

int unpack_metric_from_api(json_object *m, struct series_t *serie)
{
	wrap_json_object_for_all(m, unpacking_from_api, serie);

	if(!serie->timestamp)
		serie->timestamp = get_ts();

	return 0;
}