Skip to content

Connections extension

Jimmy Fjällid edited this page Jun 3, 2017 · 2 revisions

Connections are the way the application gathers its data. To add or remove a pre-configured connection, the insertStaticConnections function in sensorDatDbHelper class will need to be modified.

connectionList.add(new Connection("mqtt","mqtt.greeniot.it.uu.se",1883,"#", true,"GreenIoT","senML"));

Figure 2, adding a connection

To add a new connection the user only needed to add a Connection object to the connection list. The connection object needs to contain the type of connection that will be added, with the url, port and topic it should listen to (in the case of mqtt) as well as whether the connection should be active from start. The two last parameters will define the topic structure and data structure that the source is using. If multiple data formats or topic structures are used, multiple connections will be needed. Messages that don't follow the given data type or topic structure will be ignored. The fourth parameter (topic) is not required for the api connection and can therefore be left empty.

Clone this wiki locally