Mar. 14. 2018
Dependencies: GraphicsFramework GR-PEACH_video LCD_shield_config AsciiFont R_BSP USBHost_custom
Diff: HVCApi/HVCApi.c
- Revision:
- 4:55e0d1f4e55a
- Parent:
- 0:f5de229c9a00
--- a/HVCApi/HVCApi.c Wed Mar 08 07:43:42 2017 +0000 +++ b/HVCApi/HVCApi.c Tue Aug 08 04:50:44 2017 +0000 @@ -412,7 +412,11 @@ if(0 != (outHVCResult->executedFunc & HVC_ACTIV_AGE_ESTIMATION)){ if ( size >= (INT32)sizeof(UINT8)*3 ) { ret = HVC_ReceiveData(inTimeOutTime, sizeof(UINT8)*3, recvData); +#if(1) // Mbed + outHVCResult->fdResult.fcResult[i].ageResult.age = (signed char)(recvData[0]); +#else outHVCResult->fdResult.fcResult[i].ageResult.age = (char)(recvData[0]); +#endif outHVCResult->fdResult.fcResult[i].ageResult.confidence = (short)(recvData[1] + (recvData[2]<<8)); if ( ret != 0 ) return ret; size -= sizeof(UINT8)*3; @@ -423,7 +427,11 @@ if(0 != (outHVCResult->executedFunc & HVC_ACTIV_GENDER_ESTIMATION)){ if ( size >= (INT32)sizeof(UINT8)*3 ) { ret = HVC_ReceiveData(inTimeOutTime, sizeof(UINT8)*3, recvData); +#if(1) // Mbed + outHVCResult->fdResult.fcResult[i].genderResult.gender = (signed char)(recvData[0]); +#else outHVCResult->fdResult.fcResult[i].genderResult.gender = (char)(recvData[0]); +#endif outHVCResult->fdResult.fcResult[i].genderResult.confidence = (short)(recvData[1] + (recvData[2]<<8)); if ( ret != 0 ) return ret; size -= sizeof(UINT8)*3; @@ -434,8 +442,13 @@ if(0 != (outHVCResult->executedFunc & HVC_ACTIV_GAZE_ESTIMATION)){ if ( size >= (INT32)sizeof(UINT8)*2 ) { ret = HVC_ReceiveData(inTimeOutTime, sizeof(UINT8)*2, recvData); +#if(1) // Mbed + outHVCResult->fdResult.fcResult[i].gazeResult.gazeLR = (signed char)(recvData[0]); + outHVCResult->fdResult.fcResult[i].gazeResult.gazeUD = (signed char)(recvData[1]); +#else outHVCResult->fdResult.fcResult[i].gazeResult.gazeLR = (char)(recvData[0]); outHVCResult->fdResult.fcResult[i].gazeResult.gazeUD = (char)(recvData[1]); +#endif if ( ret != 0 ) return ret; size -= sizeof(UINT8)*2; } @@ -456,9 +469,15 @@ if(0 != (outHVCResult->executedFunc & HVC_ACTIV_EXPRESSION_ESTIMATION)){ if ( size >= (INT32)sizeof(UINT8)*3 ) { ret = HVC_ReceiveData(inTimeOutTime, sizeof(UINT8)*3, recvData); +#if(1) // Mbed + outHVCResult->fdResult.fcResult[i].expressionResult.topExpression = (signed char)(recvData[0]); + outHVCResult->fdResult.fcResult[i].expressionResult.topScore = (signed char)(recvData[1]); + outHVCResult->fdResult.fcResult[i].expressionResult.degree = (signed char)(recvData[2]); +#else outHVCResult->fdResult.fcResult[i].expressionResult.topExpression = (char)(recvData[0]); outHVCResult->fdResult.fcResult[i].expressionResult.topScore = (char)(recvData[1]); outHVCResult->fdResult.fcResult[i].expressionResult.degree = (char)(recvData[2]); +#endif if ( ret != 0 ) return ret; size -= sizeof(UINT8)*3; } @@ -599,7 +618,11 @@ if(0 != (outHVCResult->executedFunc & HVC_ACTIV_AGE_ESTIMATION)){ if ( size >= (INT32)sizeof(UINT8)*3 ) { ret = HVC_ReceiveData(inTimeOutTime, sizeof(UINT8)*3, recvData); +#if(1) // Mbed + outHVCResult->fdResult.fcResult[i].ageResult.age = (signed char)(recvData[0]); +#else outHVCResult->fdResult.fcResult[i].ageResult.age = (char)(recvData[0]); +#endif outHVCResult->fdResult.fcResult[i].ageResult.confidence = (short)(recvData[1] + (recvData[2]<<8)); if ( ret != 0 ) return ret; size -= sizeof(UINT8)*3; @@ -610,7 +633,11 @@ if(0 != (outHVCResult->executedFunc & HVC_ACTIV_GENDER_ESTIMATION)){ if ( size >= (INT32)sizeof(UINT8)*3 ) { ret = HVC_ReceiveData(inTimeOutTime, sizeof(UINT8)*3, recvData); +#if(1) // Mbed + outHVCResult->fdResult.fcResult[i].genderResult.gender = (signed char)(recvData[0]); +#else outHVCResult->fdResult.fcResult[i].genderResult.gender = (char)(recvData[0]); +#endif outHVCResult->fdResult.fcResult[i].genderResult.confidence = (short)(recvData[1] + (recvData[2]<<8)); if ( ret != 0 ) return ret; size -= sizeof(UINT8)*3; @@ -621,8 +648,13 @@ if(0 != (outHVCResult->executedFunc & HVC_ACTIV_GAZE_ESTIMATION)){ if ( size >= (INT32)sizeof(UINT8)*2 ) { ret = HVC_ReceiveData(inTimeOutTime, sizeof(UINT8)*2, recvData); +#if(1) // Mbed + outHVCResult->fdResult.fcResult[i].gazeResult.gazeLR = (signed char)(recvData[0]); + outHVCResult->fdResult.fcResult[i].gazeResult.gazeUD = (signed char)(recvData[1]); +#else outHVCResult->fdResult.fcResult[i].gazeResult.gazeLR = (char)(recvData[0]); outHVCResult->fdResult.fcResult[i].gazeResult.gazeUD = (char)(recvData[1]); +#endif if ( ret != 0 ) return ret; size -= sizeof(UINT8)*2; } @@ -646,13 +678,21 @@ outHVCResult->fdResult.fcResult[i].expressionResult.topExpression = -128; outHVCResult->fdResult.fcResult[i].expressionResult.topScore = -128; for(j = 0; j < 5; j++){ +#if(1) // Mbed + outHVCResult->fdResult.fcResult[i].expressionResult.score[j] = (signed char)(recvData[j]); +#else outHVCResult->fdResult.fcResult[i].expressionResult.score[j] = (char)(recvData[j]); +#endif if(outHVCResult->fdResult.fcResult[i].expressionResult.topScore < outHVCResult->fdResult.fcResult[i].expressionResult.score[j]){ outHVCResult->fdResult.fcResult[i].expressionResult.topScore = outHVCResult->fdResult.fcResult[i].expressionResult.score[j]; outHVCResult->fdResult.fcResult[i].expressionResult.topExpression = j + 1; } } +#if(1) // Mbed + outHVCResult->fdResult.fcResult[i].expressionResult.degree = (signed char)(recvData[5]); +#else outHVCResult->fdResult.fcResult[i].expressionResult.degree = (char)(recvData[5]); +#endif if ( ret != 0 ) return ret; size -= sizeof(UINT8)*6; }