void set_operation(int i)
{
   keylist_t *kl=NULL;

   vconf_set_int(vconfkeys[i][0], 1);
   vconf_set_dbl(vconfkeys[i][1], 0.1);
   vconf_set_bool(vconfkeys[i][2], 1);
   vconf_set_str(vconfkeys[i][3], "this is time test");

   kl = vconf_keylist_new();
   vconf_keylist_add_dbl(kl, vconfkeys[i][0], 0.2);
   vconf_keylist_add_bool(kl, vconfkeys[i][1], 0);
   vconf_keylist_add_str(kl, vconfkeys[i][2], "this is time test");
   vconf_keylist_add_int(kl, vconfkeys[i][3], 2);
   vconf_set(kl);
   vconf_keylist_free(kl);
}
Пример #2
0
void *udp_thread_start(void*)
{
	char RecvBuf[MAXLINE];
	struct stMsg *stUdpMsg;
	int nbyte;
	struct sockaddr_in cliaddr;
	int addrlen = sizeof(cliaddr);
	int icnt;
	double progress;
	unsigned a,b;

	global_socket_init();

	while(1)
	{
		ALOGI(
"\n\rNow waiting...\n\r");
	
		memset(RecvBuf, 0, sizeof(RecvBuf));
		nbyte = recvfrom(socket_fd, RecvBuf, MAXLINE , 0, (struct sockaddr *)&cliaddr, (socklen_t *)&addrlen);
		if(nbyte > 0)
		{
			stUdpMsg = (struct stMsg *)RecvBuf;

			printf("\n\r");
			printf("Message ID : 0x%08X \n\r", ntohl(stUdpMsg->ulMsgId));
			printf("1st  Value : %d \n\r", stUdpMsg->ulValue[0]);
			printf("2nd  Value : %d \n\r", stUdpMsg->ulValue[1]);
			printf("3rd  Value : %d \n\r", stUdpMsg->ulValue[2]);
			printf("4th  Value : %d \n\r", stUdpMsg->ulValue[3]);
			printf("File Name  : [%s] \n\r", stUdpMsg->cName);

			switch(ntohl(stUdpMsg->ulMsgId))
			{
				case CONNECTION_RSP:
					printf("Get Connection Rsp Message\n\r");
					printf("Connection complete!!\n\r");
					bConnectionDone = TRUE;
					break;

				case REPORT_DATA_RSP:
					printf("Get Report Rsp Message\n\r");
					break;

				case PUSH_DATA_REQ:
					printf("Get Push Data Req Message\n\r");
					msg_send_func(PUSH_DATA_RSP, "", 0, 0);

					// To Do : process value , Launch Music Player, send Posisition Data
					a = stUdpMsg->ulValue[0];
					b = stUdpMsg->ulValue[1];
					progress = (double)a + ((double)b / 1000.);
					printf("progress is [%8.3f] \n\r", progress);

					vconf_set_dbl("memory/private/org.tizen.music-player/pos", progress);
					/*
					aul_open_app(MUSIC_PLAYER_PKG_NAME);
					printf("start music play\n");
					aul_open_file("/opt/usr/media/Downloads/2.mp3");
					printf("music play\n");
					*/

					playMusic();

					// vconf_set_bool("memory/private/org.tizen.music-player/player_state", 1);

					break;

				default :
					break;
			}
		}

		if(bConnectionDone == FALSE)
		{
			printf("Send Connenction Req Message \n\r");
			msg_send_func(CONNECTION_REQ, "", 0, 0);
			ulSendCount++;
		}

		if(ulSendCount > 5)
		{
			ulSendCount = 0;
			global_socket_init();
		}

		sleep(1);
	}

	close(socket_fd);