我正在使用DSPS来源code project , i am successfully reading data from a sensor , now i want to send this data through bluetooth and not through UART, to DSPS android app , how to do it , please mention the functions and steps
我正在使用DSPS来源code - sps_device project , i am successfully reading data from a sensor , now i want to send this data through bluetooth , to DSPS android app , how to do it , please mention the functions and steps
Q1。请提及用于将数据发送到DSPS应用的功能, Q2 . also specify does DSPS source code API functions to send data through BLE and smartband IOT source code API functions are same
i am using user_send_ble_data(p_data , length) function in DSPS source code to send the data to DSPS app , is there any other function available to send data over BLE to DSPS
2. The DSPS and IoT project are totaly different projects using totally different custom profiles. In essence both are using notificatios/indications and write and read commands in order to communicate (as all the BLE projects do) but the architecture of the two reference designs is totally different. The DSPS emulates a serial port over a wireless link using 3 characteristics and the IoT sends sensor data using 10 characteristics one for each sensor or proccessed value.
Were is the code trapped and goes in an endless loop ? When you read the I2C (Read_Sensor()) is invoked you see that your code is trapped ? I dont get about what delays you are talking about, you have inserted delays when reading the I2C sensor ?
//printf_string("\n\rLED will change state every second.\n\r"); //printf_string("\n\rTest will run for: "); // printf_byte(timeout_expiration); // printf_string(“秒。\ n \ r”);
// Disable TIMER0, TIMER2 clocks set_tmr_enable(clk_per_reg_tmr_disabled); //printf_string("\n\rTIMER0 stopped!\n\r"); // printf_string(“\ n \ test \ n \ r rend)); } ************************************************************************************************* i have included timer0 interrupt for delay , this -- while (timeout_expiration); -- line in function void timer0_general_test(uint8_t times_seconds) makes the code infinite loop , what could be the issue , alone timer0 code working fine , inside the DSPS not working
hi GauravBansal i am using tha AN-B-029_V1.0 for custom profile to read data and send via bluetooth , this rar extention has the tutorial pdf also..that would be helpful for u
Thank you for the reply. I worked on the sample128 and fathomed through the doc AN-B-029 Developing a Bluetooth Smart custom profile_V1.0 as you suggested. This has led to an effective communication between the mobile app Blueloupe and my DVK board. But I am still not able to figure out how to integrate my board to any sensor and also through the DSPS app. If you could point me to some more docs or guides regarding this, I'll be really grateful.
Hi prasanth.velliyangiri,
我想你可以使用app_uart_push()以便将数据从I2C推送到BLE缓冲区,这是由UART的接收调用正常调用,它将数据推入BLE缓冲区。您可以找到有关串口应用程序的所有可用信息以及串行端口服务参考应用程序注意中的最重要功能。
谢谢mt_dialog.
我正在使用DSPS来源code project , i am successfully reading data from a sensor , now i want to send this data through bluetooth and not through UART, to DSPS android app , how to do it , please mention the functions and steps
我正在使用DSPS来源code - sps_device project , i am successfully reading data from a sensor , now i want to send this data through bluetooth , to DSPS android app , how to do it , please mention the functions and steps
Hi prasanth.velliyangiri,
这不是通过对话框实现的,您必须将DSP的现有实现调整为您的需求,以便将数据发送到DSPS应用程序,可以将USER_PERIPH_PUS()(用于SDK5版本)功能作为示例并调整您想要的函数效率才能将I2C数据从I2C传感器推到BLE缓冲区而不是UART,然后再到链路的另一侧。如果您不想模拟串行端口,并且只想通过BLE发送传感器数据,您不必使用DSPS应用程序,但每次具有传感器数据时都使用自定义配置文件实现并通知客户端。如果您需要一个示例,您可以查看app_ble_peripheral,其中有一个示例以触发稳定速率间隔的通知。
谢谢mt_dialog.
Q1。请提及用于将数据发送到DSPS应用的功能,
Q2 . also specify does DSPS source code API functions to send data through BLE and smartband IOT source code API functions are same
i am using user_send_ble_data(p_data , length) function in DSPS source code to send the data to DSPS app , is there any other function available to send data over BLE to DSPS
Hi prasanth.velliyangiri,
1.正如我在我的前一篇文章中提到的DSPS应用程序模拟串行通信,如果你只想将数据发送到链接的另一侧,你可以使用比DSPS应用程序更简单的方式,你提到的具体功能拉动数据来自UART填充的DSP缓冲区,并将其作为通知发送到链路的另一侧。这是DSP使用的功能,以便将数据从缓冲区发送到链路的另一侧。
2. The DSPS and IoT project are totaly different projects using totally different custom profiles. In essence both are using notificatios/indications and write and read commands in order to communicate (as all the BLE projects do) but the architecture of the two reference designs is totally different. The DSPS emulates a serial port over a wireless link using 3 characteristics and the IoT sends sensor data using 10 characteristics one for each sensor or proccessed value.
谢谢mt_dialog.
// extern void read_sensor(void) // MY REQ
// extern unsigned char SensorData[20]; // MY REQ
void user_ble_pull (bool init, bool success)
{
bool send_flow_on = false;
静态bool tx_busy_flag = false;
静态uint8_t rounds_waiting = 0;
static uint16_t length;
// read_sensor()//我的req - 通过i2c从传感器读取
如果(init)
{
如果(!tx_busy_flag)
{
if((length = user_buffer_item_count(&periph_to_ble_buffer)) > 0)
if (length > TX_WAIT_LEVEL || (rounds_waiting++) >= TX_WAIT_ROUNDS)
{
uint8_t * p_data = null;
rounds_waiting = 0;
tx_busy_flag = true;
愣th = (length > TX_SIZE ? TX_SIZE : length);
长度=(长度< TX_START_FRAME_DATA_SIZE吗?愣th : (((length - TX_START_FRAME_DATA_SIZE) / TX_CONTINUE_FRAME_DATA_SIZE) * TX_CONTINUE_FRAME_DATA_SIZE + TX_START_FRAME_DATA_SIZE));
愣th = user_buffer_read_address(&periph_to_ble_buffer, &p_data, TX_SIZE);
p_data [0] ='p';
p_data [1] ='p';
p_data[2] = 'P';
p_data [3] ='a';
长度= 4;
user_send_ble_data(p_data,长度);
// user_send_ble_data((const uint8_t *)SensorData, length); // MY REQ
}
}
}
else
{
tx_busy_flag = false;
if (success)
user_buffer_release_items(&periph_to_ble_buffer, length);
if((length = user_buffer_item_count(&periph_to_ble_buffer))> tx_wait_level)
{
uint8_t * p_data = null;
rounds_waiting = 0;
tx_busy_flag = true;
愣th = (length > TX_SIZE ? TX_SIZE : length);
愣th = (((length - TX_START_FRAME_DATA_SIZE) / TX_CONTINUE_FRAME_DATA_SIZE) * TX_CONTINUE_FRAME_DATA_SIZE + TX_START_FRAME_DATA_SIZE);
愣th = user_buffer_read_address(&periph_to_ble_buffer, &p_data, TX_SIZE);
p_data [0] ='v';
p_data[1] = 'V';
p_data [2] ='v';
p_data[3] = 'B' ;
长度= 4;
user_send_ble_data(p_data,长度);
// user_send_ble_data((const uint8_t *)SensorData, length); // MY REQ
}
}
上面的代码工作正常,我在DSPA移动应用程序上获得一些数据,如果我启用//我的req注释,代码进入无限循环,我无法获得任何数据
以上代码,在i2c read_sensor()中添加延迟会影响代码?,即使在IOT项目和I2C EEPROM中我也没有看到任何延迟......
谢谢你...
Hi prasanth.velliyangiri,
Were is the code trapped and goes in an endless loop ? When you read the I2C (Read_Sensor()) is invoked you see that your code is trapped ? I dont get about what delays you are talking about, you have inserted delays when reading the I2C sensor ?
谢谢mt_dialog.
void Read_sensor(void)
{
//Read_sensor_1();
// read_sensor_2();
UART_INIT(UART_BAUDRATE_115K2,3);
UART_FLOW_OFF();
uint8_t东西[] = {0x0a,'r','e','e','3','y',0x0d,'>'};
uart_write(something,12,NULL);
uart_finish_transfers();
timer0_general_test(10);//延迟定时器中断
}
*********************************************************************************************************************************
void timer0_general_user_callback_function(void)
{
static uint8_t n = 0;
// when pass 10 * 100ms
if ( 5 == n )
{
n = 0;
UART_INIT(UART_BAUDRATE_115K2,3);
UART_FLOW_OFF();
uint8_t something[] = { 0x0A,'R','e','a','d','y',0x0D,0x0A,'>' } ;
uart_write((uint8 *)timeout_expiration,10,NULL);
uart_finish_transfers();
timeout_expiration--;
//printf_string("\nVP!");
}
n++;
}
************************************************************************************************************************************
void timer0_general_test(uint8_t times_seconds)
{
//printf_string("\n\r\n\r");
//printf_string("***********************\n\r");
//printf_string("* TIMER0 GENERAL TEST *\n\r");
//printf_string("***********************\n\r");
// Stop timer for enter settings
timer0_stop();
timeout_expiration = times_seconds;
//寄存SWTIM_IRQN IRQ的回调函数
timer0_register_callback(timer0_general_user_callback_function);
// Enable TIMER0 clock
set_tmr_enable(CLK_PER_REG_TMR_ENABLED);
//将timer0设置为timer2时钟分割因子到8,因此tim0 fclk是f = 16mHz / 8 = 2MHz
set_tmr_div(clk_per_reg_tmr_div_8);
// clear PWM settings register to not generate PWM
timer0_set_pwm_high_counter(no_pwm);
timer0_set_pwm_low_counter(no_pwm);
//设置具有2MHz源时钟的计时器除以10所以FCLK = 2MHz / 10 = 200kHz
timer0_init(tim0_clk_fast,pwm_mode_one,tim0_clk_div_by_10);
//重新加载100ms(t = 1 / 200khz * Reload_100ms = 0,000005 * 20000 = 100ms)
timer0_set_pwm_on_counter(reload_100ms);
// Enable SWTIM_IRQn irq
timer0_enable_irq();
//printf_string("\n\rLED will change state every second.\n\r");
//printf_string("\n\rTest will run for: ");
// printf_byte(timeout_expiration);
// printf_string(“秒。\ n \ r”);
// Start Timer0
timer0_start();
//printf_string("\n\rTIMER0 started!");
//等待所需的秒数
while (timeout_expiration);
// Disable TIMER0, TIMER2 clocks
set_tmr_enable(clk_per_reg_tmr_disabled);
//printf_string("\n\rTIMER0 stopped!\n\r");
// printf_string(“\ n \ test \ n \ r rend));
}
*************************************************************************************************
i have included timer0 interrupt for delay , this -- while (timeout_expiration); -- line in function void timer0_general_test(uint8_t times_seconds) makes the code infinite loop , what could be the issue , alone timer0 code working fine , inside the DSPS not working
你可以把这个票子打倒,我得到了答案,谢谢你的帮助......
Hi prasanth.velliyangiri,
我读了上面的对话,我也在努力解决非常相似的东西。但我刚刚开始工作。您能否请帮助我参加项目的第一部分I.E.阅读来自传感器的数据。如果你能指出我应该看的档案以及我需要照顾的确切功能会很棒。
谢谢。
hi GauravBansal
i am using tha AN-B-029_V1.0 for custom profile to read data and send via bluetooth , this rar extention has the tutorial pdf also..that would be helpful for u
http://support.dialog-semiconductor.com/resource/b-029-tutorial-files-su...
Hi prasanth.velliyangiri,
Thank you for the reply. I worked on the sample128 and fathomed through the doc AN-B-029 Developing a Bluetooth Smart custom profile_V1.0 as you suggested. This has led to an effective communication between the mobile app Blueloupe and my DVK board. But I am still not able to figure out how to integrate my board to any sensor and also through the DSPS app. If you could point me to some more docs or guides regarding this, I'll be really grateful.
Hi GauravBansal
I didn't understand your question - how to integrate my board to any sensor and also through the DSPS app??,
if you are working in BLE CLIENT - BLE SERVER , refer this link
http://support.dialog-semicondiondiond.com/iot-server-dsps-hostdata-transmi ...
Hi prasanth.velliyangiri,
我的应用是在DSPS应用中实时可见温度传感器数据。那么你建议是什么应该是最合适的文件?
Hi GauravBansal
UM-B-038 DA14580 Serial Port Service reference application_v2.0 - helps with DSPS