Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
FIAP Class Reference
#include <fiap.h>
Public Member Functions | |
| FIAP (string Storage, string PointSetId) | |
| Create fiap object. | |
| int | post (struct fiap_element *v, unsigned int esize) |
| post | |
Data Fields | |
| bool | debug_mode |
| debug_mode Output XML and Error | |
Detailed Description
FIAP Class.
for mbed
Example:
#include "mbed.h" #include "EthernetNetIf.h" #include "NTPClient.h" #include "fiap.h" #define ntp_server "ntp server address" DigitalOut led1(LED1); DigitalOut led2(LED2); DigitalOut led3(LED3); DigitalOut led4(LED4); EthernetNetIf eth; NTPClient ntp; FIAP ieee1888("http://192.168.1.5/axis2/services/FIAPStorage","http://test.fiap.org/mbed_hello/"); char timezone[] = "+09:00"; // JST struct fiap_element element[]={ {"P1",NULL,NULL,timezone}, {"P2",NULL,NULL,timezone}, }; int main() { led1=led2=led3=led4=0; ieee1888.debug_mode=true; //EthernetNetIf initialize EthernetErr ethErr = eth.setup(); if (ethErr) { // lcd.locate(0,1); // lcd.printf("Error %d in setup.\n", ethErr); return -1; } led1=1; //NTPClient initia,lize Host server(IpAddr(), 123, ntp_server); NTPResult Ntpr=ntp.setTime(server); //UTC-->JST +9Hour(32400Sec) time_t ctTime; ctTime = time(NULL); ctTime+=32400; set_time(ctTime); led2=1; //post int i,j; for (j=0; j<10; j++) { //data initialize time_t seconds = time(NULL); for (i=0; i<2; i++) { char data[5]; int s=j*pow((double)10,i); sprintf(data,"%03d",s); element[i].value=data; element[i].t=localtime(&seconds); } //do post int ret=ieee1888.post(element,2); if(ret!=0){ while (1) { led3=!led3; wait(0.5); } return 0; } wait(1); } //finish while (1) { led4=!led4; wait(0.5); } } *
Definition at line 117 of file fiap.h.
Constructor & Destructor Documentation
| FIAP | ( | string | Storage, |
| string | PointSetId | ||
| ) |
Create fiap object.
- Parameters:
-
Storage FIAP Storage Addrees (ie. "http://fiap.org/axis2/services/FIAPStorage") PointSetId Point Set ID(ie. http://test.fiap.jp/bldg_1/3F/)
Member Function Documentation
| int post | ( | struct fiap_element * | v, |
| unsigned int | esize | ||
| ) |
Field Documentation
| bool debug_mode |
Generated on Sat Jul 23 2022 05:08:17 by
1.7.2