TI中文支持网
TI专业的中文技术问题搜集分享网站

CC2640R2F Peripheral 和 Broadcaster 两种模式的 GAP Role Parameters 问题

Hi 大神们,请教个问题。

MCU 是 CC2640R2F;

SDK 包是 simplelink_cc2640r2_sdk_4_20_00_04;

对于 simple_peripheral 和 simple_broadcaster 这两个,他们的 advertData[] 这个数组成员不一样,请问为什么成员会不一样?

如果我想把 simple_peripheral  的也改成 simple_broadcaster ,该怎样修改。

simple_peripheral 的 advertData[] 

// Advertisement data (max size = 31 bytes, though this is
// best kept short to conserve power while advertising)
static uint8_t advertData[] =
{
// Flags: this field sets the device to use general discoverable
// mode (advertises indefinitely) instead of general
// discoverable mode (advertise for 30 seconds at a time)
0x02, // length of this data
GAP_ADTYPE_FLAGS,
DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,

// service UUID, to notify central devices what services are included
// in this peripheral
0x03, // length of this data
GAP_ADTYPE_16BIT_MORE, // some of the UUID's, but not all
LO_UINT16(SIMPLEPROFILE_SERV_UUID),
HI_UINT16(SIMPLEPROFILE_SERV_UUID)
};

simple_broadcaster 的 advertData[] 
// GAP – Advertisement data (max size = 31 bytes, though this is
// best kept short to conserve power while advertisting)
static uint8 advertData[] =
{
// Flags; this sets the device to use limited discoverable
// mode (advertises for 30 seconds at a time) instead of general
// discoverable mode (advertises indefinitely)
0x02, // length of this data
GAP_ADTYPE_FLAGS,
GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,

#ifndef BEACON_FEATURE

// three-byte broadcast of the data "1 2 3"
0x04, // length of this data including the data type byte
GAP_ADTYPE_MANUFACTURER_SPECIFIC, // manufacturer specific adv data type
1,
2,
3

#else

// 25 byte beacon advertisement data
// Preamble: Company ID – 0x000D for TI, refer to www.bluetooth.org/…/company-identifiers
// Data type: Beacon (0x02)
// Data length: 0x15
// UUID: 00000000-0000-0000-0000-000000000000 (null beacon)
// Major: 1 (0x0001)
// Minor: 1 (0x0001)
// Measured Power: -59 (0xc5)
0x1A, // length of this data including the data type byte
GAP_ADTYPE_MANUFACTURER_SPECIFIC, // manufacturer specific adv data type
0x0D, // Company ID – Fixed
0x00, // Company ID – Fixed
0x02, // Data Type – Fixed
0x15, // Data Length – Fixed
0x00, // UUID – Variable based on different use cases/applications
0x00, // UUID
0x00, // UUID
0x00, // UUID
0x00, // UUID
0x00, // UUID
0x00, // UUID
0x00, // UUID
0x00, // UUID
0x00, // UUID
0x00, // UUID
0x00, // UUID
0x00, // UUID
0x00, // UUID
0x00, // UUID
0x00, // UUID
0x00, // Major
0x01, // Major
0x00, // Minor
0x01, // Minor
0xc5 // Power – The 2's complement of the calibrated Tx Power

#endif // !BEACON_FEATURE
};

user6198971:

回复 Viki Shi:

Hi Viki,谢谢了,我先研究下,非常感谢~~

user6198971:

回复 Viki Shi:

Hi Viki:
那我可不可以直接把simple_broadcaster 的数据拿到 simple_peripheral里用?

谢谢

user6198971:

回复 Viki Shi:

Hi Viki:
那我可不可以直接把simple_broadcaster 的数据拿到 simple_peripheral里用?

谢谢

Tseng Bill:

回复 Viki Shi:

Dear Viki Shi

Where could I download the related documents of the Advertising Content Structure?
Would you please provide me related documents?

Viki Shi:

回复 user6198971:

那我可不可以直接把 simple_broadcaster 的数据拿到 simple_peripheral 里用?—–可以

Viki Shi:

回复 Tseng Bill:

这个图我也是网上找的,详细的内容可以去看BLE spec

Tseng Bill:

回复 Viki Shi:

OK, Thanks.

user6198971:

回复 Viki Shi:

Hi Viki,问题已解决,谢谢~

Viki Shi:

回复 user6198971:

解决就好,不客气

赞(0)
未经允许不得转载:TI中文支持网 » CC2640R2F Peripheral 和 Broadcaster 两种模式的 GAP Role Parameters 问题
分享到: 更多 (0)