/* Function Definitions */ void receiveData(const emlrtStack *sp, int32_T driverApiH, real_T freq, real_T loOffset, real_T gain, real_T decim, cint16_T data[46336], uint32_T *dataLength, uint32_T *overflow, UsrpErrorCapiEnumT *errStat, char_T errStr_data[1024], int32_T errStr_size[2]) { const mxArray *y; static const int32_T iv121[2] = { 1, 6 }; const mxArray *m19; char_T cv139[6]; int32_T i; static const char_T cv140[6] = { 's', 'i', 'l', 'e', 'n', 't' }; const mxArray *b_y; int32_T loop_ub; char_T b_errStr_data[1024]; emlrtStack st; emlrtStack b_st; st.prev = sp; st.tls = sp->tls; b_st.prev = &st; b_st.tls = st.tls; /* Copyright 2011-2012 The MathWorks, Inc. */ st.site = &jn_emlrtRSI; /* */ /* This function unifies handling of interp vs. codegen call as well as */ /* errStat / errStr assignment. */ /* */ /* Copyright 2011-2013 The MathWorks, Inc. */ if (!isSetupsdruCalled) { y = NULL; m19 = mxCreateCharArray(2, iv121); for (i = 0; i < 6; i++) { cv139[i] = cv140[i]; } emlrtInitCharArrayR2013a(&st, 6, m19, cv139); emlrtAssign(&y, m19); b_st.site = &ybb_emlrtRSI; setupsdru(&b_st, sdruroot(&b_st, &o_emlrtMCI), y, &p_emlrtMCI); isSetupsdruCalled = TRUE; } /* These sizes must match those in C code. */ /* Arbitrary max imposed on ML/SL side */ /* function is being called in interpreted mode */ /* not being found: */ /* eml_allow_enum_inputs; */ /* errStat_i = int32(0); */ for (i = 0; i < 1024; i++) { errStr_data[i] = '\x00'; } /* 46336 represents 0.00185344 seconds at 25Msps. 1 ms seems to be a decent */ /* time interval to interact with the IP stack on a default glnxa64 machine. */ /* 32768 seems to be the max for UHD(TM) so we may want to change to that. */ receiveData_c(driverApiH, freq, loOffset, gain, decim, data, dataLength, overflow, errStat, &errStr_data[0]); /* errStat = UsrpErrorCapiEnumT(errStat_i); */ i = strlen(&errStr_data[0]); if (i <= 1024) { } else { b_y = NULL; m19 = mxCreateString("Assertion failed."); emlrtAssign(&b_y, m19); b_st.site = &mbb_emlrtRSI; c_error(&b_st, b_y, &n_emlrtMCI); } if (1 > i) { loop_ub = 0; } else { loop_ub = emlrtDynamicBoundsCheckFastR2012b(i, 1, 1024, &p_emlrtBCI, &st); } for (i = 0; i < loop_ub; i++) { b_errStr_data[i] = errStr_data[i]; } errStr_size[0] = 1; errStr_size[1] = loop_ub; for (i = 0; i < loop_ub; i++) { errStr_data[i] = b_errStr_data[i]; } }
void receiveData(const emlrtStack *sp, int32_T driverApiH, const real_T freq[2], const real_T loOffset[2], const real_T gain[2], real_T decim, cint16_T data[375000], uint32_T *dataLength, uint32_T *overflow, UsrpErrorCapiEnumT *errStat, char_T errStr_data[], int32_T errStr_size[2]) { static const char_T cv20[6] = { 's', 'i', 'l', 'e', 'n', 't' }; UsrpErrorCapiEnumT errStat_i; real_T b_freq[2]; real_T b_loOffset[2]; real_T b_gain[2]; int32_T i18; int32_T errStrSize; emlrtStack st; emlrtStack b_st; st.prev = sp; st.tls = sp->tls; b_st.prev = &st; b_st.tls = st.tls; /* Copyright 2011-2015 The MathWorks, Inc. */ st.site = &bb_emlrtRSI; /* */ /* This function unifies handling of interp vs. codegen call as well as */ /* errStat / errStr assignment. */ /* */ /* Copyright 2011-2015 The MathWorks, Inc. */ if (!isSetupsdruCalled) { b_st.site = &eb_emlrtRSI; setupsdru(&b_st, sdruroot(&b_st, &c_emlrtMCI), emlrt_marshallOut(&b_st, cv20), &d_emlrtMCI); isSetupsdruCalled = true; } /* These sizes must match those in C code. */ /* Arbitrary max imposed on ML/SL side */ /* function is being called in interpreted mode */ /* not being found: */ /* eml_allow_enum_inputs; */ /* errStat_i = int32(0); */ errStr_size[0] = 1; memset(&errStr_data[0], 0, sizeof(char_T) << 10); /* 46336 represents 0.00185344 seconds at 25Msps. 1 ms seems to be a decent */ /* time interval to interact with the IP stack on a default glnxa64 machine. */ /* 32768 seems to be the max for UHD(TM) so we may want to change to that. */ for (i18 = 0; i18 < 2; i18++) { b_freq[i18] = freq[i18]; b_loOffset[i18] = loOffset[i18]; b_gain[i18] = gain[i18]; } receiveData_c(driverApiH, b_freq, b_loOffset, b_gain, decim, data, dataLength, overflow, &errStat_i, &errStr_data[0]); /* errStat = UsrpErrorCapiEnumT(errStat_i); */ errStrSize = strlen(&errStr_data[0]); if (errStrSize <= 1024) { } else { emlrtErrorWithMessageIdR2012b(&st, &d_emlrtRTEI, "Coder:builtins:AssertionFailed", 0); } if (1 > errStrSize) { errStr_size[1] = 0; } else { errStr_size[1] = errStrSize; } *errStat = errStat_i; }