I am interfacing temperature sensor [i2c - pin 2, 3 ]code with dsps source code, so it has to send data to DSPS app , what changes that i has to make , pls mention the functions , thank you
I suppose that you can use the app_uart_push() in order to push data from your i2c to the ble buffer, this is called by the receive callback of the UART normally and it pushes data into the ble buffer. You can find all the available information about the Serial port application and the most important functions in the Serial Port Service reference application note.
This is not implemented by dialog, you will have to adapt the existing implementation of the DSPS to your needs in order to send data to the DSPS application, you can take the user_periph_push() (for the SDK5 version) function as an example and adjust the functionallity you want in order to push I2C data from the I2C sensor to the ble buffer instead of UART and then to the other side of the link. If you dont want to emulate a serial port and you just want to send sensor data over BLE you dont have to use the DSPS application but use the custom profile implementation and notify the client every time you have sensor data. In case you need an example for this you can have a look at the app_ble_peripheral where there is an example to trigger notifications in a steady rate interval.
1. As i ve mentioned in my previous post the DSPS application emulates serial communication, if you just want to send data to the other side of the link you can use more simple ways than the DSPS application, the specific function that you mention pulls data from the DSPS buffer that are populated by UART and sends them as notifications to the other side of the link. This is function that the DSPS uses in order to send data from the buffer to the other side of the link.
length = 4; user_send_ble_data(p_data, length); // user_send_ble_data((const uint8_t *)senordata,长度);//我的req. } } above code works fine , i am getting some data on DSPA mobile app , if i enable the // MY REQ comments , code enters into endless loop , i am not able to get any data
above code , does adding delays in I2C Read_sensor () affect the code ?? , even in the IOT project and i2c eeprom i haven't seen any delays... thank you...
// Set timer with 2MHz source clock divided by 10 so Fclk = 2MHz/10 = 200kHz timer0_init(TIM0_CLK_FAST, PWM_MODE_ONE, TIM0_CLK_DIV_BY_10);
// reload value for 100ms (T = 1/200kHz * RELOAD_100MS = 0,000005 * 20000 = 100ms) timer0_set_pwm_on_counter(RELOAD_100MS);
//启用SWTIM_IRQN IRQ timer0_enable_irq();
// printf_string(“\ n \ rled每秒改变状态。\ n \ r”); // printf_string(“\ n \ n \ n将运行:”); //printf_byte(timeout_expiration); //printf_string(" seconds.\n\r");
I read the above conversation and I am also working on something very similar. But I have just begun my work. Could you please help me with the first part of the project i.e. reading data from the sensor. It would be great if you could point me to the profiles that I should be looking at and the exact functions that I need to take care of. 谢谢。
My application is to get the temperature sensor data visible in dsps app in real time. So what do you suggest should be the most appropriate docs to look at?
嗨prasanth.velliyangiri,
I suppose that you can use the app_uart_push() in order to push data from your i2c to the ble buffer, this is called by the receive callback of the UART normally and it pushes data into the ble buffer. You can find all the available information about the Serial port application and the most important functions in the Serial Port Service reference application note.
Thanks MT_dialog
我使用的是DSPS源代码项目,我正在成功地从一个传感器读取数据,现在我想通过蓝牙而不是UART发送这些数据,到DSPS android应用程序,怎么做,请说明功能和步骤
我正在使用DSPS源代码 - SPS_DEVICE项目,我成功地从传感器读取数据,现在我想通过蓝牙发送此数据,到DSPS Android应用程序,如何执行此操作,请提及函数和步骤
嗨prasanth.velliyangiri,
This is not implemented by dialog, you will have to adapt the existing implementation of the DSPS to your needs in order to send data to the DSPS application, you can take the user_periph_push() (for the SDK5 version) function as an example and adjust the functionallity you want in order to push I2C data from the I2C sensor to the ble buffer instead of UART and then to the other side of the link. If you dont want to emulate a serial port and you just want to send sensor data over BLE you dont have to use the DSPS application but use the custom profile implementation and notify the client every time you have sensor data. In case you need an example for this you can have a look at the app_ble_peripheral where there is an example to trigger notifications in a steady rate interval.
Thanks MT_dialog
Q1 . Please mention the functions used to send the data to DSPS app ,
Q2。还指定DSPS源代码API是否函数通过BLE和SmartBand IOT源代码API函数发送数据
我在DSPS源代码中使用user_send_ble_data(p_data,长度)函数将数据发送到DSPS应用程序,是否有任何其他功能可用于将数据发送到DSP上的数据
嗨prasanth.velliyangiri,
1. As i ve mentioned in my previous post the DSPS application emulates serial communication, if you just want to send data to the other side of the link you can use more simple ways than the DSPS application, the specific function that you mention pulls data from the DSPS buffer that are populated by UART and sends them as notifications to the other side of the link. This is function that the DSPS uses in order to send data from the buffer to the other side of the link.
2. DSP和IOT项目使用完全不同的自定义配置文件总计不同的项目。从本质上讲,两者都是使用通知/指示和写入和读取命令,以便沟通(作为所有BLE项目做),但两个参考设计的架构完全不同。DSP使用3个特征在无线链路上模拟串口,并且IOT使用10个特性为每个传感器或Proccessed值发送传感器数据。
Thanks MT_dialog
// extern void read_sensor(void)//我的req
// externed unsigned char sensoldata [20];//我的req.
void user_ble_pull(bool init,bool成功)
{
bool send_flow_on = false;
static bool tx_busy_flag = false;
静态uint8_t rounds_waiting = 0;
静态单位长度;
// Read_sensor() // MY REQ - Reading from sensor through I2C
if (init)
{
if(!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;
循环_waiting = 0;
tx_busy_flag = true;
长度=(长度> tx_size?tx_size:长度);
长度=(长度<发送开始帧数据大小?长度:((长度-发送开始帧数据大小)/发送继续帧数据大小)*发送继续帧数据大小+发送开始帧数据大小);
length = 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' ;
length = 4;
user_send_ble_data(p_data, length);
// user_send_ble_data((const uint8_t *)senordata,长度);//我的req.
}
}
}
别的
{
tx_busy_flag = false;
如果(成功)
user_buffer_release_items(&periph_to_ble_buffer,长度);
if((length = user_buffer_item_count(&periph_to_ble_buffer)) > TX_WAIT_LEVEL)
{
uint8_t *p_data = NULL;
循环_waiting = 0;
tx_busy_flag = true;
长度=(长度> tx_size?tx_size:长度);
长度=((长度-发送\开始帧\数据\大小)/发送\继续帧\数据\大小)*发送\继续帧\数据\大小+发送\开始帧\数据\大小);
length = 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';
length = 4;
user_send_ble_data(p_data, length);
// user_send_ble_data((const uint8_t *)senordata,长度);//我的req.
}
}
above code works fine , i am getting some data on DSPA mobile app , if i enable the // MY REQ comments , code enters into endless loop , i am not able to get any data
above code , does adding delays in I2C Read_sensor () affect the code ?? , even in the IOT project and i2c eeprom i haven't seen any delays...
thank you...
嗨prasanth.velliyangiri,
代码被困并进入无尽的循环?读取I2C时(read_sensor())被调用,您会看到您的代码被删除了?我不符合您谈论的延迟,在读取I2C传感器时插入延迟?
Thanks MT_dialog
void read_sensor(void)
{
// read_sensor_1();
//Read_sensor_2();
uart_init(UART_BAUDRATE_115K2,3);
uart_flow_off();
uint8_t something[] = { 0x0A,'R','e','e','3','y',0x0D,'>' } ;
uart\u write(something,12,NULL);
UART_FINISH_TRANSFERS();
timer0_general_test(10); // TIMER INTERRUPT FOR DELAY
}
*********************************************************************************************************************************
void timer0_general_user_callback_function(void)
{
静态UINT8_T n = 0;
//通过10 * 100ms
if(5 == n)
{
n = 0;
uart_init(UART_BAUDRATE_115K2,3);
uart_flow_off();
uint8_t东西[] = {0x0a,'r','e','a','d','y',0x0d,0x0a,'>'};
UART_WRITE((uint8 *)timeout_expion,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\u字符串(“***********************\n\r”);
// printf_string(“* timer0常规测试* \ n \ r”);
//printf\u字符串(“***********************\n\r”);
//停止计时器输入设置
timer0_stop();
timeout_expiration = times_seconds;
// register callback function for SWTIM_IRQn irq
timer0_register_callback(timer0_general_user_callback_function);
//启用Timer0时钟
set_tmr_enable(clk_per_reg_tmr_enabled);
// Sets TIMER0,TIMER2 clock division factor to 8, so TIM0 Fclk is F = 16MHz/8 = 2Mhz
set_tmr_div(CLK_PER_REG_TMR_DIV_8);
//清除PWM设置寄存器未生成PWM
timer0_set_pwm_high_counter(NO_PWM);
timer0_set_pwm_low_counter(no_pwm);
// Set timer with 2MHz source clock divided by 10 so Fclk = 2MHz/10 = 200kHz
timer0_init(TIM0_CLK_FAST, PWM_MODE_ONE, TIM0_CLK_DIV_BY_10);
// reload value for 100ms (T = 1/200kHz * RELOAD_100MS = 0,000005 * 20000 = 100ms)
timer0_set_pwm_on_counter(RELOAD_100MS);
//启用SWTIM_IRQN IRQ
timer0_enable_irq();
// printf_string(“\ n \ rled每秒改变状态。\ n \ r”);
// printf_string(“\ n \ n \ n将运行:”);
//printf_byte(timeout_expiration);
//printf_string(" seconds.\n\r");
//启动Timer0.
timer0_start();
//printf\u字符串(“\n\rTIMER0已启动!”);
// Wait for desired number of seconds
而(timeout_expiration);
//禁用Timer0,Timer2时钟
set_tmr_enable(CLK_PER_REG_TMR_DISABLED);
// printf_string(“\ n \ n \ttimer0停止!\ n \ r”);
//printf_string("\n\rEnd of test\n\r");
}
*************************************************************************************************
我已经包含Timer0中断以延迟,这 - 虽然(timout_expiration);- 函数中的线路void timer0_general_test(uint8_t time_seconds)使代码无限循环,可能是问题,单独计时器0代码工作正常,在DSP内没有工作
你可以标记这张票closed , i got the answer , thankyou for your help...
嗨prasanth.velliyangiri,
I read the above conversation and I am also working on something very similar. But I have just begun my work. Could you please help me with the first part of the project i.e. reading data from the sensor. It would be great if you could point me to the profiles that I should be looking at and the exact functions that I need to take care of.
谢谢。
嗨宝拉巴斯纳尔
我正在使用Tha An-B-029_V1.0进行自定义配置文件来读取数据并通过蓝牙发送,这次RAR EXTENTER有教程PDF。这对你有所帮助
http://support.dialog-semicondiondiondum/resource/b-029-tutorial-files-su ...
嗨prasanth.velliyangiri,
感谢您的答复。我在Sample128上工作,并通过Doc An-B-029开发蓝牙智能自定义Profile_v1.0,如您所建议的那样。这导致了移动应用程序Blueloupe和我的DVK板之间的有效沟通。但我仍然无法弄清楚如何将我的电路板集成到任何传感器以及通过DSPS应用程序。如果您可以将我指出更多文档或指南,我将非常感激。
嗨宝拉巴斯纳尔
我不明白你的问题-如何整合我的董事会,以任何传感器,也通过DSP应用程序??,
如果您在BLE客户端 - BLE服务器中工作,请参阅此链接
http://support.dialog-semiconductor.com/iot-server-dsps-hostdata-transmi...
嗨prasanth.velliyangiri,
My application is to get the temperature sensor data visible in dsps app in real time. So what do you suggest should be the most appropriate docs to look at?
嗨宝拉巴斯纳尔
UM-B-038 DA14580串行端口服务参考应用程序2.0版-DSP帮助