Best way to stream data using serial port service

11 posts / 0 new
Last post
JBaczuk
Offline
Last seen:1 year 4 months ago
加入:2014-12-31 23:41
Best way to stream data using serial port service

I've gone through the code for the serial port service, and since it is set up with pointers that are shared between UART and SPS, I'm not sure the best way to send data from the app to a mobile device. For example, I'd like to send ASCII values from sensors periodically, but what is the best way to do this using the example code, should I be allocating my own pointers in memory and then calling app_uart_push()? Maybe a couple lines example code would help. Thanks!

Keywords:
Device:
MHv_Dialog
Offline
Last seen:2 weeks 12 hours ago
工作人员
加入:2013-12-06 15:10
Hi,

Hi,

我建议实施自定义服务以移动传感器数据。据我所知,您的传感器数据是定期传输的谨慎数据集。该应用笔记http://support.dialog-semiconductor.com/download/file/fid/885covers how to construct your own custom service in a step by step tutorial. The app note also describes how to set up notification allowing for a device to send data to a smrartphone whenever data changes. DSPS is using the same basic methods (Notifications over GATT), and is a great candidate for systems that require streaming data at very high data rates, but it is not the best candidate for periodic transmissions of disceret data packages. Using a custom service also makes it much easire to implement the smartphone side of the application.

JBaczuk
Offline
Last seen:1 year 4 months ago
加入:2014-12-31 23:41
Ok, I will take a look. Yes,

Ok, I will take a look. Yes, you are correct they will be very small, periodic data sets, so high data streaming is not required.

Elvis1991
Offline
Last seen:2 months 3 weeks ago
加入:2014-12-09 08:18
Dear JBaczuk,

Dear JBaczuk,
纽伯的问题。您是否知道在哪里可以在哪里找到来自SPS项目的键盘的数据?我注意到UART_RX_CALLBACK()可以实现函数及其定义如下所示

****************************************************************************************
* @brief receive callback function will handle incoming uart data
*
* @param[in] res (status: UART_STATUS_OK, UART_STATUS_ERROR, UART_STATUS_TIMEOUT)
*
* @return没有
****************************************************************************************
*/

静态void UART_RX_CALLBALL(UINT8_T RES,UINT32_T READ_SIZE)
{
//function called from uart receive isr
if(res == uart_status_ok)
{
app_uart_push(rx_read_pointer, RX_CALLBACK_SIZE, rx_state_ptr);
}

//function called from uart timeout isr
else if(res == UART_STATUS_TIMEOUT)
{
app_uart_push(rx_read_pointer,read_size,rx_state_ptr);
}
else
{
而(1);//错误:从未知来源调用回调
}

//reinitiate callback
uart_sps_read(rx_read_pointer, RX_CALLBACK_SIZE, &rx_state_ptr, &uart_rx_callback);

I traced the uart_sps_read() in uart_rx_callback() and its definition is:
void uart_sps_read(uint8_t *bufptr, uint32_t size, uint8_t *state, void (*callback) (uint8_t, uint32_t))
{
// 完整性检查
ASSERT_ERR(bufptr != NULL);
ASSERT_ERR(size != 0);
ASSERT_ERR(uart_sps_env.rx.bufptr == NULL);

//准备RX参数
uart_sps_env.rx.size = size;
UART_SPS_ENV.RX.BUFPTR = BUFPTR;
uart_sps_env.rx.state = state;
uart_sps_env.rx.callback = callback;

// Start data transaction
uart_rec_data_avail_setf(1); //=SetBits16(UART_IER_DLH_REG, ETBEI_dlh0, 1);
}

我没有找到键盘的任何输入..
由于我想使用MCU生成的非常小的定期数据集来修改这个项目,以替换键盘中的数据输入。(仅生成信号来模拟真实数据),我需要知道uart读取的数据..

你能给我一些提示吗?非常感谢!

NRenney
Offline
Last seen:2年11个月前
加入:2017-06-26 15:44
If this question could be

If this question could be answered it would be helpful for the project I am working on now.

JBaczuk
Offline
Last seen:1 year 4 months ago
加入:2014-12-31 23:41
Are you talking about the

你在谈论键盘数据之前是否在BLE或之后发送?这可能是对对话的更好问题,因为我没有与SPS花很多时间,我为我的应用程序创建了自定义配置文件。

NRenney
Offline
Last seen:2年11个月前
加入:2017-06-26 15:44
Sorry man meant to direct

Sorry man meant to direct this more to Dialog. I've started a topic of my own considering a had a lot more questions for them!
And yeah I was just wondering where the keyboard data was received in the code as I couldn't find it in their example, not something we directly need in the project but something I was curious about.

MT_dialog
Offline
Last seen:2 days 22 hours ago
工作人员
加入:2015-06-08 11:34
Hi NRenney,

Hi NRenney,

If i understand the question properly, since apparently there is a bit of a mix up. You would like to know where the data that are received from the UART in the DSPS are stored ? The data received from the UART are placed in the periph_to_ble_buffer Ring buffer (at the address pointing the data_ptr member).

Thanks MT_dialog

BlueSDK18
Offline
Last seen:2 years 9 months ago
加入:2018-02-13 11:25
Hi JBaczuk,

Hi JBaczuk,

无法找到应用程序注意的资源链接!
Do you know the name of the relevant application note?
That would help me a lot!

Thanks in advance.

BlueSDK18

MT_dialog
Offline
Last seen:2 days 22 hours ago
工作人员
加入:2015-06-08 11:34
Hi BlueSDK18,

Hi BlueSDK18,

I suppose that you are interested in having a demo that will send data using notification to a central, in that case the ble_app_peripheral is allready demonstrating that, just write a 0x01 to the control point characteristic and enable the notifications on the ADC 1 value in order to start getting data. Also there a is a tutorial in the "Tutorials" section Building custom profiles that will help you on customising the allready existing custom profiles. The link that you are refering to its quite old and the document that links to most probably is obsolete and removed from the support site.

Thanks MT_dialog

BlueSDK18
Offline
Last seen:2 years 9 months ago
加入:2018-02-13 11:25
嗨mt_dialog,

嗨mt_dialog,

感谢您对我的问题的回复!
答案是我需要知道的。

BlueSDK18