Ce tuturiel vous aide à réaliser votre première application avec le Devmel SDK pour afficher la température en degrés Kelvins et Celsius.
import com.devmel.content.SimpleIPLocator; public class AirSendExample { public static void main(String[] args) { //Entrez la référence unique SimpleIPLocator cfg = new SimpleIPLocator("sp://1234567890123456@[fe80::dcf6:e5ff:fe:1]?gw=y"); } }
import com.devmel.content.SimpleIPLocator; import com.devmel.devices.AirSend; public class AirSendExample { public static void main(String[] args) { //Entrez la référence unique SimpleIPLocator cfg = new SimpleIPLocator("sp://1234567890123456@[fe80::dcf6:e5ff:fe:1]?gw=y"); //Instancier un objet AirSend AirSend airsend = new AirSend(cfg); try { //Ouvrir la communication if(airsend.open()){ //Lire la température en Kelvins double tmp = airsend.readTemperature(); //Afficher le resultat if (tmp >= 0) { double tmpCelcius = Math.round((tmp - 273.15) * 10.0) / 10.0; System.out.println("Temperature : "+String.format("%.1f\u00B0K",tmp)); System.out.println("Temperature : "+String.format("%.1f\u00B0C",tmpCelcius)); } else if (tmp < 0) { System.out.println("Error"); } } } catch (Exception e) { e.printStackTrace(); }finally{ //Fermer la communication airsend.close(); } } }
Finalement, lancez le programme et vous verrez la température en temps réel.
Disponible bientôt...
Disponible bientôt...
Disponible bientôt...
Disponible bientôt...
These license terms are between You (hereinafter: Licensee) and Devmel (hereinafter: Licensor) regarding Your use of the Devmel SDK (Software Development Kit) and any associated files made available by Devmel (hereinafter: The Software) created and owned by Licensor, as detailed herein.
Licensor hereby grants Licensee a Personal, Non-assignable& non-transferable, Perpetual, Commercial, Royalty free, Without the rightsto create derivative works, Non-exclusive license, all with accordance withthe terms set forth and other legal restrictions set forth in 3rd partysoftware used while running Software.
2.1 Limited: Licensee may use Software for the purpose of:
2.1.1 Running Software on Licensee’s devices;
2.1.2 Allowing 3rd Parties to run Software on devices;
2.1.3 Publishing Software’s output to Licensee and 3rd Parties;
2.1.4 Distribute verbatim copies of Software’s output (including compiled binaries);
2.2 This license is granted perpetually, as long as you do not materially breach it.
2.3 Binary Restricted: Licensee may sublicense Software as a part of a larger work containing more than Software, distributed solely in Object or Binary form under a personal, non-sublicensable, limited license. Such redistribution shall be limited to unlimited codebases.
2.4 Non Assignable & Non-Transferable: Licensee may not assign or transfer his rights and duties under this license.
2.5 Commercial, Royalty Free: Licensee may use Library for any purpose, including paid-services, without any royalties.
Licensor may provide Licensee, from time to time,with Upgrades, Updates or Fixes, as detailed herein and according to his solediscretion. Licensee hereby warrants to keep The Software up-to-date andinstall all relevant updates and fixes. Licensor shall provide any update orFix free of charge; however, nothing in this Agreement shall require Licensorto provide Updates or Fixes.
Software is provided under an AS-IS basis and without any support,updates or maintenance. Nothing in this Agreement shall require Licensor toprovide Licensee with support or fixes to any bug, failure, mis-performanceor other defect in The Software.
Licensee hereby agrees not to initiate class-actionlawsuits against Licensor in relation to this license and to compensate Licensorfor any legal fees, cost or attorney fees should any claim brought by Licenseeagainst Licensor be denied, in part or in full.