Hi,
使用iOS设备连接时,我有问题要交换MTU大小。我们开发了一个IOS应用程序与我们的设备连接。
The iOS app can find my device and connect it. I configure my device as a slave with a MTU of ATT_MAX_VALUE (ATT_DEFAULT_MTU+1 = 24 byte).
Look at my source code above.
msg->操作= gapm_set_dev_config;
msg->role = GAP_PERIPHERAL_SLV; // Device Role
memset(msg-> irk.key,0,sizeof(struct gap_sec_key));
MSG->外观= 832;
msg->appearance_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->标志= 0;
The iOS device can read after connection the MTU of 512 byte but itself it can only send the default size of 20 byte.
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.
Look at my source code above.
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);
}
In this link of the your forum there is descriped a similar problem and I had tried this.
http://support.dialog-semicondiondiondum/when-i-enable-notification-chara ...
But it doesn't work.
In Apple BluetoothDesignGuidelines 3.10 and the bluetooth core specification V4.0 it´s described that a MTU exchange is possible.
Is my GATT_EXC_MTU_REQ command the right one with source and destination 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?
Thank you.
Regards Eckart
嗨Ehanl,
Can you check with a sniffer to verify that the command is transmited ? There isn't any specific command for exchange MTU with a iOS device. Are you trying with an integrated design or with a full hosted implementation.
谢谢mt_dialog.
Hi,
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.
I don't have a bluetooth sniffer. I can look with a digital analyser if my command is send over UART to the PAN1740. Is there a possibility to use connection manager and the PAN1740 development dongle to look if the command is sent right to this?
我的Exchange mtu命令右一个尤其是源和目标ID?
Thank you
Regards
塞特
嗨Ehanl,
您发送的命令是正确的,我看起来有一个嗅探器,似乎命令被正确发送。命令管理器不支持Exchange MTU功能,它只使用默认的MTU。如果您认为这将有助于您定义问题,我可以为iOS发送DSPS源代码。
谢谢mt_dialog.
嗨mt_dialog,
thank your for your fast help.
是的,请将源代码发送到我的电子邮件地址。
Perhaps I can find some hints to solve my problem.
Regards
Ehanl.
Hi MT_Dialog,
感谢您的帮助。
I have still the problem but the reason is perhaps a other one.
In my application I send a command from the client (iOS App) to the server (PAN1740) and than I begin to stream data.
这意味着服务器开始通过通知将连续数据发送到客户端。我设置了属性值,然后我使用gattc_send_evt_command将流数据发送到客户端。流数据始终是大约100个字节,但客户端只接收21个字节。
But when I send a write request from the client to the server and the server sends a write confirm The cIient gets the 100 byte.
此外,我在从客户端获得连接请求后,请发送MTU Exchange命令,然后在发送连接确认之前。
通知价值有限吗?
如果客户端获取100个字节,则写入确认发送MTU大小必须超过默认值?否则客户端无法获得此数据大小?
Do you have a idea what's wrong.
在这个论坛中,我读了几个问题,如我的问题,但没有找到解决方案。
Thank you.
Regards
Ehanl.
.
嗨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.
谢谢mt_dialog.
嗨mt_dialog,
I have found the solution. I initialize my config command with the #define MTU_MAX_VALUE ( MTU_DEFAULT_VALUE+1) and thats 24 -3 byte header =21 byte. And my iOS App recieved exactly this 21 byte. I read in the datasheet that a MTU size lager than 23 byte set the MTU size automatically to 512 byte. But that's not right. So I set the MTU size to140 byte and my App recieved 140 byte. Now this part works and I get streaming data of 140 byte.
But I can stream only for a short time than my slave with EFM and PAN1740 hangs. I always load my 140 byte data to my attribute using the gatt_set_value_req. After this I wait for the ready event gatt_set_value_rsp and then I send the gattc_send_evt_cmd and wait for the gattc_cmp_evt. If this is ok I begin new. But after a several time I don't get the gatt_set_value_rsp or I get is incomplete. What's about the flow control? I use the full_emb.bin firmware from connection manager for the PAN1740 but I don't know if a hardware flow control is supported and which GPIO pins are used for RTS and CTS? I think the PAN1740 have a overflow and can't send then data.
你能帮我解决问题吗?
我尝试了不同的事情,例如,每次我的应用程序挂起时都会慢慢地发送。
你有一个暗示我的暗示吗?
Thank you.
Regards
Ehanl.
如果DA14580因内存分配故障而崩溃,则可以尝试增加消息堆。由于您总是等待Gattc_cmp_evt,您已经实现了流量控制。
To set it to 4000 bytes, add this in da14580_config.h:
#define msg_heap_sz 4000.
Hi,
但是,我将Pan1740的OTP与智能代码段和智能片段一起编制了Pan1740的OTP,并且当我理解你就必须更新堆大小,并且必须编译Bin文件新功能。但我没有full_emb.bin的源代码。还是有其他方法来做这件事吗?
Is there also a way to update the OTP of the PAN1740?
Regards
Ehanl.
嗨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?
谢谢mt_dialog.
嗨mt_dialog,
我可以使用这两个项目,你告诉我用连接经理来测试它吗?我试图用prox_monitor_ext_usb.hex文件闪存,我试图以中心或外设启动,但它不起作用。每次只能获得重置命令,没有完整的功能。我可以覆盖或更新OTP吗?或者我必须采取新的pan1740?我在哪里可以获得full_emb.bin的源代码?因为我的应用程序与此文件很好地运行。
有时没有命令或仅收到的部件,例如我收到msg_id,srcid,destId和什么。
我也试图只发送20个字节包,但我的应用程序也挂起。
Update:
我使用prox_monitor_ext_usb.bin文件和4000的msg_heap_size编程了一个新的pan1740的OTP,但我也没有在Connection Manager中的alpm_reset_cmd命令的回答。UART TX,RX引脚和波特率与full_emb.bin文件中的相同?
In the periph_setup.h file I found the defines for this.
#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
所以我认为´s相同的配置。
What´s going wrong?
Regards
Ehanl.
嗨Ehanl,
Yes, you can use them with connection manager to test them. Please follow the app note UM-B-010 Proximity example in Integrated and External processor. You have to load the firmware and then run the windows application for monitor or reporter. Also please try to run connection manager from windows as Administrator. Since the OTP is written you can't overwrite it but you can try to download the app to the sysram by pressing the reset button (use keil and program after reset). You mean the full_emb.bin located in the connection manager, the source code is similar to the proximity reporter (prox_reporter_ext). As far as the partial receive of the command or the response have you considered a faulty or problems in UART ?
谢谢mt_dialog.
Hi MT_Dialog,
现在我有一个带有proximity_reporter_ext bin文件的运行系统。我可以将其引导为外设并将我的应用程序与iOS应用浅蓝色连接。我还将堆大小设置为4000,但是当我开始流式传输时,我的设备也经过几次。我也有问题在用keil调试我的应用程序。在调试模式下,蓝牙不适用于此BIN文件,因为在我的UART接收缓冲区中,我有时无法为我的命令答案。这使得开发和测试我的申请更加困难。使用full_emb.bin文件我没有问题调试。我不知道是什么问题。
I don't know if I have problems with my uart. Maybe. But I don't know where.
Do you have a new idea?
Regards
Ehanl.
Hi enhal,
Can you check your UART with an analyser to see if something goes wrong? Try to run the proximity_reporter_ext.proj using keil and catch the handlers that the commands from your host are triggering maybe this will help you find the solution to your problem.
谢谢mt_dialog.
Hi MT_Dialog,
good news I found the problem after using a digital analyser I found that all events from the PAN1740 received at my UART RX pin. But my buffer check of the message id in every command wasn't byte for byte. I only compared both bytes of this message id and when in my UART RX interrupt came for the first time the LSB byte and in the next interrupt the MSB of the message id, it was splitted and I didn`t found the id. Now I check the incomming buffer byte for byte and it works.
Thank you for your help.
Regards
Ehanl.
嗨Ehanl,
很高兴你找到了它,谢谢你的表明。
Best Regards MT_dialog