我正在尝试修改 simple_Peripheral CC1350示例项目的特征3、以便只能通过读取来访问它、当它获得读取命令时、它将通过无线方式发送一个3、000字节的阵列。 simple_Peripheral 示例项目的文档是分散的、并不能最好地描述每个宏的功能。 当我尝试增加它发送的数据量时、发送22个字节是它在这里看起来最高的。
我希望避免编写每条数据中每条数据需要写入3、000 / 22字节= 136个特征。 感谢您的帮助、
以下是我的项目中决定这一点的价值观:
在 simple_gatt_profile.h 中、第57行是这样的:
#define SIMPLEPROFILE_CHAR3_LEN 3000
在 simple_gatt_profile.c 中、我从第157行开始:
// Simple Profile Characteristic 3 Properties static uint8 simpleProfileChar3Props = GATT_PROP_READ; // Characteristic 3 Value static uint8 simpleProfileChar3[SIMPLEPROFILE_CHAR3_LEN]; //static uint8 simpleProfileChar3 = 0; // Simple Profile Characteristic 3 User Description static uint8 simpleProfileChar3UserDesp[17] = "Characteristic 3";
在 simple_peripheral.c 中、我在第103行中有这个:
/*********************************************************************
* CONSTANTS
*/
// Advertising interval when device is discoverable (units of 625us, 160=100ms)
#define DEFAULT_ADVERTISING_INTERVAL 160
// Limited discoverable mode advertises for 30.72s, and then stops
// General discoverable mode advertises indefinitely
#define DEFAULT_DISCOVERABLE_MODE GAP_ADTYPE_FLAGS_GENERAL
#ifndef FEATURE_OAD
// Minimum connection interval (units of 1.25ms, 80=100ms) if automatic
// parameter update request is enabled
#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 80
// Maximum connection interval (units of 1.25ms, 800=1000ms) if automatic
// parameter update request is enabled
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 800
#else //!FEATURE_OAD
// Minimum connection interval (units of 1.25ms, 8=10ms) if automatic
// parameter update request is enabled
#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 8
// Maximum connection interval (units of 1.25ms, 8=10ms) if automatic
// parameter update request is enabled
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 8
#endif // FEATURE_OAD
// Slave latency to use if automatic parameter update request is enabled
#define DEFAULT_DESIRED_SLAVE_LATENCY 0
// Supervision timeout value (units of 10ms, 1000=10s) if automatic parameter
// update request is enabled
#define DEFAULT_DESIRED_CONN_TIMEOUT 6000
// Whether to enable automatic parameter update request when a connection is
// formed
#define DEFAULT_ENABLE_UPDATE_REQUEST GAPROLE_LINK_PARAM_UPDATE_INITIATE_BOTH_PARAMS
// Connection Pause Peripheral time value (in seconds)
#define DEFAULT_CONN_PAUSE_PERIPHERAL 45
// How often to perform periodic event (in msec)
#define SBP_PERIODIC_EVT_PERIOD 5000
// Type of Display to open
#if !defined(Display_DISABLE_ALL)
#ifdef USE_CORE_SDK
#if defined(BOARD_DISPLAY_USE_LCD) && (BOARD_DISPLAY_USE_LCD!=0)
#define SBP_DISPLAY_TYPE Display_Type_LCD
#elif defined (BOARD_DISPLAY_USE_UART) && (BOARD_DISPLAY_USE_UART!=0)
#define SBP_DISPLAY_TYPE Display_Type_UART
#else // !BOARD_DISPLAY_USE_LCD && !BOARD_DISPLAY_USE_UART
#define SBP_DISPLAY_TYPE 0 // Option not supported
#endif // BOARD_DISPLAY_USE_LCD && BOARD_DISPLAY_USE_UART
#else // !USE_CORE_SDK
#if !defined(BOARD_DISPLAY_EXCLUDE_LCD)
#define SBP_DISPLAY_TYPE Display_Type_LCD
#elif !defined (BOARD_DISPLAY_EXCLUDE_UART)
#define SBP_DISPLAY_TYPE Display_Type_UART
#else // BOARD_DISPLAY_EXCLUDE_LCD && BOARD_DISPLAY_EXCLUDE_UART
#define SBP_DISPLAY_TYPE 0 // Option not supported
#endif // !BOARD_DISPLAY_EXCLUDE_LCD || !BOARD_DISPLAY_EXCLUDE_UART
#endif // USE_CORE_SDK
#else // BOARD_DISPLAY_USE_LCD && BOARD_DISPLAY_USE_UART
#define SBP_DISPLAY_TYPE 0 // No Display
#endif // Display_DISABLE_ALL
#ifdef FEATURE_OAD
// The size of an OAD packet.
#define OAD_PACKET_SIZE ((OAD_BLOCK_SIZE) + 2)
#endif // FEATURE_OAD
// Task configuration
#define SBP_TASK_PRIORITY 1
#ifndef SBP_TASK_STACK_SIZE
#define SBP_TASK_STACK_SIZE 644
#endif
// Internal Events for RTOS application
#define SBP_STATE_CHANGE_EVT 0x0001
#define SBP_CHAR_CHANGE_EVT 0x0002
#define SBP_PERIODIC_EVT 0x0004
#define SBP_CONN_EVT_END_EVT 0x0008