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.
在与iOS应用程序连接之后,我从应用程序获取连接请求,我向应用程序发送确认。确认后,我也发送gatt_exc_mtu_req命令。
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);
}
在你的论坛的这个链接中,有类似的问题,我试过这个问题。
http://support.dialog-semicondiondiondum/when-i-enable-notification-chara ...
但它不起作用。
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?
您是否有一个IOS设备交换MTU大小的示例?例如DSPS应用程序?
你有想法我做错了什么吗?
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,
我有一个通过UART的EFM微控制器控制Pan1740。我用智能片段将Pan1740的OTP闪烁了Pan1740的OTP。像Slave和Advertise命令一样如Confim的每一件事都看起来很好。
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,
感谢您的快速帮助。
是的,请将源代码发送到我的电子邮件地址。
Perhaps I can find some hints to solve my problem.
Regards
Ehanl.
嗨mt_dialog,
感谢您的帮助。
我还有问题,但原因也许是另一个。
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,
当您执行MTU Exchange时,两个设备必须在MTU中同意它们必须使用的,主机可以接受请求或拒绝并继续使用通信中涉及的两个设备的最小MTU。通知值受到在两个设备之间布置的当前MTU的限制。当您发送写入请求时,您发送的所有数据如何转到服务器,而无论您的MTU大小。
谢谢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,您已经实现了流量控制。
要将其设置为4000字节,请在da14580_config中添加此内容:
#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实现作为基本项目,则可以使用Prox_Monitor_ext_USB或Prox_Reporter_ext_usb。但是你是什么意思,当你设置价值时,响应是不完整的?
谢谢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文件中的相同?
在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
所以我认为´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.
嗨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.
你有一个新想法吗?
Regards
Ehanl.
嗨,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.
嗨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,
很高兴你找到了它,谢谢你的表明。
最好的问候mt_dialog.