112 lines
3.1 KiB
Plaintext
112 lines
3.1 KiB
Plaintext
In this technical article, an preliminary exploration was undertaken to gauge the suitability of five programming languages for Internet of Things (IoT) development. We implemented a basic "hello world" program in each language to explore; serving as an initial foray into their syntax and basic functionality. Please nothe that, due to limmited information provided, comprehensive code editing, compilation, and deployment processes were not feasible. Thus, the evaluation presented herein focuses solely on the initial code composition, as the full assessment of code suitability, efficiency, and performance would require a more extensive development and testing environment; which was provided only in one case: Gabrielli et al. - 2018. Nonetheless, this initial exercise offers an initial glimpse into the languages' ease of use and foundational constructs. Further in-depth evaluation and testing would be necessary for a comprehensive assessment of their suitability for IoT applications.
|
||
|
||
|
||
----------------------------
|
||
Soic et al 2020
|
||
----------------------------
|
||
|
||
#conditions
|
||
[condition]there is a command like “{message}”
|
||
=Event(message==”{message}”)
|
||
|
||
|
||
#consequences
|
||
[consequence]turn on “{connector}“
|
||
=Connectors.set(“{connector}”), “ON”);
|
||
|
||
|
||
rule “Activation”
|
||
when
|
||
there is a command like “activate light”
|
||
then
|
||
turn on “light”
|
||
end
|
||
|
||
|
||
----------------------------
|
||
Amrani, et al (2017)
|
||
----------------------------
|
||
|
||
configuration MyHome {
|
||
node gw: Central
|
||
node frontdoor: DoorLock
|
||
node light: LightBulb
|
||
|
||
from frontdoor to gw via MQTT
|
||
from light to gw via MQTT
|
||
}
|
||
|
||
|
||
rule SwitchLightsWhenEnter:
|
||
when (frontdoor.opened()) do {
|
||
light.on()
|
||
}
|
||
|
||
|
||
----------------------------
|
||
Petnik y Vanus
|
||
----------------------------
|
||
The authors does not provide an example (not even a basic one) and it was impossible to find the software associated with this paper.
|
||
|
||
|
||
----------------------------
|
||
Dong et al.
|
||
----------------------------
|
||
|
||
#include “TL_DeviceID.h”
|
||
|
||
#define MAINBOARD ARDUINO_UNO
|
||
#define WIFI ESP8266_ESP01
|
||
#define LIGHT GROVE_LIGHT
|
||
|
||
#define WIFI_UART_RX 1
|
||
#define WIFI_UART_TX 0
|
||
#define LIGHT_ANALOG_OUTPUT 0
|
||
|
||
void setup() {
|
||
TL_WiFi.init();
|
||
TL_WiFi.join(“SSID”, “PASSWORD”);
|
||
TL.Light.setMeassuringRange(1,30000,”LUX”);
|
||
}
|
||
|
||
void loop() {
|
||
TL.Light.write();
|
||
upload();
|
||
}
|
||
|
||
void upload() {
|
||
double light = TL_Light.data();
|
||
double sm = TL_Soil_Moisture.data();
|
||
String url = “http://hostname/ul.php?”;
|
||
url += String(“light=”) + String(light);
|
||
TL_WiFi.get(url);
|
||
}
|
||
|
||
|
||
----------------------------
|
||
Gabrielli et al. - 2018
|
||
----------------------------
|
||
|
||
type LightType: void { .id: string } | int { .id: string }
|
||
|
||
interface LightInterface {
|
||
RequestResponse: getTmp( LightType )( int )
|
||
OneWay: setLight( LightType )
|
||
}
|
||
|
||
outputPort Light {
|
||
Location: "datagram://light:5683"
|
||
Protocol: coap {
|
||
.osc.setLight << {
|
||
.messageType = "CON",
|
||
.messageCode = "POST",
|
||
.alias = "/%!{id}/setLight"
|
||
}
|
||
}
|
||
Interfaces: LightInterface
|
||
}
|
||
|
||
main {
|
||
setLight@Device( 1 { .id = "42" } )
|
||
}
|