17个职位/0个新职位
最后一篇文章
ehanl
离线
Last seen:4个月2周前
已加入:2015-02-23 14:16
Changing MTU

你好,

I have a problem to exchange the MTU size when connected with a iOS device. We have developed a iOS app to connect with our device.
iOS应用程序可以找到我的设备并连接它。我将我的设备配置为MTU为ATT\ U MAX\ U值(ATT\ U DEFAULT\ U MTU+1=24字节)的从设备。
请看我上面的源代码。

msg->operation = GAPM_SET_DEV_CONFIG;
msg->role=GAP\u PERIPHERAL\u SLV;//设备角色
memset( msg->irk.key, 0, sizeof(struct gap_sec_key));
msg->appearance = 832;
msg->appearance\u write\u perm=GAPM\u write\u DISABLE;
msg->name_write_perm = GAPM_WRITE_DISABLE;
msg->max_mtu = ATT_MAX_VALUE;
msg->con_intv_min = 0;
msg->con_intv_max = 0;
msg->con_latency = 0;
msg->superv_to = 10000;
msg->flags = 0;

iOS设备可以在连接后读取512字节的MTU,但它本身只能发送默认大小的20字节。
After connection with the iOS app I get an connection request from the app and I send a confirm to the app. After the confirm I send also the GATT_EXC_MTU_REQ command.
请看我上面的源代码。

void gattc\u exc\u mtu\u命令(void)
{
struct gattc_exc_mtu_cmd *msg = BT_BleMsgAlloc(GATTC_EXC_MTU_CMD,
TASK_GATTC, TASK_GTL,sizeof(struct gattc_exc_mtu_cmd));

消息->请求类型=GATTC\u MTU\u EXCH;

BT_BleSendMsg(msg);
}
In this link of the your forum there is descriped a similar problem and I had tried this.
http://support.dialog-semiconductor.com/when-i-enable-notification-chara...
But it doesn't work.

在Apple BluetoothDesignGuidelines 3.10和bluetooth core specification V4.0中,描述了MTU交换是可能的。

我的GATT\u EXC\u MTU\u REQ命令是源和目标id的正确命令吗?
Have you a example of exchange of the MTU size for iOS device? For example the DSPS app?
Do you have a idea what I'm doing wrong?

非常感谢。

向埃卡问好

Device:
MT_dialog
离线
Last seen:1个月3周前
工作人员
已加入:2015-06-08 11:34
Hi ehanl,

Hi ehanl,

你能用嗅探器检查一下命令是否被传送了吗?对于带iOS设备的exchange MTU,没有任何特定命令。您是在尝试集成的设计还是完全托管的实现。

Thanks MT_dialog

ehanl
离线
Last seen:4个月2周前
已加入:2015-02-23 14:16
你好,

你好,

I have an PAN1740 controlling with a EFM microcontroller over UART. I have flashed the OTP of the PAN1740 with the full_emb.bin file with smart snippets. Every thing like config as slave and advertise command are looking fine.
我没有蓝牙嗅探器。如果我的命令是通过UART发送到PAN1740,我可以用数字分析仪查看。有没有可能使用连接管理器和PAN1740开发软件狗来检查命令是否正确发送到这个位置?
Is my exchange MTU command the right one especially the source and destination id?
谢谢你

当做
Eckart

MT_dialog
离线
Last seen:1个月3周前
工作人员
已加入:2015-06-08 11:34
Hi ehanl,

Hi ehanl,

The command you send is correct, i had a look with a sniffer and seems that the command is sent correctly. The command manager doens't support the exchange MTU feature, it uses only the default MTU. I can send you the DSPS source code for iOS if you think that this will help you defining your problem.

Thanks MT_dialog

ehanl
离线
Last seen:4个月2周前
已加入:2015-02-23 14:16
Hi MT_dialog,

Hi MT_dialog,

thank your for your fast help.
Yes, please send me the the source code to my e-mail address.
也许我能找到一些解决问题的方法。

当做
ehanl

ehanl
离线
Last seen:4个月2周前
已加入:2015-02-23 14:16
Hi MT_Dialog,

Hi MT_Dialog,

thank you for your help.
I have still the problem but the reason is perhaps a other one.
在我的应用程序中,我从客户端(iOS应用程序)向服务器(PAN1740)发送一个命令,然后开始流式传输数据。
This means that the server begins to send continuously data to the client by using notification. I set the attribute value and afterwards I use the GATTC_SEND_EVT_COMMAND to send the streaming data to the client. The streaming data are always circa 100 byte but the client only recieves 21 byte.
但是当我从客户机向服务器发送一个写请求,服务器发送一个写确认时,客户机得到100字节。
Also I send MTU exchange command after I get a connection request from the client and before I send connection confirm.
Is notification value limited?
If the client gets the 100 byte when write confirm is send the MTU size must be more than default? Otherwise the client can't get this data size?
你知道怎么了吗。
In this Forum I have read several problems like my problem but no solution found.
非常感谢。

当做
ehanl

.

MT_dialog
离线
Last seen:1个月3周前
工作人员
已加入:2015-06-08 11:34
Hi ehanl,

Hi ehanl,

When you perform an MTU exchange both of the devices have to agree in the MTU they have to use, the host can either accept the request or reject it and continue using the minimum MTU of the two devices involved in the communication. The notification value is limited by the current MTU that has been arranged between the two devices. When you send a write request all the data that you send will go to the server regardless your MTU size.

Thanks MT_dialog

ehanl
离线
Last seen:4个月2周前
已加入:2015-02-23 14:16
Hi MT_dialog,

Hi MT_dialog,

我找到了解决办法。我用#define MTU_MAX_VALUE(MTU_DEFAULT_VALUE+1)初始化config命令,即24-3 byte header=21 byte。我的iOS应用程序正好收到了这个21字节。我在数据表中看到,大于23字节的MTU大小会自动将MTU大小设置为512字节。但这是不对的。所以我将MTU大小设置为140字节,我的应用程序接收到140字节。现在这部分工作了,我得到了140字节的流数据。
但我只能流比我的奴隶与EFM和PAN1740挂起短的时间。我总是使用gatt\u set\u value\u req将140字节的数据加载到属性中。在此之后,我等待就绪事件gatt\u set\u value\u rsp,然后发送gattc\u send\u evt\u cmd并等待gattc\u cmp\u evt。如果这是好的,我开始新的。但是过了好几次,我没有得到gatt\u set\u value\u rsp或者我得到的是不完整的。流量控制怎么样?我用完整的_emb.bin文件来自PAN1740连接管理器的固件,但我不知道是否支持硬件流控制,以及哪些GPIO引脚用于RTS和CTS?我认为PAN1740有一个溢出,无法发送数据。
Can you help me to solve the problem?
I have tried different things for example send more slowly but every tIme my application hangs.
Do you have a hint for me?
非常感谢。

当做
ehanl

Joacimwe
离线
Last seen:1 year 5 months ago
Guru
已加入:2014-01-14 06:45
如果DA14580由于

如果DA14580由于memory allocation failure, you can try to increase the message heap. Since you always wait for gattc_cmp_evt you have implemented flow control.
To set it to 4000 bytes, add this in da14580_config.h:
#define MSG_HEAP_SZ 4000

ehanl
离线
Last seen:4个月2周前
已加入:2015-02-23 14:16
你好,

你好,

but I have program the OTP of the PAN1740 with the full_emb.bin file with smart snippets and when I understand you right I have to update the heap size and must compile the bin file new. But I have no source code of the full_emb.bin. Or is there a other way to do this?
是否也有办法更新PAN1740的OTP?

当做
ehanl

MT_dialog
离线
Last seen:1个月3周前
工作人员
已加入:2015-06-08 11:34
Hi ehanl,

Hi ehanl,

如果您正在使用任何proximity_ext implementations as your basic project you can use the prox_monitor_ext_usb or the prox_reporter_ext_usb. But what do you mean that the response is incomplete when you set the value?

Thanks MT_dialog

ehanl
离线
Last seen:4个月2周前
已加入:2015-02-23 14:16
Hi MT_dialog,

Hi MT_dialog,

can I use both of this projects you told me with connection manager to test it? I tried to flash with the prox_monitor_ext_usb.hex file and I tried to boot as central or peripheral but it doesn't work. Every time I only get a reset command and no full functionality. Can I overwrite or update the OTP? Or must I take a new PAN1740? Where can I get the source code of the full_emb.bin? Because my application is running very well with this file.
Sometimes there is no command or only a part recieved for example I get msg_id, srcid, destid and than nothing.
I also tried to send only 20 byte packages but my application hangs too.

更新:
I have program the OTP of a new PAN1740 with the prox_monitor_ext_usb.bin file and a MSG_HEAP_SIZE of 4000 but I also get no answer of my gapm_reset_cmd command like in connection manager too. The UART TX , RX pins and the baud rate are the same like in the full_emb.bin file?
In the periph_setup.h file I found the defines for this.
#define UART1_TX_GPIO_PORT GPIO_PORT_0
#定义UART1\U TX\U GPIO\U引脚GPIO\U引脚4

#定义UART1\U RX\U GPIO\U端口GPIO\U端口0
#define UART1_RX_GPIO_PIN GPIO_PIN_5

#ifndef CFG_ROM
#define UART_BAUDRATE UART_BAUDRATE_115K2
#else //CFG_ROM
#定义UART\U波特率UART\U波特率\U 460K8
#endif//CFG\u只读存储器

所以我认为这是相同的配置。
出什么事了?

当做
ehanl

MT_dialog
离线
Last seen:1个月3周前
工作人员
已加入:2015-06-08 11:34
Hi ehanl,

Hi ehanl,

是的,您可以将它们与连接管理器一起使用来测试它们。请遵循集成和外部处理器中的应用说明UM-B-010接近示例。您必须加载固件,然后运行monitor或reporter的windows应用程序。另外,请尝试以管理员身份从windows运行连接管理器。因为OTP是写的,所以你不能覆盖它,但是你可以试着通过按下重置按钮(重置后使用keil和program)将应用下载到系统内存中。你是说全套_emb.bin文件源代码位于连接管理器中,类似于邻近报告器(prox\u reporter\u ext)。就部分接收到命令或响应而言,您是否认为UART存在故障或问题?

Thanks MT_dialog

ehanl
离线
Last seen:4个月2周前
已加入:2015-02-23 14:16
Hi MT_Dialog,

Hi MT_Dialog,

现在我有一个与proximity_rep运行的系统orter_ext bin file. I can boot as peripheral and connect my application with the iOS app light blue. I also set the heap size for message to 4000 but when I start streaming my device hangs after several times too. I also have the problem to debug my application with keil. In debug mode bluetooth doesn`t work with this bin file because in my uart receive buffer I sometimes get no answer for my commands. This makes it more difficult to develop and test my application. With the full_emb.bin file I have no problems to debug. I don't know what's the problem.
我不知道我的uart是否有问题。也许 吧。但我不知道在哪里。
Do you have a new idea?

当做
ehanl

MT_dialog
离线
Last seen:1个月3周前
工作人员
已加入:2015-06-08 11:34
Hi enhal,

Hi enhal,

你能用分析仪检查一下你的UART,看看是否出了问题吗?试着运行你的报告_外部项目使用keil并捕获来自主机的命令触发的处理程序,这可能会帮助您找到问题的解决方案。

Thanks MT_dialog

ehanl
离线
Last seen:4个月2周前
已加入:2015-02-23 14:16
Hi MT_Dialog,

Hi MT_Dialog,

好消息,在使用数字分析仪之后,我发现所有来自PAN1740的事件都在我的UART RX引脚接收到。但我对每个命令中消息id的缓冲区检查并不是逐字节的。我只比较了这个消息id的两个字节,当我的UART RX中断第一次出现LSB字节和下一个中断出现消息id的MSB时,它被拆分了,我没有找到id。现在我逐个字节检查输入缓冲区,它就工作了。
谢谢你的帮助。

当做
ehanl

MT_dialog
离线
Last seen:1个月3周前
工作人员
已加入:2015-06-08 11:34
Hi ehanl,

Hi ehanl,

Glad you found it and thanks for indicating.

Best Regards MT_dialog