/** * \brief Wrapper for open input buffer * */ int Input_Buffer_OpenDataStream(void) { //ARUN's IF 0 //dataInBuffer = (gps_hostbuf_p *)malloc(26); /* dataInBuffer = (char *)malloc(26);*/ /*dataInBuffer = "Test Buffer Using New Code";*/ dataInBuffer = NULL; /*************Call to gpsSinOpen*************************************************/ host_inBuff = GPS_SinOpen(gps_client,job_hostid_in); if(host_inBuff) { printf("GPS_SinOpen : Successful\n"); } else { printf("GPS_SinOpen : Failed\n"); } PMS_Delay(200); if(host_inBuff) { printf("GPS_SinOpen : host_inBuff Successful\n"); if(host_inBuff->_HostBuf) dataInBuffer = host_inBuff->_HostBuf->buf; } /*************Call to gpsSoutOpen*************************************************/ host_outBuff = GPS_SoutOpen(gps_client,job_hostid_out); if(host_outBuff) { printf("GPS_SoutOpen : Successful\n"); } else { printf("GPS_SoutOpen : Failed\n"); } if(host_inBuff) //if(dataInBuffer) { return TRUE; } //endif //ARUN's ENDIF return FALSE; }
/** * \brief Wrapper for open input buffer * */ int Input_Buffer_OpenDataStream(void) { dataInBuffer = NULL; /*************Call to gpsSinOpen*************************************************/ host_inBuff = GPS_SinOpen(gps_client,job_hostid_in); if(host_inBuff) { printf("GPS_SinOpen : Successful\n"); } else { printf("GPS_SinOpen : Failed\n"); } PMS_Delay(200); if(host_inBuff) { printf("GPS_SinOpen : host_inBuff Successful\n"); if(host_inBuff->_HostBuf) dataInBuffer = host_inBuff->_HostBuf->buf; } /*************Call to gpsSoutOpen*************************************************/ host_outBuff = GPS_SoutOpen(gps_client,job_hostid_out); if(host_outBuff) { printf("GPS_SoutOpen : Successful\n"); } else { printf("GPS_SoutOpen : Failed\n"); } if(host_inBuff) { return TRUE; } return FALSE; }
int Get_Data_From_GPS(int hostid_in, int hostid_out,int jobid) { int GPSGetPaperInfoRetVal; int GPSPdlTableval; int GPSGetPrtStatus2val; int gps_notify=0; int ret; int GPSBitSWRetVal = 0; int GPSGetModelInfoRetVal; int GPSGetHddInfo2RetVal; int GPSPlotPrepRetVal; int GPSPlotOpenRetVal; long pdl_offset; int pdl_num ; int prt_res; int hdd_status; char * modelinfovalue; simhandle_t *hsim; gps_hostbuf_p host_inBuff, host_outBuff; gps_prtstatus2_t prtStatus; varvalue_t gps_paperId; gps_hddinfo2_t hddinfo; gps_plotprepareparam_t plotPrepare; if ((hsim = __gps_getsimhandle()) == (simhandle_t *)0) return(-1); /************************** Call to gpsGetPaperInfo() *************************/ ret = _var_getbyname(hsim, "GPS_PENV_VAR_ID_APLPAGESIZE", &gps_paperId); GPSGetPaperInfoRetVal = GPS_GetPaperInfo(gps_client, gps_paperId, &gpsPaperInfo, gps_notify); if(GPSGetPaperInfoRetVal) { printf("GPS_GetPaperInfo : SUCCESS\n"); } else { printf("GPS_GetPaperInfo : FAILED\n"); } /*************Call to gpsInterpNotifyState()*************************************/ GPS_InterpNotifyState(gps_client, GPS_INTERP_STATE_PROCESSING); /*************Call to gpsSinOpen*************************************************/ host_inBuff = GPS_SinOpen(gps_client, hostid_in); if(host_inBuff) { printf("GPS_SinOpen : Successful\n"); } else { printf("GPS_SinOpen : Failed\n"); } /*************Call to gpsSoutOpen*************************************************/ host_outBuff = GPS_SoutOpen(gps_client, hostid_out); if(host_outBuff) { printf("GPS_SoutOpen : Successful\n"); } else { printf("GPS_SoutOpen : Failed\n"); } /*************Call to gpsGetBitSw*************************************************/ GPSBitSWRetVal = GPS_GetBitSw(gps_client,BIT_SW_004); /* bit number randomly given as BIT_SW_004 */ if((GPSBitSWRetVal = BIT_SW_001) || (GPSBitSWRetVal <= BIT_SW_016)) printf("GPS_getBitSW is success\n"); else printf("GPS_getBitSW is failed\n"); /*************Call to gpsPdlTable*************************************************/ GPSPdlTableval = GPS_GetPdlTable(gps_client, &pdl_offset, &pdl_num); if(!GPSPdlTableval) { printf("GetPdlTable : Successful\n"); } /*************Call to gpsPrtStatus2*************************************************/ GPSGetPrtStatus2val = GPS_GetPrtStatus2(gps_client, &prtStatus, gps_notify, &prt_res); if(GPSGetPrtStatus2val) { printf("GetPrtStatus2 : Success\n"); } /*************Call to gpsGetModelInfo*************************************************/ GPSGetModelInfoRetVal = GPS_GetModelInfo(gps_client, 0, 1, "color_prm_val", "COLOR", 32, modelinfovalue); if(GPSGetModelInfoRetVal== 0) printf("GPS_GetModelInfo: Search Successful\n"); else printf("GPS_GetModelInfo: Search Failed\n"); /*Either key or category not found, buffer overflow, illegal param, init error */ /*************Call to gpsGetHddInfo2*************************************************/ GPSGetHddInfo2RetVal = GPS_gpsGetHddInfo2( gps_client, GPS_HDD_TMP, hdd_status, hddinfo ); if(GPSGetHddInfo2RetVal) printf("GPS_gpsGetHddInfo2 is success\n"); else printf("GPS_gpsGetHddInfo2 is failed\n"); /*************Call to gpsPlotPrepare*************************************************/ GPSPlotPrepRetVal = GPS_PlotPrepare(gps_client,jobid, &plotPrepare); if(GPSPlotPrepRetVal) { printf("GPS_PlotPrepare : Success\n"); } else { printf("GPS_PlotPrepare : Failed\n"); } /*************Call to gpsPlotOpen*************************************************/ GPSPlotOpenRetVal = GPS_PlotOpen(gps_client, jobid, GPS_PLOT_NORMAL); if(GPSPlotOpenRetVal >= 0) { printf("GPS_PlotOpen : Success\n"); } else { printf("GPS_PlotOpen : Failed\n"); } return 0; }