我在DA14580和外部MCU之间实现了GTL。工作正常,只是我需要发送一条相当长的消息(476字节用于发送绑定数据库)。从我的测试来看,我似乎只能分配一个高达0x3a字节的有效负载的消息(使用ke_msg_alloc()),因为当我尝试分配超过此值的消息时,似乎会将长度恢复为零。这是正确的吗?有没有办法发送更长的消息?
谢谢,保罗。
我们在具有外部MCU的传感器上使用PAN1740(包含对话框DA14580)。我们需要在MCU和DA14580之间建立通信和控制。您能否帮助回答以下问题:
谢谢,
Paul
我非常想找到我需要在我们的主机代码中处理什么消息,以响应电池电平的“读”和自定义特征的“读”。例如,我在iOS上使用App LightBlue根据要求读取电池电量(在选择电池服务时按“再次读取”)。然而,下面的消息(来自示例项目)都没有被触发,所以我可以真正地更新电池级别。< / p > < p > / /通知应用程序创建数据库状态< br / >案例BASS_CREATE_DB_CFM: < / p > < p > / /禁用确认配置后保存配置文件禁用< br / >案例BASS_DISABLE_IND: < / p > < p > / /错误指示主机< br / >案例BASS_ERROR_IND: < / p > < p > / /通知应用程序是否电池水平值已经通知< br / >BASS_BATT_LEVEL_UPD_CFM:
//通知APP电池电量通知配置已更改
case BASS_BATT_LEVEL_NTF_CFG_IND:
对于我已经实现的自定义服务也是如此。我能够响应CUSTS1_VAL_WRITE_IND消息(当值为write时),但还不清楚如何响应Read。
我期待你的回复。
Kind regards,
Arjan
我面临的挑战是内存分配。到目前为止,我们一直避免在我们的嵌入式代码中使用malloc/free,这只是为了防止引入灾难性的副作用,比如内存泄漏(它还可能与我们的RTOS结合带来新的挑战)。在上述项目的ble_msg中,我看到malloc和free是通过BleMsgAlloc和BleFreeMsg使用的,uart.c中的SendToMain也是如此。此外,UARTProc (uart.c)中的接收缓冲区大小为1000字节,MAX_PACKET_LENGTH为350字节(uart.h)。在UARTSend (uart.c)中分配另外500个字节。
从综合过程应用.pdf和UM-B-010_DA14580_581_583 Proximity application_v1.3.pdf中的源和读取UM-B-017 GTL接口的理解来看,GTL接口不能被归类为停止-等待协议。 In other words, multiple event packets / messages can be sent by the DA14580 to the external processor at any given moment. On the other hand the external processor can send a command packet / message whenever required by the application.
I fully understand the reason for using dynamic memory allocation, it makes sense with a variable number of packets and a variable PAR_LEN field value. However I would like to know if static memory allocation is a viable option (and achievable looking at memory requirements). In this case I would like to know what the max value for PAR_LEN is (the maximum number of bytes of Parameters that a message can contain) and how many packets / messages could potentially be sent by the DA14580. If feasible, I could create a circular buffer of X number of packets, each with MAX_PAR_LEN bytes of Parameters (we have 32kB of RAM available in total, so for example 3 packets of each 350 bytes with a separate read buffer of 350 bytes and a write buffer of 350 bytes (for asynchronous reading/writing) is not very realistic).
I would love to hear your thoughts on this. If at all possible, I would rather not use malloc / free.
Kind regards,
Arjan
Edit 02-11-2015
I have added information regarding endianness and data structure padding below, perhaps other forum users might find this useful as well.