Hello,
I am working on Project i have to send data on http server and also same data to be store in SD card and also used Bluetooth to dump store data from SD card to Bluetooth App.
Now my problem bluetooth pairing process.
Actually i want to start timer every 30 sec for search for pairing .
If get paired than it will send data to app.
but this portion not working could any suggest something.
I am tried some code but my timer is not working:
s32 ret;
ST_MSG msg;
// Register & open UART port
Ql_UART_Register(UART_PORT1, CallBack_UART_Hdlr, NULL);
Ql_UART_Open(UART_PORT1, 115200, FC_NONE);
Ql_UART_Register(UART_PORT2, CallBack_UART_Hdlr, NULL);
Ql_UART_Open(UART_PORT2, 115200, FC_NONE);
ret = Ql_Timer_Register(Stack_timer, Timer_handler, &m_param1);
if(ret <0)
{
APP_DEBUG("\r\n<--failed!!, Ql_Timer_Register: timer(%d) fail ,ret = %d -->\r\n",Stack_timer,ret);
}
APP_DEBUG("\r\n<--Register: timerId=%d, param = %d,ret = %d -->\r\n", Stack_timer ,m_param1,ret);
//register a GP-Timer
ret = Ql_Timer_RegisterFast(GP_timer, Timer_handler, &m_param2);
if(ret <0)
{
APP_DEBUG("\r\n<--failed!!, Ql_Timer_RegisterFast: GP_timer(%d) fail ,ret = %d -->\r\n",GP_timer,ret);
}
APP_DEBUG("\r\n<--RegisterFast: timerId=%d, param = %d,ret = %d -->\r\n", GP_timer ,m_param1,ret);
//start a timer,repeat=true;
ret = Ql_Timer_Start(Stack_timer,ST_Interval,TRUE);
if(ret < 0)
{
APP_DEBUG("\r\n<--failed!! stack timer Ql_Timer_Start ret=%d-->\r\n",ret);
}
APP_DEBUG("\r\n<--stack timer Ql_Timer_Start(ID=%d,Interval=%d,) ret=%d-->\r\n",Stack_timer,ST_Interval,ret);
//start a GPTimer ,repeat=false
ret = Ql_Timer_Start(GP_timer,GPT_Interval,TRUE);
if(ret < 0)
{
APP_DEBUG("\r\n<--failed!! GP-timer Ql_Timer_Start fail, ret=%d-->\r\n",ret);
}
APP_DEBUG("\r\n<--GP-timer Ql_Timer_Start(ID=%d,Interval=%d) ret=%d-->\r\n",GP_timer,ST_Interval,ret);
// Ql_RIL_Initialize();
// BT_COM_Demo();
// START MESSAGE LOOP OF THIS TASK
while (TRUE)
{
Ql_OS_GetMessage(&msg);
switch(msg.message)
{
case MSG_ID_RIL_READY:
APP_DEBUG("<-- RIL is ready -->\r\n");
Ql_RIL_Initialize();
BT_COM_Demo();
break;
case MSG_ID_USER_START:
break;
default:
break;
}
}
}
Note: I am new to this(Specially task concept How it is working)