Sample program for communicating with Fujitsuu IoT Platform using HTTP

Dependencies:   AsciiFont GR-PEACH_video GraphicsFramework LCD_shield_config R_BSP USBHost_custom easy-connect-gr-peach mbed-http picojson BM1383GLV KX022 rohm-sensor-hal rohm-bh1745

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers iot_platform.h Source File

iot_platform.h

00001 #ifndef IOT_READY_PROCESSING_H
00002 #define IOT_READY_PROCESSING_H
00003 
00004 #include "HVCApi.h"
00005 #include "HVCDef.h"
00006 #include "clib_drivers.h"
00007 
00008 #define DETECT_MAX 35
00009 #define WAIT_TIME 5000
00010 
00011 #define USE_SENSOR_SHIELD
00012 #define USE_HVC_P2
00013 //#define ENABLED_NTP
00014 
00015 typedef struct {
00016     INT32 score_neutral;
00017     INT32 score_anger;
00018     INT32 score_happiness;
00019     INT32 score_surprise;
00020     INT32 score_sadness;
00021 } IotReadyExpression_t;
00022 
00023 typedef struct {
00024     int x;
00025     int y;
00026     int z;
00027 } Accelerometer_t;
00028 
00029 typedef struct {
00030     int red;
00031     int green;
00032     int blue;
00033     int alpha;
00034 } Color_t;
00035 
00036 /* Face data detected by HVC-P2 to send to IOT Platform */
00037 typedef struct {
00038     AGE_RESULT              age;            /* Age Estimation result */
00039     GENDER_RESULT           gender;         /* Gender Estimation result */
00040     IntBoxType      face_rectangle; /* rectangle of face detection result */
00041     IotReadyExpression_t    scores;         /* Score of 5 expression */
00042 } result_hvcp2_fd_t;
00043 
00044 /* Body data detected by HVC-P2 to send to IOT Platform */
00045 typedef struct {
00046     IntBoxType      body_rectangle; /* rectangle of body detection result */
00047 } result_hvcp2_bd_t;
00048 
00049 /* Data detected by SENSORSHIELD-EVK-001 to send to IOT Platform */
00050 typedef struct {
00051     int Temperature;
00052     int Atmosphere;
00053     Accelerometer_t Accelerometer;
00054     Color_t Color;
00055 } result_sensor_shield_t;
00056 
00057 #define _DEBUG_IOT
00058 #ifdef _DEBUG_IOT
00059 extern Serial pc;
00060 #define DEBUG_PRINT(...) pc.printf(__VA_ARGS__)
00061 #else
00062 #define DEBUG_PRINT(...)
00063 #endif
00064 
00065 extern result_hvcp2_fd_t result_hvcp2_fd[DETECT_MAX];
00066 extern result_hvcp2_bd_t result_hvcp2_bd[DETECT_MAX];
00067 extern uint32_t result_hvcp2_bd_cnt;
00068 extern uint32_t result_hvcp2_fd_cnt;
00069 
00070 extern result_sensor_shield_t result_sensorshield;
00071 extern Semaphore iot_ready_semaphore;
00072 extern int semaphore_wait_ret;
00073 
00074 #endif