IOT (Server) to DSPS (Host)data transmission

18 posts / 0 new
Last post
prasanth.velliy...
Offline
Last seen:1 year 8 months ago
Joined:2016-02-18 12:18
IOT (Server) to DSPS (Host)data transmission

Q1 : I want to send data from IOT sensor device to the DSPS host running on DA14580 , how to do it ? what are the changes that i have to do ?
Q2 : similarly, I want to send the data from custom profile - sample128_After section 7.3.6 project to DSPS host running on DA14580 , how to do it ?
Thank you ..Dialog

Device:
MT_dialog
Offline
Last seen:1 week 4 days ago
Staff
Joined:2015-06-08 11:34
Hi prasanth.velliyangiri,

Hi prasanth.velliyangiri,

1.这些是不同的项目和变化quired are far from small modifications, the DSPS host checks for a specific profile (the DSPS profile), so you should change the service discovery operation of the host and adapt it to the IoT available services and characteristics. After discovering the services enable the notifications on the available characteristics and you can push the data that you are notified over the UART.

2. The same applies for the custom project, you must change the discovery procedure of the host in order to find the characteristics of the custom profile.

Thanks MT_dialog

prasanth.velliy...
Offline
Last seen:1 year 8 months ago
Joined:2016-02-18 12:18
Q : How to create a custom

Q : How to create a custom profile for Client role , that searches service(sample128_After section 7.3.6.zip project (@server role)), connects to service , finds characteristics and read/write to the characteristics ?
I have gone through RW-BLE-GATT-IS.doc . this doc just gives the protocols only.so, it would be great, if you provide step by step tutorial like custom profile creation..thank you..!!!

MT_dialog
Offline
Last seen:1 week 4 days ago
Staff
Joined:2015-06-08 11:34
Hi prasanth.velliyangiri,

Hi prasanth.velliyangiri,

Unfortunatelly there is no available tutorial regarding the implementation of the discovery procedure of services and characteristics, but you can take as an example the DSPS (which is a custom 128-bit service) host side in order to implement your own central that connects, searches and discovers for a specific service in a client device.

Thanks MT_dialog

prasanth.velliy...
Offline
Last seen:1 year 8 months ago
Joined:2016-02-18 12:18
Dear Dialog

Dear Dialog
these are the changes that i hav done in DSPS HOST - sample128_After section 7.3.6 project-@serverrole
step 1: chaged the UUID in sps_client.h as per my Custom profile service and characteristics
SPS_SERVICE_UUID = sample128_svc
SPS_SERVER_TX_UUID = sample128_1_val
SPS_SERVER_RX_UUID = sample128_2_val
SPS_FLOW_CTRL_UUID = sample128_3_val
step 2: Next chage in
const struct prf_char_def_128 spsc_sps_char[SPSC_CHAR_MAX] ={
[SPSC_SRV_TX_DATA_CHAR] = {sample128_1_val, ATT_MANDATORY, ATT_CHAR_PROP_RD | ATT_CHAR_PROP_WR },
[SPSC_SRV_RX_DATA_CHAR] = {sample128_2_val, ATT_MANDATORY, ATT_CHAR_PROP_RD | ATT_CHAR_PROP_NTF },
[SPSC_FLOW_CTRL_CHAR] = {sample128_3_val, ATT_MANDATORY, ATT_CHAR_PROP_RD | ATT_CHAR_PROP_NTF }
};

Step 3: Assigning the UUID in sps_client_enable_req_handler & gattc_cmp_evt_handler...

uint8_t sps_data_service_uuid[]=sample128_svc ;

but code stops at GLOBAL_INT_START(); // arch_main
what am i missing ...??what else i have to change ?

MT_dialog
Offline
Last seen:1 week 4 days ago
Staff
Joined:2015-06-08 11:34
Hi prasanth,

Hi prasanth,

To start with, you are mentioning that your code stops at the GLOBAL_INT_START(); i dont think that your code stops there, it just loops through the main function and since the device just scans and doesn't do anything else this is the point that your code pass more often, so you are running the while loop properly as you should and as all the examples are doing.

通过改变需求方UUID的项目的UUIDs is proper, but the discovery functions are populating the dsps enviroment structure which holds the information regarding the service that is discovered on the other side of the link, so you will have to modify that accoring to your needs as well. In order to check if the discovery is working properly you will have to check if the the infomation in the application enviroment are proper and correspond to the actual handles of your peripheral's database.

Thanks MT_dialog

prasanth.velliy...
Offline
Last seen:1 year 8 months ago
Joined:2016-02-18 12:18
Could you please tell me,

Could you please tell me, when the Client profile Tutorial will be available ??
Thank you Dialog

MT_dialog
Offline
Last seen:1 week 4 days ago
Staff
Joined:2015-06-08 11:34
Hi prasanth,

Hi prasanth,

As far as i know there arent any on going plans for a tutorial that will guide you step by step regarding the creation of a host and the discovery procedure.

Thanks MT_dialog

prasanth.velliy...
Offline
Last seen:1 year 8 months ago
Joined:2016-02-18 12:18
Dear Dialog

Dear Dialog
In DSPS_HOST project
Q1 : could you please specify the functions related to reading the characteristics from DSPS_DEVICE(server project)

MT_dialog
Offline
Last seen:1 week 4 days ago
Staff
Joined:2015-06-08 11:34
Hi prasanth,

Hi prasanth,

In the 580 there is no indication to the application that a central has read your characteristic, this is handled by the stack, there is no profile application function that does this, if that is what you mean. For more information regarding the application profile functions for the DSPS you can have a look at the User Manual (UM-B-038) at the 6.7 section Application task interface to Serial Port Service.

Thanks MT_dialog

prasanth.velliy...
Offline
Last seen:1 year 8 months ago
Joined:2016-02-18 12:18
int sample128_timer_handler

int sample128_timer_handler(ke_msg_id_t const msgid,
struct gapm_cmp_evt const *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
{

ke_timer_set(APP_SAMPLE128_TIMER,TASK_APP,50);
sample128_placeholder++;

struct sample128_upd_char2_req *req = KE_MSG_ALLOC(
SAMPLE128_UPD_CHAR2_REQ,
TASK_SAMPLE128,
TASK_APP,
sample128_upd_char2_req
);
req->val = sample128_placeholder;
req->conhdl = app_env.conhdl;
ke_msg_send(req);
}
i want to implement above timer handler in dsps device project for data that we are transmitting , so dsps device project transmit periodically..how to do this...i hav tried within -user_sps_server_data_tx_cfm_handler - but seems not working

MT_dialog
Offline
Last seen:1 week 4 days ago
Staff
Joined:2015-06-08 11:34
Hi prasanth,

Hi prasanth,

The sample128 uses different messages in order to trigger notifications than the DSPS project. The function that you mention sends a SAMPLE128_UPD_CHAR2_REQ message, there is no handler in the DSPS that handles this kind of message, since the DSPS doesn't support this message. The handler that you mention handles the SPS_SERVER_DATA_TX_CFM that confirms that the data are placed in the TX buffer. If you want the device to send data periodically you can follow the post belowhttp://support.dialog-semiconductor.com/dsps-panasonic-evalpan1740.

Thanks MT_dialog

prasanth.velliy...
Offline
Last seen:1 year 8 months ago
Joined:2016-02-18 12:18
Dear Dialog,

Dear Dialog,

/***************************************************************/
typedef struct wrbl_env_T
{

void (*wrbl_timer_cb)();

uint16_t sensor_read_time; // VP
uint16_t sensor_read_time_1; // VP
uint16_t sensor_read_time_2; // VP

} wrbl_env_struct;

/****************************************************************/

void user_ble_pull (bool init, bool success)
{
if (init)
{
periodical_data_timer_handler();
}
else
{
periodical_data_timer_handler();
}
}

/********************************************************************/
空白periodical_data_timer_handler(void)
{
static uint16_t length;
uint8_t *p_data = NULL;
user_send_ble_data(p_data, length);
wrbl_env.sensor_read_time = app_easy_timer( 100, periodical_data_timer_handler );

}

/**********************************************************************/
void user_on_disconnect( struct gapc_disconnect_ind const *param )
{
default_app_on_disconnect(param);
arch_printf("Device disconnected\r\n");
if(wrbl_env.sensor_read_time == 1)
{
app_easy_timer_cancel( wrbl_env.sensor_read_time);
}

}

/*********************************************************************/

Q1 : i have made above changes in DSPS device project -code is stopping here -> if ((GetWord16(SYS_STAT_REG) & DBG_IS_UP) == DBG_IS_UP)
__asm("BKPT #0\n");

what could be the issue ??what am i missing ?? thank you..

MT_dialog
Offline
Last seen:1 week 4 days ago
Staff
Joined:2015-06-08 11:34
Hi prasanth,

Hi prasanth,

I guess that you code stops either on NMI or in Hardfault Handler, your code either stucks somewhere, most probably when reading the SPI sensor (NMI handler if the watchdog is enabled) or you are accessing a NULL pointer and the Hardfault handler triggers. The SDK provides that feature in order to figure out where the error occured, please check the UM-B-051 document for more information in order to debug this.

Thanks MT_dialog

prasanth.velliy...
Offline
Last seen:1 year 8 months ago
Joined:2016-02-18 12:18
Dear Dialog

Dear Dialog
Q1 : Even after adding this function , i didn't find any delay in transmission . could you please help me to solve this issue ??
空白periodical_data_timer_handler(void)
{
//static uint16_t length;
//uint8_t *p_data = NULL;
user_send_ble_data("FELLOW", 6);
wrbl_env.sensor_read_time = app_easy_timer( 20000, periodical_data_timer_handler );

/*if(wrbl_env.sensor_read_time != NULL)
{
app_easy_timer_cancel( wrbl_env.sensor_read_time);
}*/
}

Q2 : if i want to use ke_timer_set(); directly for periodic transmission , how to use this in DSPS device project ??

MT_dialog
Offline
Last seen:1 week 4 days ago
Staff
Joined:2015-06-08 11:34
Hi prasanth,

Hi prasanth,

I dont get the question, the kernel timer didn't triggered ? You can use the arch_set_pxact_gpio() and check if the timer elapses or not. I tested the above code in a new DSPS project and triggered the timer upon connection, it works just fine and i can receive data properly on the phone application.

Use the app_easy_timer() api, it uses the ke_timer_set() and when the handler executes you can execute your code and reset the timer. If you want to directly use the ke_timer_set check your other posthttp://support.dialog-semiconductor.com/apptimerset-0.

Thanks MT_dialog

prasanth.velliy...
Offline
Last seen:1 year 8 months ago
Joined:2016-02-18 12:18
i didn't get - triggered the

i didn't get - triggered the timer upon connection?? actually i am calling - periodical_data_timer_handler(); - function inside - void user_ble_pull (bool init, bool success) ... could you please suggest me where i have to put the - periodical_data_timer_handler(); - call function in DSPS device project ?? it would be great if you give me working example code...

MT_dialog
Offline
Last seen:1 week 4 days ago
Staff
Joined:2015-06-08 11:34
Hi prasanth,

Hi prasanth,

You have to establish a connection in order to start sending notifications to a central, without a connection i dont see how this is possible. So connect to a central and start a timer, when the handler triggers you will send a notification via user_send_ble_data and you will reset the timer. The preriodical_data_timer_handler() is just a handler, when you start a timer with that callback, that callback will be executed when time elapses.

Thanks MT_dialog