17 posts / 0 new
Last post
ehanl
Offline
Last seen:2 months 3 weeks ago
加入:2015-02-23 14:16
Changing MTU

Hi,

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.
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->operation = GAPM_SET_DEV_CONFIG;
msg->role = GAP_PERIPHERAL_SLV; // Device Role
memset( msg->irk.key, 0, sizeof(struct gap_sec_key));
msg->appearance = 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->flags = 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-semiconductor.com/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

Device:
MT_dialog
Offline
Last seen:3 days 12 hours ago
Staff
加入:2015-06-08 11:34
Hi ehanl,

Hi 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.

Thanks MT_dialog

ehanl
Offline
Last seen:2 months 3 weeks ago
加入:2015-02-23 14:16
Hi,

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?
Is my exchange MTU command the right one especially the source and destination id?
Thank you

Regards
Eckart

MT_dialog
Offline
Last seen:3 days 12 hours ago
Staff
加入: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
Offline
Last seen:2 months 3 weeks ago
加入:2015-02-23 14:16
Hi MT_dialog,

Hi MT_dialog,

感谢您的快速帮助。
Yes, please send me the the source code to my e-mail address.
Perhaps I can find some hints to solve my problem.

Regards
ehanl

ehanl
Offline
Last seen:2 months 3 weeks ago
加入:2015-02-23 14:16
嗨mt_dialog,

嗨mt_dialog,

thank you for your help.
我还有问题,但原因也许是另一个。
In my application I send a command from the client (iOS App) to the server (PAN1740) and than I begin to stream data.
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.
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.
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?
Do you have a idea what's wrong.
In this Forum I have read several problems like my problem but no solution found.
Thank you.

Regards
ehanl

.

MT_dialog
Offline
Last seen:3 days 12 hours ago
Staff
加入:2015-06-08 11:34
Hi ehanl,

Hi ehanl,

当您执行MTU Exchange时,两个设备必须在MTU中同意它们必须使用的,主机可以接受请求或拒绝并继续使用通信中涉及的两个设备的最小MTU。通知值受到在两个设备之间布置的当前MTU的限制。当您发送写入请求时,您发送的所有数据如何转到服务器,而无论您的MTU大小。

Thanks MT_dialog

ehanl
Offline
Last seen:2 months 3 weeks ago
加入:2015-02-23 14:16
Hi MT_dialog,

Hi 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.
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?
Thank you.

Regards
ehanl

Joacimwe
Offline
Last seen:1年3个月前
格鲁鲁
加入:2014-01-14 06:45
If the DA14580 crashes due to

If the DA14580 crashes due to 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

ehanl
Offline
Last seen:2 months 3 weeks ago
加入:2015-02-23 14:16
Hi,

Hi,

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?
Is there also a way to update the OTP of the PAN1740?

Regards
ehanl

MT_dialog
Offline
Last seen:3 days 12 hours ago
Staff
加入:2015-06-08 11:34
Hi ehanl,

Hi ehanl,

如果您使用的任何Proximity_ext实现作为基本项目,则可以使用Prox_Monitor_ext_USB或Prox_Reporter_ext_usb。但是你是什么意思,当你设置价值时,响应是不完整的?

Thanks MT_dialog

ehanl
Offline
Last seen:2 months 3 weeks ago
加入: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.

Update:
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

所以我认为´s相同的配置。
What´s going wrong?

Regards
ehanl

MT_dialog
Offline
Last seen:3 days 12 hours ago
Staff
加入:2015-06-08 11:34
Hi ehanl,

Hi 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 ?

Thanks MT_dialog

ehanl
Offline
Last seen:2 months 3 weeks ago
加入:2015-02-23 14:16
嗨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.
I don't know if I have problems with my uart. Maybe. But I don't know where.
你有一个新想法吗?

Regards
ehanl

MT_dialog
Offline
Last seen:3 days 12 hours ago
Staff
加入:2015-06-08 11:34
嗨,enhal,

嗨,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.

Thanks MT_dialog

ehanl
Offline
Last seen:2 months 3 weeks ago
加入:2015-02-23 14:16
嗨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

MT_dialog
Offline
Last seen:3 days 12 hours ago
Staff
加入:2015-06-08 11:34
Hi ehanl,

Hi ehanl,

Glad you found it and thanks for indicating.

最好的问候mt_dialog.