17个帖子/ 0新
最后一篇
ehanl
离线
Last seen:2 months 3 weeks ago
加入: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应用程序可以找到我的设备并连接它。我将设备配置为具有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个字节的默认大小。
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_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-semiconductor.com/when-i-enable-notification-chara...
But it doesn't work.

在Apple BluetoothDesignGuidelines 3.10和蓝牙核心规范V4.0中描述了MTU交换。

是我的gatt_exc_mtu_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?

谢谢你。

关于Eckart.

Device:
MT_dialog
离线
Last seen:3天16小时前
职员
加入:2015-06-08 11:34
Hi ehanl,

Hi ehanl,

您可以检查嗅探器以验证传输命令是否?使用iOS设备交换MTU没有任何特定命令。您是否尝试使用集成的设计或完整的托管实现。

Thanks MT_dialog

ehanl
离线
Last seen:2 months 3 weeks ago
加入: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.
我没有蓝牙嗅探器。如果我的命令发送到PAN1740,我可以使用数字分析仪查找。是否有可能使用Connection Manager和Pan1740 Development Dongle查看该命令是否已发送给此命令?
Is my exchange MTU command the right one especially the source and destination id?
谢谢

问候
Eckart

MT_dialog
离线
Last seen:3天16小时前
职员
加入: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:2 months 3 weeks ago
加入: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:2 months 3 weeks ago
加入: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:3天16小时前
职员
加入: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:2 months 3 weeks ago
加入:2015-02-23 14:16
Hi 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

Joacimwe
离线
Last seen:1 year 3 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:2 months 3 weeks ago
加入: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:3天16小时前
职员
加入: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: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.

更新:
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
#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

MT_dialog
离线
Last seen:3天16小时前
职员
加入:2015-06-08 11:34
Hi 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

ehanl
离线
Last seen:2 months 3 weeks ago
加入: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:3天16小时前
职员
加入:2015-06-08 11:34
Hi enhal,

Hi enhal,

你可以用分析仪检查你的UART看看是否出错了?尝试使用keil运行proximity_reporter_ext.proj并捕获从主机的命令触发的处理程序可能会帮助您找到解决问题的解决方案。

Thanks MT_dialog

ehanl
离线
Last seen:2 months 3 weeks ago
加入: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:3天16小时前
职员
加入:2015-06-08 11:34
Hi ehanl,

Hi ehanl,

Glad you found it and thanks for indicating.

Best Regards MT_dialog