使用chat例程,手机向蓝牙模块发也可以
想实现同一个char实现收发,你把这两个char里相当的代码弄到一起试试
/*
Osal_MemCpy(&char_uuid.Char_UUID_128, charUuidTX, 16);
ret = aci_gatt_add_char(chatServHandle, UUID_TYPE_128, &char_uuid, 20, CHAR_PROP_NOTIFY|CHAR_PROP_READ|CHAR_PROP_WRITE, ATTR_PERMISSION_NONE, 0,
16, 1, &TXCharHandle);
if (ret != BLE_STATUS_SUCCESS) goto fail;
*/
Osal_MemCpy(&char_uuid.Char_UUID_128, charUuidRX, 16);
ret = aci_gatt_add_char(chatServHandle, UUID_TYPE_128, &char_uuid, 20, CHAR_PROP_NOTIFY|CHAR_PROP_READ|CHAR_PROP_WRITE, ATTR_PERMISSION_NONE, GATT_NOTIFY_ATTRIBUTE_WRITE,
16, 1, &RXCharHandle);
if (ret != BLE_STATUS_SUCCESS) goto fail;