This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2541和蓝牙模块连接上了,可是发送数据蓝牙模块收不到

Other Parts Discussed in Thread: CC2541

我用CC2541和蓝牙模块DS-BT19-S蓝牙模块通信。

现在已经连接上了,可是CC2541发送数据,蓝牙模块收不到。

用手机LIGHTBLUE发送数据,蓝牙模块可以收到。

部分代码:

// smartRF开发板上的 S1 对应我们源码上的HAL_KEY_SW_6
// 这里设置成发送数据功能了
if ( keys & HAL_KEY_SW_3 )
{
char str[32] = {0};

sprintf(str, "Sent CHAR to PHER.");
//HalLcdWriteString(str, HAL_LCD_LINE_5 );

simpleBLEScanIdx = 0;
p1=str1;
// 启动定时器发送数据
osal_start_timerEx( simpleBLETaskId, SBP_PERIODIC_EVT, SBP_PERIODIC_EVT_PERIOD );// 关键

//LCD_WRITE_STRING("Key DOWN = Read RSSI", HAL_LCD_LINE_8);
}

if(index == 0)
{
// 往从机写入char1的值, 注意char1 是一个字节长度的


//OneConnetedDevice_WriteCharX(simpleBLEScanIdx, BLE_CHAR1, (uint8*)str, osal_strlen(str));
OneConnetedDevice_WriteCharX(simpleBLEScanIdx, BLE_CHAR1, p1, 1);
p1++;
if(*p1==0x55)
p1=str1;
HalLedBlink (HAL_LED_1, 1, 50, 100);//这个的意思是, 100ms内,以50%的占空比闪烁1次, 实际就是点亮50ms
}

请问高手,如何解决?谢谢!