⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bluetooth_lib2_sfun.c

📁 在matlab的simulink中实现的无线蓝牙模块
💻 C
字号:
#include "bluetooth_lib2_sfun.h"
#include "bluetooth_lib2_sfun_c4.h"
#include "bluetooth_lib2_sfun_c5.h"
#include "bluetooth_lib2_sfun_debug_macros.h"
unsigned int _bluetooth_lib2MachineNumber_=UNREASONABLE_NUMBER;
unsigned int sf_bluetooth_lib2_process_check_sum_call( int nlhs, mxArray *
 plhs[], int nrhs, const mxArray * prhs[] )
{
#ifdef MATLAB_MEX_FILE
  char commandName[20];
  if (nrhs<1 || !mxIsChar(prhs[0]) ) return 0;
  /* Possible call to get the checksum */
  mxGetString(prhs[0], commandName,sizeof(commandName)/sizeof(char));
  commandName[(sizeof(commandName)/sizeof(char)-1)] = '\0';
  if(strcmp(commandName,"sf_get_check_sum")) return 0;
  plhs[0] = mxCreateDoubleMatrix( 1,4,mxREAL);
  if(nrhs>2 && mxIsChar(prhs[1])) {
    mxGetString(prhs[1], commandName,sizeof(commandName)/sizeof(char));
    commandName[(sizeof(commandName)/sizeof(char)-1)] = '\0';
    if(!strcmp(commandName,"library")) {
      char machineName[100];
      mxGetString(prhs[2], machineName,sizeof(machineName)/sizeof(char));
      machineName[(sizeof(machineName)/sizeof(char)-1)] = '\0';
      if(!strcmp(machineName,"bluetooth_lib2")){
        ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(2077309371U);
        ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(1545163614U);
        ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(610547865U);
        ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(2936051941U);
      }else{
        return 0;
      }
    }
  }else {
    return 0;
  }

  return 1;
#else
  return 0;
#endif
}

/* Machine initialize */
void bluetooth_lib2_initializer(void)
{
  /* Initialize machine's broadcast event variable */
  _sfEvent_ = CALL_EVENT;

  _bluetooth_lib2MachineNumber_ =
    sf_debug_initialize_machine("bluetooth_lib2","sfun",1,2,0,0,0);
  sf_debug_set_machine_event_thresholds(_bluetooth_lib2MachineNumber_,0,0);
  sf_debug_set_machine_data_thresholds(_bluetooth_lib2MachineNumber_,0);
}

unsigned int bluetooth_lib2_registry(SimStruct *simstructPtr,char *chartName,
 int initializeFlag)
{
  if(!strcmp_ignore_ws(chartName,"bluetooth_lib2/BT Device/Rx: Radio, Deframe, controller/Rx Controller/Header Check Frame_OK/ SFunction "))
  {
    bluetooth_lib2_sfun_c4_registry(simstructPtr);
    return 1;
  }
  if(!strcmp_ignore_ws(chartName,"bluetooth_lib2/BT Device/Tx Controller and data source/Transmit Controller/ SFunction "))
  {
    bluetooth_lib2_sfun_c5_registry(simstructPtr);
    return 1;
  }
  return 0;
}
unsigned int bluetooth_lib2_sizes_registry(SimStruct *simstructPtr,char
 *chartName)
{
  if(!strcmp_ignore_ws(chartName,"bluetooth_lib2/BT Device/Rx: Radio, Deframe, controller/Rx Controller/Header Check Frame_OK/ SFunction "))
  {
    bluetooth_lib2_sfun_c4_sizes_registry(simstructPtr);
    return 1;
  }
  if(!strcmp_ignore_ws(chartName,"bluetooth_lib2/BT Device/Tx Controller and data source/Transmit Controller/ SFunction "))
  {
    bluetooth_lib2_sfun_c5_sizes_registry(simstructPtr);
    return 1;
  }
  return 0;
}
void bluetooth_lib2_terminator(void)
{
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -