你好,
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应用程序可以找到我的设备并连接它。我将设备配置为具有ATT_MAX_VALUE的MTU的从设备(ATT_DEFAULT_MTU + 1 = 24字节)。
看看上面的源代码。
msg->operation = GAPM_SET_DEV_CONFIG;
msg->角色= gap_peripheral_slv;//设备角色
memset( msg->irk.key, 0, sizeof(struct gap_sec_key));
msg->appearance = 832;
msg-> sepose_write_perm = gapm_write_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;
在连接512字节的MTU之后可以读取iOS设备,但它本身只能发送20个字节的默认大小。
在与iOS应用程序连接之后,我从应用程序获取连接请求,我向应用程序发送确认。确认后,我也发送gatt_exc_mtu_req命令。
看看上面的源代码。
void gattc_exc_mtu_cmd(void)
{
struct gattc_exc_mtu_cmd *msg = BT_BleMsgAlloc(GATTC_EXC_MTU_CMD,
TASK_GATTC, TASK_GTL,sizeof(struct gattc_exc_mtu_cmd));
msg-> req_type = gattc_mtu_exch;
bt_blesendmsg(msg);
}
在你的论坛的这个链接中,有类似的问题,我试过这个问题。
http://support.dialog-semiconductor.com/when-i-enable-notification-chara...
但它不起作用。
在Apple BluetoothDesignGuidelines 3.10和蓝牙核心规范V4.0中描述了MTU交换。
是我的gatt_exc_mtu_req命令正确的源和目标ID吗?
您是否有一个IOS设备交换MTU大小的示例?例如DSPS应用程序?
你有想法我做错了什么吗?
谢谢你。
关于Eckart.
Hi ehanl,
您可以检查嗅探器以验证传输命令是否?使用iOS设备交换MTU没有任何特定命令。您是否尝试使用集成的设计或完整的托管实现。
Thanks MT_dialog
你好,
我有一个通过UART的EFM微控制器控制Pan1740。我用智能片段将Pan1740的OTP闪烁了Pan1740的OTP。像Slave和Advertise命令一样如Confim的每一件事都看起来很好。
我没有蓝牙嗅探器。如果我的命令发送到PAN1740,我可以使用数字分析仪查找。是否有可能使用Connection Manager和Pan1740 Development Dongle查看该命令是否已发送给此命令?
Is my exchange MTU command the right one especially the source and destination id?
谢谢
问候
Eckart
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
Hi MT_dialog,
感谢您的快速帮助。
Yes, please send me the the source code to my e-mail address.
也许我可以找到一些解决问题的提示。
问候
ehanl
嗨mt_dialog,
thank you for your help.
我还有问题,但原因也许是另一个。
在我的应用程序中,我将来自客户端(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
。
Hi ehanl,
当您执行MTU Exchange时,两个设备必须在MTU中同意它们必须使用的,主机可以接受请求或拒绝并继续使用通信中涉及的两个设备的最小MTU。通知值受到在两个设备之间布置的当前MTU的限制。当您发送写入请求时,您发送的所有数据如何转到服务器,而无论您的MTU大小。
Thanks MT_dialog
Hi MT_dialog,
我找到了解决方案。我使用#define mtu_max_value(mtu_default_value + 1)初始化我的config命令,其中24 -3字节标题= 21字节。我的iOS应用程序收到了这21个字节。我在数据表中读取,MTU大小延迟超过23字节将MTU大小自动设置为512字节。但那是不对的。所以我将MTU大小设置为140字节,我的应用程序收到140个字节。现在,这部分有效,我获得了140字节的流数据。
但我只能在短时间内漫步而不是我的奴隶与efm和pan1740挂起。我始终使用gatt_set_value_req将我的140字节数据加载到我的属性。在此之后,我等待Ready事件gatt_set_value_rsp,然后我发送gattc_send_evt_cmd并等待gattc_cmp_evt。如果这是好的,我开始新。但经过几次我没有得到gatt_set_value_rsp,或者我得到了不完整。什么关于流量控制?我使用Fullud_emb.bin固件从Connection Manager for Pan1740,但我不知道是否支持硬件流控制,并且RTS和CTS使用哪种GPIO引脚?我认为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
如果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.
要将其设置为4000字节,请在da14580_config中添加此内容:
#define MSG_HEAP_SZ 4000
你好,
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
Hi ehanl,
如果您使用的任何Proximity_ext实现作为基本项目,则可以使用Prox_Monitor_ext_USB或Prox_Reporter_ext_usb。但是你是什么意思,当你设置价值时,响应是不完整的?
Thanks 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?
在periph_setup.h文件中我找到了这个定义。
#define UART1_TX_GPIO_PORT GPIO_PORT_0
#define uart1_tx_gpio_pin gpio_pin_4.
#define uart1_rx_gpio_port gpio_port_0.
#define uart1_rx_gpio_pin gpio_pin_5.
#ifndef CFG_ROM
#define UART_BAUDRATE UART_BAUDRATE_115K2
#else //CFG_ROM
#define uart_baudrate uart_baudrate_460k8
#endif // cfg_rom.
所以我认为这是相同的配置。
什么问题?
问候
ehanl
Hi ehanl,
是的,您可以使用连接管理器使用它们来测试它们。请按照App Note UM-B-010接近集成和外部处理器的接近示例。您必须加载固件,然后运行监视器或记者的Windows应用程序。另外请尝试从Windows运行Connection Manager作为管理员。由于OTP写入,您无法通过覆盖它,但您可以尝试通过按RESET按钮将应用程序下载到SYSRAM(在重置后使用KEIL和Program)。您的意思是full_emb.bin位于Connection Manager中,源代码类似于Proximity Reporter(Prox_Reporter_ext)。据称部分接收或响应,您认为UART中的错误或问题?
Thanks MT_dialog
嗨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遇到问题。也许。但我不知道在哪里。
你有一个新想法吗?
问候
ehanl
嗨,enhal,
你可以用分析仪检查你的UART看看是否出错了?尝试使用keil运行proximity_reporter_ext.proj并捕获从主机的命令触发的处理程序可能会帮助您找到解决问题的解决方案。
Thanks MT_dialog
嗨mt_dialog,
好消息我在使用数字分析仪后发现了问题,我发现Pan1740的所有事件都接收到我的UART RX引脚。但我的缓冲区检查每个命令中的消息ID不是字节字节的字节。我只比较这条字节的这个消息ID,并且当我的UART RX中断时第一次出现LSB字节和下一个中断消息ID的MSB,它是拆分,我没有找到ID。现在,我检查字节的行为缓冲区字节,它有效。
感谢您的帮助。
问候
ehanl
Hi ehanl,
Glad you found it and thanks for indicating.
最好的问候mt_dialog.