微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI蓝牙设计交流 > 修改SimpleBLECentral作为主机连接sensortag作为从机

修改SimpleBLECentral作为主机连接sensortag作为从机

时间:10-02 整理:3721RD 点击:
static void simpleBLECentralEventCB( gapCentralRoleEvent_t *pEvent )
{
  switch ( pEvent->gap.opcode )
  {
    case GAP_DEVICE_INIT_DONE_EVENT:  
      {
        LCD_WRITE_STRING( "BLE Central", HAL_LCD_LINE_1 );
        LCD_WRITE_STRING( bdAddr2Str( pEvent->initDone.devAddr ),  HAL_LCD_LINE_2 );
      }
      break;

    case GAP_DEVICE_INFO_EVENT:
      {
        // if filtering device discovery results based on service UUID
        if ( DEFAULT_DEV_DISC_BY_SVC_UUID == TRUE )
        {
//          if ( simpleBLEFindSvcUuid( SIMPLEPROFILE_SERV_UUID,
//                                     pEvent->deviceInfo.pEvtData,
//                                     pEvent->deviceInfo.dataLen ) )
//          {
            simpleBLEAddDeviceInfo( pEvent->deviceInfo.addr, pEvent->deviceInfo.addrType );
 //         }
        }
      }
   ......

上面代码注释部分取消的话:主机串口打印扫描设备数为0  。但是注释上的话能连接上sensortag,并且打印设备地址和RSSI

主机的Profile:

// Simple Profile Service UUID
#define SIMPLEPROFILE_SERV_UUID             0x180A     //0xAA10
上面我把0xAA10改成了0x180A
 
从机sensortag的:
// Device Information Service UUIDs
#define DEVINFO_SERV_UUID                 0x180A    // Service UUID
#define DEVINFO_SYSTEM_ID_UUID            0x2A23    // System ID
#define DEVINFO_MODEL_NUMBER_UUID         0x2A24    // Model Number String
#define DEVINFO_SERIAL_NUMBER_UUID        0x2A25    // Serial Number String
#define DEVINFO_FIRMWARE_REV_UUID         0x2A26    // Firmware Revision String
#define DEVINFO_HARDWARE_REV_UUID         0x2A27    // Hardware Revision String
#define DEVINFO_SOFTWARE_REV_UUID         0x2A28    // Software Revision String
#define DEVINFO_MANUFACTURER_NAME_UUID    0x2A29    // Manufacturer Name String
#define DEVINFO_11073_CERT_DATA_UUID      0x2A2A    // IEEE 11073-20601 Regulatory Certification Data List
#define DEVINFO_PNP_ID_UUID               0x2A50    // PnP ID


请问为什么?

 

请到蓝牙技术版面去询问。

shmily,

请问这个问题怎样解决的?

请问 

// Device Information Service UUIDs

#define DEVINFO_SERV_UUID                 0x180A    // Service UUID

#define DEVINFO_SYSTEM_ID_UUID            0x2A23    // System ID

#define DEVINFO_MODEL_NUMBER_UUID         0x2A24    // Model Number String

#define DEVINFO_SERIAL_NUMBER_UUID        0x2A25    // Serial Number String

#define DEVINFO_FIRMWARE_REV_UUID         0x2A26    // Firmware Revision String

#define DEVINFO_HARDWARE_REV_UUID         0x2A27    // Hardware Revision String

#define DEVINFO_SOFTWARE_REV_UUID         0x2A28    // Software Revision String

#define DEVINFO_MANUFACTURER_NAME_UUID    0x2A29    // Manufacturer Name String

#define DEVINFO_11073_CERT_DATA_UUID      0x2A2A    // IEEE 11073-20601 Regulatory Certification Data List

#define DEVINFO_PNP_ID_UUID               0x2A50    // PnP ID

这些是在sensortag中哪个地方找到的

592944557 加我Q

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top