1-14 实验11 获取网络拓扑

2023-05-16

获取网络拓扑

1、实验内容:PC端串口调试助手向协调器发送命名“topology”,协调器接受到命令后,将网络拓扑信息发送到PC机串口调试助手上。

2、知识点:在1-11 实验9 网络管理实验1 获取自身和父节点的网络地址、MAC地址 中,我们知道每个节点都获取自身和父节点的网络地址,然后发送到协调器节点,然后再通过串口写到串口的调试助手上。这样就可以获得整个网络的拓扑结构啦。

3、程序设计

     协调器程序设计

//NewCoordinator.h文件中添加如下结构体。
typedef struct rftx{
   uint8 type[3];
   uint8 myNWK[4];
   uint8 pNWK[4];
  }RFTX;
NewCoordinator.c文件如下:

#include "OSAL.h"
#include "AF.h"
#include "ZDApp.h"
#include "ZDObject.h"
#include "ZDProfile.h"
#include "NewCoordinator.h"
//#include "GenericApp.h"
#include "DebugTrace.h"

#if !defined( WIN32 )
  #include "OnBoard.h"
#endif

/* HAL */
#include "hal_lcd.h"
#include "hal_led.h"
#include "hal_key.h"
#include "hal_uart.h"

/*********************************************************************
 * MACROS
 */

/*********************************************************************
 * CONSTANTS
 */
/*********************************************************************
 * TYPEDEFS
 */
/*********************************************************************
 * GLOBAL VARIABLES
 */
// This list should be filled with Application specific Cluster IDs.
const cId_t GenericApp_ClusterList[GENERICAPP_MAX_CLUSTERS] =
{
  GENERICAPP_CLUSTERID
};

const SimpleDescriptionFormat_t GenericApp_SimpleDesc =
{
  GENERICAPP_ENDPOINT,              //  int Endpoint;
  GENERICAPP_PROFID,                //  uint16 AppProfId[2];
  GENERICAPP_DEVICEID,              //  uint16 AppDeviceId[2];
  GENERICAPP_DEVICE_VERSION,        //  int   AppDevVer:4;
  GENERICAPP_FLAGS,                 //  int   AppFlags:4;
  //下面的初始化 二选一!!!!!!!!
  GENERICAPP_MAX_CLUSTERS,          //  byte  AppNumInClusters;
  (cId_t *)GenericApp_ClusterList,  //  byte *pAppInClusterList;
 // GENERICAPP_MAX_CLUSTERS,          //  byte  AppNumInClusters;
 // (cId_t *)GenericApp_ClusterList   //  byte *pAppInClusterList;
 0,
 (cId_t *)NULL
};

// This is the Endpoint/Interface description.  It is defined here, but
// filled-in in GenericApp_Init().  Another way to go would be to fill
// in the structure here and make it a "const" (in code space).  The
// way it's defined in this sample app it is define in RAM.
endPointDesc_t GenericApp_epDesc;
/*********************************************************************
 * EXTERNAL VARIABLES
 */
/*********************************************************************
 * EXTERNAL FUNCTIONS
 */
/*********************************************************************
 * LOCAL VARIABLES
 */
byte GenericApp_TaskID;   // Task ID for internal task/event processing
                          // This variable will be received when
                          // GenericApp_Init() is called.
devStates_t GenericApp_NwkState;


byte GenericApp_TransID;  // This is the unique message ID (counter)

//afAddrType_t GenericApp_DstAddr;

/*********************************************************************
 * LOCAL FUNCTIONS
 */
//void GenericApp_ProcessZDOMsgs( zdoIncomingMsg_t *inMsg );
//void GenericApp_HandleKeys( byte shift, byte keys );
void GenericApp_MessageMSGCB( afIncomingMSGPacket_t *pckt );//处理事件
//void GenericApp_SendTheMessage( void );//发送数据

static void rxCB(uint8 port,uint8 envent);

/*********************************************************************
 * NETWORK LAYER CALLBACKS
 */

/*********************************************************************
 * PUBLIC FUNCTIONS
 */

/*********************************************************************
 * @fn      GenericApp_Init
 *
 * @brief   Initialization function for the Generic App Task.
 *          This is called during initialization and should contain
 *          any application specific initialization (ie. hardware
 *          initialization/setup, table initialization, power up
 *          notificaiton ... ).
 *
 * @param   task_id - the ID assigned by OSAL.  This ID should be
 *                    used to send messages and set timers.
 *
 * @return  none
 */
void GenericApp_Init( byte task_id )
{
  GenericApp_TaskID = task_id;
 // GenericApp_NwkState = DEV_INIT;
  GenericApp_TransID = 0;

  // Device hardware initialization can be added here or in main() (Zmain.c).
  // If the hardware is application specific - add it here.
  // If the hardware is other parts of the device add it in main().

 // GenericApp_DstAddr.addrMode = (afAddrMode_t)AddrNotPresent;
 // GenericApp_DstAddr.endPoint = 0;
 // GenericApp_DstAddr.addr.shortAddr = 0;

  // Fill out the endpoint description.
  GenericApp_epDesc.endPoint = GENERICAPP_ENDPOINT;
  GenericApp_epDesc.task_id = &GenericApp_TaskID;
  GenericApp_epDesc.simpleDesc
            = (SimpleDescriptionFormat_t *)&GenericApp_SimpleDesc;
  GenericApp_epDesc.latencyReq = noLatencyReqs;

  // Register the endpoint description with the AF
  afRegister( &GenericApp_epDesc );
  
  //串口的设置,并打开串口
  halUARTCfg_t uartConfig;
  uartConfig.configured =TRUE;
  uartConfig.baudRate   =HAL_UART_BR_115200;
  uartConfig.flowControl=FALSE;
 // uartConfig.callBackFunc=NULL;//???????????????????????????????????
  uartConfig.callBackFunc=rxCB;
  HalUARTOpen(0,&uartConfig);   //打开串口
}

/*********************************************************************
 * @fn      GenericApp_ProcessEvent
 *
 * @brief   Generic Application Task event processor.  This function
 *          is called to process all events for the task.  Events
 *          include timers, messages and any other user defined events.
 *
 * @param   task_id  - The OSAL assigned task ID.
 * @param   events - events to process.  This is a bit map and can
 *                   contain more than one event.
 *
 * @return  none
 */
UINT16 GenericApp_ProcessEvent( byte task_id, UINT16 events )
{
  afIncomingMSGPacket_t *MSGpkt;
   HalLedBlink(HAL_LED_1,0,50,500);
  if ( events & SYS_EVENT_MSG )
  {
    MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( GenericApp_TaskID );
    while ( MSGpkt )
    {
      switch ( MSGpkt->hdr.event )
      {
         case AF_INCOMING_MSG_CMD:  //天线接收到数据
          HalLedBlink(HAL_LED_2,0,50,500);
          GenericApp_MessageMSGCB( MSGpkt );   //接收数据并把数据发送到UART
         break;         
        default:
          break;
      }
      // Release the memory
      osal_msg_deallocate( (uint8 *)MSGpkt );
      // Next
      MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( GenericApp_TaskID );
    }
    // return unprocessed events
    return (events ^ SYS_EVENT_MSG);
  }
  return 0;
}

/*********************************************************************
 * LOCAL FUNCTIONS
 */
/*********************************************************************
 * @fn      GenericApp_MessageMSGCB
 *
 * @brief   Data message processor callback.  This function processes
 *          any incoming data - probably from other devices.  So, based
 *          on cluster ID, perform the intended action.
 *
 * @param   none
 *
 * @return  none
 */
  RFTX rftx;

void GenericApp_MessageMSGCB( afIncomingMSGPacket_t *pkt )
{
  switch ( pkt->clusterId )
  {
    case GENERICAPP_CLUSTERID:
    osal_memcpy(&rftx,pkt->cmd.Data,sizeof(rftx));
    //不使用rxCB时,放在这里,尽然只输出一行结果
 /* uint8 changeline[2]={0x0A,0x0D};
  HalUARTWrite(0,"Type: ",osal_strlen("Type:"));
  HalUARTWrite(0,rftx.type,3);
  HalUARTWrite(0,"  NWK:",osal_strlen("  NWK:")); //刚才用了sizeof("  NWK:")
  HalUARTWrite(0,rftx.myNWK,sizeof(rftx.myNWK));         刚才用了sizeof(rftx.myNWk),是不能正确显示的
  HalUARTWrite(0,"  pNWK:",osal_strlen("  pNWK:"));
  HalUARTWrite(0,rftx.pNWK,sizeof(rftx.pNWK));  
  HalUARTWrite(0,changeline,2);*/      
      break;
  }
}

static void rxCB(uint8 port,uint8 envent)
{
  uint8 changeline[2]={0x0A,0x0D};
  uint8 buf[8];
  HalUARTRead(0,buf,8);
  if(osal_memcmp(buf,"topology",8))
  {
  HalUARTWrite(0,"Type: ",osal_strlen("Type:"));
  HalUARTWrite(0,rftx.type,3);
  HalUARTWrite(0,"  NWK:",osal_strlen("  NWK:")); //刚才用了sizeof("  NWK:")
  HalUARTWrite(0,rftx.myNWK,sizeof(rftx.myNWK));         刚才用了sizeof(rftx.myNWk),是不能正确显示的
  HalUARTWrite(0,"  pNWK:",osal_strlen("  pNWK:"));
  HalUARTWrite(0,rftx.pNWK,sizeof(rftx.pNWK));
  HalUARTWrite(0,changeline,2); 
  }
}
路由器节点或终端节点(共用的Enddevice.c文件)

#include "OSAL.h"
#include "AF.h"
#include "ZDApp.h"
#include "ZDObject.h"
#include "ZDProfile.h"

#include "NewCoordinator.h"
//#include "GenericApp.h"
#include "DebugTrace.h"

#if !defined( WIN32 )
  #include "OnBoard.h"
#endif

/* HAL */
#include "hal_lcd.h"
#include "hal_led.h"
#include "hal_key.h"
#include "hal_uart.h"
#define SEND_DATA_EVENT 0x01
/*********************************************************************
 * MACROS
 */
/*********************************************************************
 * CONSTANTS
 */
/*********************************************************************
 * TYPEDEFS
 */
/*********************************************************************
 * GLOBAL VARIABLES
 */
// This list should be filled with Application specific Cluster IDs.
const cId_t GenericApp_ClusterList[GENERICAPP_MAX_CLUSTERS] =
{
  GENERICAPP_CLUSTERID
};

const SimpleDescriptionFormat_t GenericApp_SimpleDesc =
{
  GENERICAPP_ENDPOINT,              //  int Endpoint;
  GENERICAPP_PROFID,                //  uint16 AppProfId[2];
  GENERICAPP_DEVICEID,              //  uint16 AppDeviceId[2];
  GENERICAPP_DEVICE_VERSION,        //  int   AppDevVer:4;
  GENERICAPP_FLAGS,                 //  int   AppFlags:4;
  //下面是二选一
  0,
  (cId_t*)0,
  //GENERICAPP_MAX_CLUSTERS,          //  byte  AppNumInClusters;
 // (cId_t *)GenericApp_ClusterList,  //  byte *pAppInClusterList;
  GENERICAPP_MAX_CLUSTERS,          //  byte  AppNumInClusters;
  (cId_t *)GenericApp_ClusterList   //  byte *pAppInClusterList;
};

// This is the Endpoint/Interface description.  It is defined here, but
// filled-in in GenericApp_Init().  Another way to go would be to fill
// in the structure here and make it a "const" (in code space).  The
// way it's defined in this sample app it is define in RAM.
endPointDesc_t GenericApp_epDesc;
/*********************************************************************
 * EXTERNAL VARIABLES
 */
/*********************************************************************
 * EXTERNAL FUNCTIONS
 */

/*********************************************************************
 * LOCAL VARIABLES
 */
byte GenericApp_TaskID;   // Task ID for internal task/event processing
                          // This variable will be received when
                          // GenericApp_Init() is called.
devStates_t GenericApp_NwkState;

byte GenericApp_TransID;  // This is the unique message ID (counter)

//afAddrType_t GenericApp_DstAddr;  //???????????????

/*********************************************************************
 * LOCAL FUNCTIONS
 */
//void GenericApp_ProcessZDOMsgs( zdoIncomingMsg_t *inMsg );
//void GenericApp_HandleKeys( byte shift, byte keys );
void GenericApp_MessageMSGCB( afIncomingMSGPacket_t *pckt );
void GenericApp_SendTheMessage( void );

void To_string(uint8 *dest,char* src,uint8 length);//二进制书转化为十六进制数  
//static void rxCB(uint8 port,uint8 envent);

/*********************************************************************
 * NETWORK LAYER CALLBACKS
 */
/*********************************************************************
 * PUBLIC FUNCTIONS
 */
/*********************************************************************
 * @fn      GenericApp_Init
 *
 * @brief   Initialization function for the Generic App Task.
 *          This is called during initialization and should contain
 *          any application specific initialization (ie. hardware
 *          initialization/setup, table initialization, power up
 *          notificaiton ... ).
 *
 * @param   task_id - the ID assigned by OSAL.  This ID should be
 *                    used to send messages and set timers.
 *
 * @return  none
 */
void GenericApp_Init( byte task_id )
{
  GenericApp_TaskID = task_id;
  GenericApp_NwkState = DEV_INIT;
  GenericApp_TransID = 0;
  // Fill out the endpoint description.
  GenericApp_epDesc.endPoint = GENERICAPP_ENDPOINT;
  GenericApp_epDesc.task_id = &GenericApp_TaskID;
  GenericApp_epDesc.simpleDesc
            = (SimpleDescriptionFormat_t *)&GenericApp_SimpleDesc;
  GenericApp_epDesc.latencyReq = noLatencyReqs;
  // Register the endpoint description with the AF
  afRegister( &GenericApp_epDesc );  
  //串口的设置,并打开串口
  halUARTCfg_t uartConfig;
  uartConfig.configured =TRUE;
  uartConfig.baudRate   =HAL_UART_BR_115200;
  uartConfig.flowControl=FALSE;
  uartConfig.callBackFunc=NULL;//???????????????????????????????????
//  uartConfig.callBackFunc=rxCB;
  HalUARTOpen(0,&uartConfig);   //打开串口

  //这里就不用添加事件了!!!倒回去看什么时候要添加事件       ???????
  // Register for all key events - This app will handle all key events
  //RegisterForKeys( GenericApp_TaskID );
}


/*********************************************************************
 * @fn      GenericApp_ProcessEvent
 *
 * @brief   Generic Application Task event processor.  This function
 *          is called to process all events for the task.  Events
 *          include timers, messages and any other user defined events.
 *
 * @param   task_id  - The OSAL assigned task ID.
 * @param   events - events to process.  This is a bit map and can
 *                   contain more than one event.
 *
 * @return  none
 */
UINT16 GenericApp_ProcessEvent( byte task_id, UINT16 events )
{
  afIncomingMSGPacket_t *MSGpkt;
  if ( events & SYS_EVENT_MSG )
  {
    MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( GenericApp_TaskID );
    while ( MSGpkt )
    {
      switch ( MSGpkt->hdr.event )
      {        
        case ZDO_STATE_CHANGE:
          GenericApp_NwkState = (devStates_t)(MSGpkt->hdr.status);
          if ( (GenericApp_NwkState == DEV_ROUTER)
              || (GenericApp_NwkState == DEV_END_DEVICE) )
          {
            osal_set_event(GenericApp_TaskID,SEND_DATA_EVENT);
          }
          break;
        default:
          break;
      }
      // Release the memory
      osal_msg_deallocate( (uint8 *)MSGpkt );
      // Next
      MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( GenericApp_TaskID );
    }
    // return unprocessed events
    return (events ^ SYS_EVENT_MSG);
  }
   if ( events &  SEND_DATA_EVENT )
  {
    //这里添加获取自己和父节点的NWK地址
    HalLedBlink(HAL_LED_2,0,50,500);
    // Send "the" message
    GenericApp_SendTheMessage();  //AF发送
         osal_start_timerEx( GenericApp_TaskID,
                        SEND_DATA_EVENT,    //事件
                           GENERICAPP_SEND_MSG_TIMEOUT );//定时时间
    return (events ^ SEND_DATA_EVENT);
  }
  // Discard unknown events
  return 0;
}
/*********************************************************************
 * @fn      GenericApp_SendTheMessage
 *
 * @brief   Send "the" message.
 *
 * @param   none
 *
 * @return  none
 */
RFTX rftx;
void GenericApp_SendTheMessage( void )//AF发送
{
  uint16 nwk;
  if (GenericApp_NwkState == DEV_ROUTER)
        osal_memcpy(rftx.type,"ROU",3);
  else if(GenericApp_NwkState == DEV_END_DEVICE) 
        osal_memcpy(rftx.type,"DEV",3);
  nwk=NLME_GetShortAddr();
  To_string(rftx.myNWK,(uint8*)&nwk,2);
  nwk=NLME_GetCoordShortAddr();
  To_string(rftx.pNWK,(uint8*)&nwk,2);  
  //下面是串口输出,尽然不管用,不是没有配置串口和打开串口的原因。到底是哪里出了问题呢???
  uint8 changeline[2]={0x0A,0x0D};
  HalUARTWrite(0,"Type: ",osal_strlen("Type:"));
  HalUARTWrite(0,rftx.type,3);
  HalUARTWrite(0,"  NWK:",osal_strlen("  NWK:")); //刚才用了sizeof("  NWK:")
  HalUARTWrite(0,rftx.myNWK,sizeof(rftx.myNWK));         刚才用了sizeof(rftx.myNWk),是不能正确显示的
  HalUARTWrite(0,"  pNWK:",osal_strlen("  pNWK:"));
  HalUARTWrite(0,rftx.pNWK,sizeof(rftx.pNWK));
  HalUARTWrite(0,changeline,2);   
  afAddrType_t my_DstAddr;                       //
  my_DstAddr.addrMode=(afAddrMode_t)Addr16Bit;
  my_DstAddr.endPoint=GENERICAPP_ENDPOINT;
  my_DstAddr.addr.shortAddr=0x0000;
    if ( AF_DataRequest(&my_DstAddr, &GenericApp_epDesc,
                       GENERICAPP_CLUSTERID,
                     11,//  sizeof(rftx),
                        (uint8 *)&rftx,
                       &GenericApp_TransID,
                       AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )
  {
      HalLedBlink(HAL_LED_1,0,50,500);
  }
}

/*static void rxCB(uint8 port,uint8 envent)
{      
  uint8 changeline[2]={0x0A,0x0D};
  HalUARTWrite(0,"Type: ",osal_strlen("Type:"));
  HalUARTWrite(0,rftx.type,3);
  HalUARTWrite(0,"  NWK:",osal_strlen("  NWK:")); //刚才用了sizeof("  NWK:")
  HalUARTWrite(0,rftx.myNWK,sizeof(rftx.myNWK));         刚才用了sizeof(rftx.myNWk),是不能正确显示的
  HalUARTWrite(0,"  pNWK:",osal_strlen("  pNWK:"));
  HalUARTWrite(0,rftx.pNWK,sizeof(rftx.pNWK));
  HalUARTWrite(0,changeline,2); 
}*/

void To_string(uint8 *dest,char* src,uint8 length)//二进制书转化为十六进制数  
{  
  uint8* xad;  
  uint8 i=0;  
  uint8 ch;  
  xad=src+length-1;  
  for(i=0;i<length;i++,xad--)  
  {  
   ch=(*xad>>4)&0x0F;  //除以十六  
   dest[i<<1]=ch+((ch<10)?'0':'7');  
   ch=*xad&0x0F;  
   dest[(i<<1)+1]=ch+((ch<10)?'0':'7');  
  }  
}  
4、实验结果(只有两块板子,一个做协调器,另一个只能做路由节点或终端节点,所以看不到拓扑的结果)


5、注意:(因为下面一条语句,又花我一个下午,搞残了哥!!!)

 HalUARTWrite(0,"  NWK:",osal_strlen("  NWK:")); //osal_strlen("  NWK:")用了sizeof("  NWK:")






本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

1-14 实验11 获取网络拓扑 的相关文章

  • Electron-Vue之安装流程

    近期摒弃了熟悉的WPF xff0c 选用了新的一套工具 xff08 Electron Vue xff09 来开发桌面软件 xff08 我是连html都没用过的猿 xff0c no zuo no die xff09 接触新的东西 xff0c
  • vscode的调试配置

    文章目录 vscode的调试配置文件调试配置选项 vscode的调试配置文件 vscode的调试配置存储在 vscode文件夹的launch json文件中 通过以下步骤可以创建一个调试配置 xff1a 切换到调试视图单击create a
  • C/C++实现strcpy和strcat两个功能

    strcpy和strcat是string h头文件中分别实现字符串数组拷贝与拼接功能的函数 xff0c 详细使用相信大家都了解了 xff0c 如果还不了解看看实例 C C 43 43 笔试必须熟悉掌握的头文件系列 xff08 四 xff09
  • C/C++锁机制(boost)的认知和使用

    锁扩充 加锁的必需考虑三个问题 该锁的不锁 xff0c 将会导致各种莫名其妙的错误 xff1b 加锁范围太大 xff0c 虽然能避免逻辑错误 xff0c 但如果锁了不该锁的东西 xff0c 难免会降低程序的效率 xff1b 加锁方式不合适
  • QT之GPS

    http blog sina com cn s blog 7da13b510100xtgr html 前几天发现手里还闲着一块GPS 佳明的15W 也不知道是好的还是坏的呵呵一时兴起我就趁周六日没什么事情 用qt做了一个界面 现在已经调试完
  • 关于tcp/udp网络调试助手错误提示

    最近在学习网络调试助手与虚拟机中的Ubuntu系统通信 xff0c 在使用Ubuntu做服务器端时 xff0c tcp以及udp协议都遇到了问题 1 tcp协议遇到的问题是 xff1a 网络调试助手提示 xff1a 1035未知错误 xff
  • 结构体和结构体链表

    在c语言表针中有多种数据类型 xff0c 他们的应用使变量的应用变得灵活多变 而除了c语言默认的int xff0c float 等类型外 xff0c 我们还可以自己定义一些数据的类型 xff0c 结构体类型便是可以实现数据类型自定义的类型
  • 串口通信UART

    串口基本概念 串口通讯 Serial Communication 是指外设和计算机间 xff0c 通过数据信号线 地线等 xff0c 按位进行传输数据的一种通讯方式 其通讯协议可分层为协议层和物理层 物理层规定通信协议中具有机械 电子功能的
  • 一、Fmcw毫米波雷达原理

    0 概念 FMCW Frequency Modulated Continuous Wave xff0c 即调频连续波 FMCW技术和脉冲雷达技术是两种在高精度雷达测距中使用的技术 其基本原理为发射波为高频连续波 xff0c 其频率随时间按照
  • Makefile和CMake

    Makefile makefile主要规则 xff1a 伪对象 PHONY clean 规则1 main main o gcc main o o main 规则2 main o main c gcc c main c o main o 规则
  • C语言基础——结构体

    结构体的作用 在需要表示一些复杂信息时 xff0c 使用单纯的数据类型很不方便 比如 xff1a 学生信息 xff08 学号 xff0c 姓名 xff0c 班级 xff0c 电话 xff0c 年龄 xff09 xff1b GPIO信息 xf
  • Nginx 通过 header 中的标识进行分发

    Nginx可以根据请求头中自定义的标识将请求分发到不同的服务器 具体来说 xff0c 可以使用map指令将请求头中的自定义标识映射为不同的后端服务器地址 xff0c 然后使用proxy pass指令将请求转发到对应的后端服务器 以下是一个示
  • DB9接口详解---DB9引脚在 UART,CAN,RS485中的定义

    DB9的公母如下 xff1a 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61
  • 超强整理!PCB设计之电流与线宽的关系

    关于pcb线宽和电流的经验公式 xff0c 关系表和软件网上都很多 xff0c 本文把网上的整理了一下 xff0c 旨在给广大工程师在设计PCB板的时候提供方便 以下总结了八种电流与线宽的关系公式 xff0c 表和计算公式 xff0c 虽然
  • nginx 主动健康检查搭建详解(nginx_upstream_check_module)

    版本信息 nginx 1 21 1 下载nginx upstream check module模块 nginx upstream check module master zip wget https codeload github com
  • paddle推理部署(cpu)

    我没按照官方文档去做 xff0c 吐槽一下 xff0c 官方文档有点混乱 一 概述 总结起来 xff0c 就是用c 43 43 示例代码 xff0c 用一个模型做推理 二 示例代码下载 https www paddlepaddle org
  • Vector的用法

    我不知道大家是怎么理解Vector和怎样使用的 xff0c 这篇文章主要是发表我自己对于Vector的看法 xff0c 仅仅属于个人理解 xff0c 如果有什么错误 xff0c 也希望大家指正哈 目录 1 xff1a Vector的概念 2
  • float的表示

    xfeff xfeff 先说一下计算机中二进制的算法 xff1a 整数 整数的二进制算法大家应该很熟悉 xff0c 就是不断的除以2取余数 xff0c 然后将余数倒序排列 比如求9的二进制 xff1a 9 2 61 4 余 1 4 2 61
  • cmake系列(三)

    目录 多个源文件 同一目录 xff0c 多个源文件 多个源文件 同一目录 xff0c 多个源文件 本小节对应的源代码所在目录 xff1a Demo2 上面的例子只有单个源文件 现在假如把 power 函数单独写进一个名为 MathFunct

随机推荐

  • ORACLE 字符串聚合函数 strcat

    create or replace type strcat type as object currentstr varchar2 4000 currentseprator varchar2 8 static function ODCIAgg
  • 无人机器件选择参考

    无人机飞控 xff0c 引脚预留数量 1 xff0c 四路pwm 2 xff0c 无线通信spi 3 xff0c 陀螺仪通信用iic 4 xff0c 串口调试用uart 5 xff0c led灯用普通io 6 xff0c 电量检测和电机堵塞
  • 字节对齐的规则总结

    一 什么是字节对齐 为什么要对齐 现代计算机中内存空间都是按照byte划分的 xff0c 从理论上讲似乎对任何类型的变量的访问可以从任何地址开始 xff0c 但实际情况是在访问特定类型变量的时候经常在特定的内存地址访问 xff0c 这就需要
  • C++中第三方库的一般使用方式(libxl库为例)

    本篇介绍如何使用C C 43 43 的第三方库 xff0c 学会使用第三方库很重要 xff0c 尤其对于使用C C 43 43 语言的人来说 xff0c 标准库能做的事不能说太少 xff0c 恰当的说应该是没那么有趣 学会使用第三方库 xf
  • 三相电动机用单相电源

    三相电机改为单相运行 单相电机配用电容不是越大越好 三相电动机用单相电源 三相电机改为单相运行 介绍几种简便易行的方法 xff0c 可以不改动电机内部绕组而将三相电机改为单相运行 有6 种 xff1a 一 加电容法 xff39 形接法的三相
  • curl_init()和curl_multi_init()多线程的速度比较

    来源 http www webkaka com tutorial php 2013 102843 php中curl init 的作用很大 xff0c 尤其是在抓取网页内容或文件信息的时候 xff0c 例如之前文章curl获得header检测
  • 连接两字符串函数

    include lt stdio h gt include 34 string h 34 char Strcat char s1 char s2 printf 34 连接之后的字符串为 xff1a 34 for s1 61 39 0 39
  • CAN通信数据帧介绍

    CAN通信有五个帧 xff0c 其中最重要的是数据帧 xff01 xff01 xff01 xff01 我们下面开始讨论数据帧 一 数据帧的格式 xff08 数据帧有七个段组成 xff09 xff0c 帧起始 表示数据帧开始的段 xff0c
  • STM32压力传感器信号采集-24位AD HX720 HX711 原理介绍

    我做过很多工业用压力采集产品 xff0c 用过很多高分辨率的AD芯片 xff0c 其中有两款值得推荐 一个是海芯科技出的HX711等24位AD xff0c 一个是塞普拉斯出的CS5532等24位AD 国产芯片和进口芯片有差距 xff0c 但
  • stm32实现网络音频-原理图单片机程序C#上位机程序

    电子可以一边玩 xff0c 一边研究 xff0c 网络音频这个课题特别适合电子爱好者 几方面的挑战如下 xff0c 单片机实现对接以太网 实时对音频流解码播放 xff0c 上位机配合单片机做音频流传输控制 xff0c 音频信号的对接放大处理
  • rosdep init and update Error

    rosdep init Error sudo rosdep init ERROR default sources list file already exists br etc ros rosdep sources list d 20 de
  • Postman汉化版本竟如此简单,全中文真香

    对于国内程序员来说 xff0c 外国开发软件的一个使用门槛是全英文的 xff0c 对于不熟悉各种专业术语的同学 xff0c 上手比较麻烦 因此有种方法就是使用汉化版的外国软件 xff0c 但 Postman 并没有汉化版本 但是postma
  • YOLOv5识别目标的实时坐标打印

    引言 这个功能看似鸡肋 xff0c 但对于无人机目标识别与追踪有重要意义 xff0c 通过目标在摄像头视野的坐标位置 xff0c 可以推算出无人机相对与目标的位置 xff0c 从而对无人机进行位置矫正 因此 xff0c 添加代码打印坐标并不
  • 六、WebRTC中ICE的实现

    一 Candidate种类 amp 优先级 高到底 xff1a host srflx prflx relay 同一局域网内通过host类型的Candidate在内网建立连接 非同一局域网 xff0c 隔断从STUN TURN服务器中收集sr
  • 七、WebRTC中的SDP

    一 SDP标准规范 格式 xff1a lt type gt 61 lt value gt SDP 会话层 媒体层 媒体音频 媒体视频 二 WebRTC中的SDP的整体结构 1 媒体信息 m 61 行中描述媒体类型 传输类型 Playload
  • linux 信号量sem

    一 信号量 信号量如同一盏红绿信号灯 xff0c 用于临界资源 xff08 如公路 人行道 xff09 的管理 信号量是一种特殊的变量 xff0c 访问具有原子性 P等待 xff1a 信号量的值为0时 xff0c 不能减 xff0c 则进行
  • 1-4 实验3 串口通信

    串口通信 1 实验内容 xff1a PC端串口调试助手向板子发送数据 xff0c 板子接受到数据后 xff0c 再把数据发送回给PC端串口调试助手 2 串口发送接受数据的基本步骤 xff1a 初始化串口 xff08 设置波特率 中断等 xf
  • 1-6 实验5 无线温度检测实验

    无线温度检测实验 1 实验内容 xff1a 协调器建立ZigBee无线网络 xff0c 终端节点自动加入网络 xff0c 然后终端节点周期性地采集温度并将数据发送到协调器 协调器接受数据并通过串口把接受到的数据传给PC端的串口调试助手 2
  • 1-11 实验9 网络管理实验1 获取自身的和父节点网络地址、MAC地址

    p p p style color rgb 51 51 51 font family Arial font size 14px line height 26px 获取自身的和父节点网络地址 MAC地址 p p style color rgb
  • 1-14 实验11 获取网络拓扑

    获取网络拓扑 1 实验内容 xff1a PC端串口调试助手向协调器发送命名 topology 协调器接受到命令后 xff0c 将网络拓扑信息发送到PC机串口调试助手上 2 知识点 xff1a 在1 11 实验9 网络管理实验1 获取自身和父