void SDRuTransmitter_setupImplLocal(const emlrtStack *sp, comm_SDRuTransmitter *obj, UsrpErrorCapiEnumT *errStatus, char_T errMsg_data[1024], int32_T errMsg_size[2]) { BoardIdCapiEnumT boardId; uint8_T requester[15]; int32_T i; const mxArray *y; static const int32_T iv182[2] = { 1, 6 }; const mxArray *m39; char_T cv222[6]; static const char_T cv223[6] = { 's', 'i', 'l', 'e', 'n', 't' }; static const uint8_T addr_null[13] = { 49U, 57U, 50U, 46U, 49U, 54U, 56U, 46U, 49U, 48U, 46U, 50U, 0U }; char * addr_c; uint8_T req_null[16]; char * req_c; int32_T driverApiH; const mxArray *b_y; int32_T loop_ub; char_T b_errMsg_data[1024]; comm_SDRuTransmitter *b_obj; emlrtStack st; emlrtStack b_st; emlrtStack c_st; st.prev = sp; st.tls = sp->tls; b_st.prev = &st; b_st.tls = st.tls; c_st.prev = &b_st; c_st.tls = b_st.tls; st.site = &rj_emlrtRSI; b_st.site = &rj_emlrtRSI; c_st.site = &db_emlrtRSI; st.site = &rj_emlrtRSI; boardId = obj->pSubDevice; for (i = 0; i < 15; i++) { requester[i] = (uint8_T)obj->ObjectID[i]; } /* Copyright 2011-2012 The MathWorks, Inc. */ b_st.site = &an_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; m39 = mxCreateCharArray(2, iv182); for (i = 0; i < 6; i++) { cv222[i] = cv223[i]; } emlrtInitCharArrayR2013a(&b_st, 6, m39, cv222); emlrtAssign(&y, m39); c_st.site = &uv_emlrtRSI; setupsdru(&c_st, sdruroot(&c_st, &p_emlrtMCI), y, &q_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++) { errMsg_data[i] = '\x00'; } /* varargin 1 2 3 4 5 6 7 */ /* addr, boardId, requester, frameLength, dportType, buffMode, buffSize */ /* varargout 1 2 3 */ /* driverH, errStat, errMsg */ addr_c = (char *)(addr_null); for (i = 0; i < 15; i++) { req_null[i] = requester[i]; } req_null[15] = 0; req_c = (char *)(req_null); openDataConnection_c(addr_c, boardId, req_c, 38400U, DPortDTypeCDouble, FALSE, 0U, &driverApiH, errStatus, &errMsg_data[0]); /* Tell coder that addr_null & req_null must be alive and separate throughout the call to cmd_c. */ (void)(addr_null); (void)(req_null); /* errStat = UsrpErrorCapiEnumT(errStat_i); */ i = strlen(&errMsg_data[0]); if (i <= 1024) { } else { b_y = NULL; m39 = mxCreateString("Assertion failed."); emlrtAssign(&b_y, m39); c_st.site = &nv_emlrtRSI; c_error(&c_st, b_y, &o_emlrtMCI); } if (1 > i) { loop_ub = 0; } else { loop_ub = emlrtDynamicBoundsCheckFastR2012b(i, 1, 1024, &y_emlrtBCI, &b_st); } for (i = 0; i < loop_ub; i++) { b_errMsg_data[i] = errMsg_data[i]; } errMsg_size[0] = 1; errMsg_size[1] = loop_ub; for (i = 0; i < loop_ub; i++) { errMsg_data[i] = b_errMsg_data[i]; } st.site = &rj_emlrtRSI; b_obj = obj; b_obj->pDriverHandle = driverApiH; b_st.site = &db_emlrtRSI; }
void mapiPrivate(const emlrtStack *sp, const uint8_T varargin_1[12], BoardIdCapiEnumT varargin_2, const uint8_T varargin_3[15], DataPortDataTypeCapiEnumT varargin_5, int32_T *varargout_1, UsrpErrorCapiEnumT *varargout_2, char_T varargout_3_data[], int32_T varargout_3_size[2]) { int32_T i13; static const char_T cv13[6] = { 's', 'i', 'l', 'e', 'n', 't' }; char_T u[6]; const mxArray *y; static const int32_T iv9[2] = { 1, 6 }; const mxArray *m2; uint8_T addr_null[13]; char * addr_c; uint8_T req_null[16]; char * req_c; int32_T driverApiH; UsrpErrorCapiEnumT errStat_i; int32_T errStrSize; emlrtStack st; st.prev = sp; st.tls = sp->tls; /* */ /* This function unifies handling of interp vs. codegen call as well as */ /* errStat / errStr assignment. */ /* */ /* Copyright 2011-2015 The MathWorks, Inc. */ if (!isSetupsdruCalled) { for (i13 = 0; i13 < 6; i13++) { u[i13] = cv13[i13]; } y = NULL; m2 = emlrtCreateCharArray(2, iv9); emlrtInitCharArrayR2013a(sp, 6, m2, &u[0]); emlrtAssign(&y, m2); st.site = &eb_emlrtRSI; setupsdru(&st, sdruroot(&st, &c_emlrtMCI), y, &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); */ varargout_3_size[0] = 1; memset(&varargout_3_data[0], 0, sizeof(char_T) << 10); /* varargin 1 2 3 4 5 6 7 8 9 */ /* addr, boardId, requester, frameLength, dportType, buffMode, buffSize, masterClockRate, channelMapping */ /* varargout 1 2 3 */ /* driverH, errStat, errMsg */ for (i13 = 0; i13 < 12; i13++) { addr_null[i13] = varargin_1[i13]; } addr_null[12] = 0; addr_c = (char *)(addr_null); for (i13 = 0; i13 < 15; i13++) { req_null[i13] = varargin_3[i13]; } req_null[15] = 0; req_c = (char *)(req_null); openDataConnection_c(addr_c, varargin_2, req_c, 1408U, varargin_5, false, 0U, 1.0E+8, 1.0, &driverApiH, &errStat_i, &varargout_3_data[0]); *varargout_1 = driverApiH; /* Tell coder that addr_null & req_null must be alive and separate throughout the call to cmd_c. */ (void)(addr_null); (void)(req_null); /* errStat = UsrpErrorCapiEnumT(errStat_i); */ errStrSize = strlen(&varargout_3_data[0]); if (errStrSize <= 1024) { } else { emlrtErrorWithMessageIdR2012b(sp, &d_emlrtRTEI, "Coder:builtins:AssertionFailed", 0); } if (1 > errStrSize) { varargout_3_size[1] = 0; } else { varargout_3_size[1] = errStrSize; } *varargout_2 = errStat_i; }