bool_t dct_init(void) { vp_os_mutex_init(&dct_start_mutex); vp_os_cond_init(&dct_start_cond, &dct_start_mutex); vp_os_mutex_init(&critical_section); current_io_buffer = NULL; result_io_buffer = NULL; return TRUE; }
void academy_upload_init(void) { if(!academy_upload_started) { vp_os_mutex_init(&academy_upload.mutex); vp_os_cond_init(&academy_upload.cond, &academy_upload.mutex); academy_upload.connected = FALSE; vp_os_memset(&academy_upload.user, 0, sizeof(academy_user_t)); academy_upload_started = TRUE; vp_os_thread_create(thread_academy_upload, (THREAD_PARAMS)&academy_upload, &academy_upload_thread); } }
C_RESULT ardrone_navdata_client_init(void) { C_RESULT res; COM_CONFIG_SOCKET_NAVDATA(&navdata_socket, VP_COM_CLIENT, NAVDATA_PORT, wifi_ardrone_ip); navdata_socket.protocol = VP_COM_UDP; navdata_socket.is_multicast = 1; // enable multicast for Navdata navdata_socket.multicast_base_addr = MULTICAST_BASE_ADDR; vp_os_mutex_init(&navdata_client_mutex); vp_os_cond_init(&navdata_client_condition, &navdata_client_mutex); res = C_OK; return res; }
C_RESULT ardrone_control_init(void) { COM_CONFIG_SOCKET_CONTROL(&control_socket, VP_COM_CLIENT, CONTROL_PORT, wifi_ardrone_ip); control_waited = FALSE; ardrone_state = 0; vp_os_mutex_init(&control_mutex); vp_os_cond_init(&control_cond, &control_mutex); vp_os_mutex_init(&event_queue_mutex); start_index_in_queue = 0; end_index_in_queue = (start_index_in_queue - 1) & (ARDRONE_CONTROL_MAX_NUM_EVENTS_IN_QUEUE - 1); return C_OK; }
void video_stage_init(void) { vp_os_mutex_init(&video_stage_mutex); vp_os_cond_init(&video_stage_condition, &video_stage_mutex); }
C_RESULT videoServer_init() { videoServer_clientList = clientList_create(VIDEOSERVER_MAXCLIENTS); /* Build frame packet buffer */ videoServer_framePacketLength = sizeof(VideoFrameHeader) + videoServer_frameWidth * videoServer_frameHeight * (videoServer_frameBpp / 8); frameBuffer = vp_os_malloc(videoServer_framePacketLength); vp_os_mutex_init(&frameBufferMutex); vp_os_cond_init(&frameBufferCond, &frameBufferMutex); /* Create server socket */ videoServerSocket.type = VP_COM_SERVER; videoServerSocket.protocol = VP_COM_TCP; videoServerSocket.block = VP_COM_DONTWAIT; videoServerSocket.is_multicast = 0; videoServerSocket.port = VIDEO_SERVER_PORT; /* if (FAILED(vp_com_open(&globalCom, &videoServerSocket, NULL, NULL))) { vp_os_cond_destroy(&frameBufferCond); vp_os_mutex_destroy(&frameBufferMutex); vp_os_free(frameBuffer); vp_os_mutex_destroy(&clientListMutex); PRINT("[VideoServer] Unable to open server socket\n"); return C_FAIL; }*/ /* We create the server socket manually, as we need to set the reuse flag before binding it and Parrot's SDK doesn't allow that */ bool_t error = TRUE; videoServerSocket.priv = (void *)socket(AF_INET, SOCK_STREAM, 0); if ((int)videoServerSocket.priv >= 0) { struct sockaddr_in serverAddress; /* Try reusing the address */ int s = 1; setsockopt((int)videoServerSocket.priv, SOL_SOCKET, SO_REUSEADDR, &s, sizeof(int)); /* Bind to address and port */ bzero((char *)&serverAddress, sizeof(serverAddress)); serverAddress.sin_family = AF_INET; serverAddress.sin_addr.s_addr = INADDR_ANY; serverAddress.sin_port = htons(videoServerSocket.port); if (bind((int)videoServerSocket.priv, (struct sockaddr *) &serverAddress, sizeof(struct sockaddr_in)) >= 0) { error = FALSE; } else close((int)videoServerSocket.priv); } if (error) { vp_os_cond_destroy(&frameBufferCond); vp_os_mutex_destroy(&frameBufferMutex); vp_os_free(frameBuffer); if (videoServer_clientList != NULL) { clientList_destroy(videoServer_clientList); videoServer_clientList = NULL; } PRINT("[VideoServer] Unable to open server socket\n"); return C_FAIL; } /* Set server socket timeout */ struct timeval tm; tm.tv_sec = 0; tm.tv_usec = ACCEPT_TIMEOUT * 1e6; setsockopt((int32_t)videoServerSocket.priv, SOL_SOCKET, SO_RCVTIMEO, &tm, sizeof(tm)); videoTranscoder_init(); videoServerStarted = TRUE; vp_os_mutex_init(&settingsMutex); return C_OK; }
DEFINE_THREAD_ROUTINE(main_application_thread, data) { /* Mutexes for synchronisation */ vp_os_mutex_init(&test_mutex); vp_os_cond_init(&test_condition,&test_mutex); vp_os_delay(1000); //fflush(stdin); printf("[IMPORTANT] Please check you deleted all configuration files on the drone before starting.\n"); printf("\n Resetting the drone to the default configuration \n"); /* Switch to the default configuration file */ /* Always start by setting the session, then the application, then the user */ set_string(session_id,"00000000"); set_string(application_id,"00000000"); set_string(profile_id,"00000000"); /* Suppress all other settings. A session and an application were automatically created * at application startup by ARDrone Tool ; we must delete them. * The '-' symbol means 'delete'. * '-all' deletes all the existing configurations. */ set_string(session_id,"-all"); set_string(application_id,"-all"); set_string(profile_id,"-all"); set_int(navdata_demo,1); mypause(); /* Ask the drone configuration and compare it to the expected values */ /* Send time to the drone */ //gettimeofday(&tv,NULL); //set_int(time,(int32_t)tv.tv_sec); title("\nGetting the drone configuration ...\n"); ARDRONE_TOOL_CONFIGURATION_GET(test_callback); vp_os_cond_wait(&test_condition); title("Comparing received values to the config_keys.h defaults ...\n"); #define ARDRONE_CONFIG_KEY_IMM_a9(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK,SCOPE) \ test_float(NAME,DEFAULT); #undef ARDRONE_CONFIG_KEY_REF_a9 #define ARDRONE_CONFIG_KEY_STR_a9(KEY, NAME, INI_TYPE, C_TYPE, C_TYPE_PTR, RW, DEFAULT, CALLBACK,SCOPE) \ test_string(NAME,DEFAULT); #include <config_keys.h> /* Modify one value of each category and see what happens */ /* To test the 'COMMON' category */ set_string(ardrone_name,"TEST_CONFIG"); /* To test the 'APPLIS' category */ test_nint(bitrate_ctrl_mode,1); /* 0 is the default value */ set_int(bitrate_ctrl_mode,1); /* To test the 'PROFILE' (aka. 'USER') category */ test_nfloat(outdoor_euler_angle_max,F1); set_float(outdoor_euler_angle_max,F1); /* To test the 'SESSION' category */ test_string(leds_anim,"0,0,0"); set_string(leds_anim,"1,1,1"); test_string(application_id,"00000000"); test_string(profile_id,"00000000"); test_string(session_id,"00000000"); title("\nGetting the drone configuration ...\n"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG"); /* CAT_COMMON param */ test_int(bitrate_ctrl_mode,1); /* CAT_APPLI param */ test_float(outdoor_euler_angle_max,F1); /* CAT_USER param */ test_string(leds_anim,"1,1,1"); /* CAT_SESSION param */ test_string(application_id,"00000000"); test_string(profile_id,"00000000"); test_string(session_id,"00000000"); test_string(application_desc , DEFAULT_APPLICATION_DESC); test_string(profile_desc, DEFAULT_PROFILE_DESC); test_string(session_desc, DEFAULT_SESSION_DESC); /*---------------------------------------------------------------------------------------------------------*/ /* Create an application configuration file */ title("\nCreating the application ID 11111111 ...\n"); set_string(application_id,"11111111"); set_string(application_desc,APPDESC1); title("\nGetting the drone configuration ...\n"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG"); /* CAT_COMMON param; its value should not be changed by creating an application config. */ test_int(bitrate_ctrl_mode,0); /* 0 is the default value ; default values are affected to newly created configurations */ test_float(outdoor_euler_angle_max,F1); /* CAT_USER param ; its value should not be changed by creating an application config. */ test_int(detect_type,CAD_TYPE_NONE); /* CAT_SESSION param; its value should not be changed by creating an application config. */ test_string(application_id,"11111111"); test_string(profile_id,"00000000"); test_string(session_id,"00000000"); test_string(application_desc,APPDESC1); test_string(profile_desc, DEFAULT_PROFILE_DESC); test_string(session_desc, DEFAULT_SESSION_DESC); set_int(bitrate_ctrl_mode,1); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG"); test_int(bitrate_ctrl_mode,1); set_int(bitrate_ctrl_mode,0); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG"); test_int(bitrate_ctrl_mode,0); mypause(); title("\nGoing back to the default application configuration ...\n"); set_string(application_id,"00000000"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG"); test_int(bitrate_ctrl_mode,1); /* 1 was the value of the config.ini configuration */ test_float(outdoor_euler_angle_max,F1); test_int(detect_type,CAD_TYPE_NONE); test_string(application_id,"00000000"); test_string(profile_id,"00000000"); test_string(session_id,"00000000"); test_string(application_desc,DEFAULT_APPLICATION_DESC); test_string(profile_desc, DEFAULT_PROFILE_DESC); test_string(session_desc, DEFAULT_SESSION_DESC); mypause(); title(" Going back to the newly created application configuration ...\n"); set_string(application_id,"11111111"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG"); test_int(bitrate_ctrl_mode,0); test_float(outdoor_euler_angle_max,F1); test_int(detect_type,CAD_TYPE_NONE); test_string(application_id,"11111111"); test_string(profile_id,"00000000"); test_string(session_id,"00000000"); test_string(application_desc , APPDESC1); test_string(profile_desc, DEFAULT_PROFILE_DESC); test_string(session_desc, DEFAULT_SESSION_DESC); set_string(application_id,"00000000"); mypause(); /*-----------------------------------------------------------------------------------------------*/ /* Create a user profile configuration file */ title("\nCreating the user profile ID 22222222 ...\n"); set_string(profile_id,"22222222"); set_string(profile_desc,PROFDESC2); title("\nGetting the drone configuration ...\n"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG"); test_int(bitrate_ctrl_mode,1); /* 1 was the value of the config.ini configuration */ test_float(outdoor_euler_angle_max,default_outdoor_euler_angle_ref_max); test_int(detect_type,CAD_TYPE_NONE); test_string(application_id,"00000000"); test_string(profile_id,"22222222"); test_string(session_id,"00000000"); test_string(application_desc , DEFAULT_APPLICATION_DESC); test_string(profile_desc, PROFDESC2);//DEFAULT_PROFILE_DESC test_string(session_desc, DEFAULT_SESSION_DESC); set_float(outdoor_euler_angle_max,F2); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} mypause(); title("\nGoing back to the default user profile configuration ...\n"); set_string(profile_id,"00000000"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} /* The default value for this is 1 after the first test */ test_string(ardrone_name,"TEST_CONFIG"); test_int(bitrate_ctrl_mode,1); /* 1 was the value of the config.ini configuration */ test_float(outdoor_euler_angle_max,F1); test_int(detect_type,CAD_TYPE_NONE); test_string(application_id,"00000000"); test_string(profile_id,"00000000"); test_string(session_id,"00000000"); test_string(application_desc , DEFAULT_APPLICATION_DESC); test_string(profile_desc, DEFAULT_PROFILE_DESC); test_string(session_desc, DEFAULT_SESSION_DESC); mypause(); title(" Going back to the newly created user profile configuration ...\n"); set_string(profile_id,"22222222"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG"); test_int(bitrate_ctrl_mode,1); /* 1 was the value of the config.ini configuration */ test_float(outdoor_euler_angle_max,F2); test_int(detect_type,CAD_TYPE_NONE); test_string(ardrone_name,"TEST_CONFIG"); test_string(application_id,"00000000"); test_string(profile_id,"22222222"); test_string(session_id,"00000000"); test_string(application_desc , DEFAULT_APPLICATION_DESC); test_string(profile_desc, PROFDESC2);//DEFAULT_PROFILE_DESC test_string(session_desc, DEFAULT_SESSION_DESC); set_string(profile_id,"00000000"); mypause(); /*-----------------------------------------------------------------------------------------------*/ /* Create a session configuration file */ title("\nCreating the session ID 33333333 ...\n"); set_string(session_id,"33333333"); title("\nGetting the drone configuration ...\n"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG"); /* CAT_COMMON param; its value should not be changed by creating a session */ test_int(bitrate_ctrl_mode,1); /* CAT_APPLI param; its value should not be changed by creating a session */ test_float(outdoor_euler_angle_max,F1); /* value in default config.ini */ test_int(detect_type,CAD_TYPE_NONE); /* CAT_SESSION param; its value should be the default one */ test_string(application_id,"00000000"); test_string(profile_id,"00000000"); test_string(session_id,"33333333"); test_string(application_desc , DEFAULT_APPLICATION_DESC); test_string(profile_desc, DEFAULT_PROFILE_DESC); test_string(session_desc, DEFAULT_SESSION_DESC ); //DEFAULT_SESSION_DESC); /* Test changing a value in the session */ set_int(detect_type,CAD_TYPE_VISION); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_int(detect_type,CAD_TYPE_VISION); mypause(); title("\nGoing back to the default session configuration ...\n"); set_string(session_id,"00000000"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG"); test_int(bitrate_ctrl_mode,1); /* value in default config.ini */ test_float(outdoor_euler_angle_max,F1); /* value in default config.ini */ test_int(detect_type,CAD_TYPE_NONE); test_string(application_id,"00000000"); test_string(profile_id,"00000000"); test_string(session_id,"00000000"); test_string(application_desc , DEFAULT_APPLICATION_DESC); test_string(profile_desc, DEFAULT_PROFILE_DESC); test_string(session_desc, DEFAULT_SESSION_DESC); mypause(); title(" Going back to the newly created session configuration ...\n"); set_string(session_id,"33333333"); set_string(session_desc,SESSDESC3); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG"); test_int(bitrate_ctrl_mode,1); /* value in default config.ini */ test_float(outdoor_euler_angle_max,F1); /* value in default config.ini */ test_int(detect_type,CAD_TYPE_VISION); test_string(ardrone_name,"TEST_CONFIG"); test_string(application_id,"00000000"); test_string(profile_id,"00000000"); test_string(session_id,"33333333"); test_string(application_desc , DEFAULT_APPLICATION_DESC); test_string(profile_desc, DEFAULT_PROFILE_DESC); test_string(session_desc, SESSDESC3 ); //DEFAULT_SESSION_DESC); set_int(detect_type,CAD_TYPE_COCARDE); set_string(session_id,"00000000"); mypause(); /*-----------------------------------------------------------------------------------------------*/ /* Create a session configuration file */ title("\nCreating the session ID 44444444 ...\n"); set_string(session_id,"44444444"); title("\nGetting the drone configuration ...\n"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_int(detect_type,CAD_TYPE_NONE); test_string(ardrone_name,"TEST_CONFIG"); test_int(bitrate_ctrl_mode,1); test_string(application_id,"00000000"); test_string(profile_id,"00000000"); test_string(session_id,"44444444"); test_string(application_desc , DEFAULT_APPLICATION_DESC); test_string(profile_desc, DEFAULT_PROFILE_DESC); test_string(session_desc, DEFAULT_SESSION_DESC ); //FAULT_SESSION_DESC); set_int(detect_type,CAD_TYPE_VISION); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_int(detect_type,CAD_TYPE_VISION); set_string(application_id,"11111111"); set_string(profile_id,"22222222"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG"); set_string(ardrone_name,"TEST_CONFIG2"); test_string(application_id,"11111111"); test_string(profile_id,"22222222"); test_string(session_id,"44444444"); test_string(application_desc , APPDESC1); test_string(profile_desc, PROFDESC2); test_string(session_desc, DEFAULT_SESSION_DESC); mypause(); while(1){ title("\nGoing back to the default session ...\n"); set_string(session_id,"00000000"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG2"); test_int(bitrate_ctrl_mode,1); test_string(application_id,"00000000"); test_string(profile_id,"00000000"); test_string(session_id,"00000000"); test_string(application_desc , DEFAULT_APPLICATION_DESC); test_string(profile_desc, DEFAULT_PROFILE_DESC); test_string(session_desc, DEFAULT_SESSION_DESC); mypause(); title("\nGoing back to the 44444444 session ...\n"); set_string(session_id,"44444444"); set_string(session_desc,SESSDESC4); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG2"); test_int(bitrate_ctrl_mode,0); test_string(application_id,"11111111"); test_string(profile_id,"22222222"); test_string(session_id,"44444444"); test_string(application_desc , APPDESC1); test_string(profile_desc, PROFDESC2); test_string(session_desc, SESSDESC4); mypause(); title("\nGoing back to the default session ...\n"); set_string(session_id,"00000000"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG2"); set_string(ardrone_name,"TEST_CONFIG3"); test_string(application_id,"00000000"); test_string(profile_id,"00000000"); test_string(session_id,"00000000"); test_string(application_desc , DEFAULT_APPLICATION_DESC); test_string(profile_desc, DEFAULT_PROFILE_DESC); test_string(session_desc, DEFAULT_SESSION_DESC); mypause(); title(" Going back to the 33333333 session ...\n"); set_string(session_id,"33333333"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG3"); test_int(bitrate_ctrl_mode,1); /* value in default config.ini */ test_float(outdoor_euler_angle_max,F1); /* value in default config.ini */ test_int(detect_type,CAD_TYPE_COCARDE); test_string(application_id,"00000000"); test_string(profile_id,"00000000"); test_string(session_id,"33333333"); test_string(application_desc , DEFAULT_APPLICATION_DESC); test_string(profile_desc, DEFAULT_PROFILE_DESC); test_string(session_desc, SESSDESC3); mypause(); title("\nGoing back to the 44444444 session ...\n"); set_string(session_id,"44444444"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG3"); set_string(ardrone_name,"TEST_CONFIG4"); test_int(bitrate_ctrl_mode,0); test_float(outdoor_euler_angle_max,F2); test_int(detect_type,CAD_TYPE_VISION); test_string(application_id,"11111111"); test_string(profile_id,"22222222"); test_string(session_id,"44444444"); test_string(application_desc , APPDESC1); test_string(profile_desc, PROFDESC2); test_string(session_desc, SESSDESC4); mypause(); title(" Going back to the 33333333 session ...\n"); set_string(session_id,"33333333"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_int(bitrate_ctrl_mode,1); test_int(detect_type,CAD_TYPE_COCARDE); test_string(ardrone_name,"TEST_CONFIG4"); test_int(bitrate_ctrl_mode,1); test_float(outdoor_euler_angle_max,F1); test_string(application_id,"00000000"); test_string(profile_id,"00000000"); test_string(session_id,"33333333"); test_string(application_desc , DEFAULT_APPLICATION_DESC); test_string(profile_desc, DEFAULT_PROFILE_DESC); test_string(session_desc, SESSDESC3); mypause(); title("\nGoing back to the default session ...\n"); set_string(session_id,"00000000"); {ARDRONE_TOOL_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} test_string(ardrone_name,"TEST_CONFIG4"); /* common parameter whose value should never be reset */ test_int(bitrate_ctrl_mode,1); test_float(outdoor_euler_angle_max,F1); test_int(detect_type,CAD_TYPE_NONE); test_string(application_id,"00000000"); test_string(profile_id,"00000000"); test_string(session_id,"00000000"); test_string(application_desc , DEFAULT_APPLICATION_DESC); test_string(profile_desc, DEFAULT_PROFILE_DESC); test_string(session_desc, DEFAULT_SESSION_DESC); set_string(ardrone_name,"TEST_CONFIG2"); mypause(); /*-----------------------------------------------------------------------------------------------*/ /* Read the list of custom configurations */ title("\nReading the list of custom configuration files ...\n"); {ARDRONE_TOOL_CUSTOM_CONFIGURATION_GET(test_callback);vp_os_cond_wait(&test_condition);} printf("\n\n ====================================== \n\n"); if(available_configurations[CAT_APPLI].nb_configurations!=1) { printf("Bad number of custom applis.\n"); } if(available_configurations[CAT_USER].nb_configurations!=1) { printf("Bad number of custom applis.\n"); } if(available_configurations[CAT_SESSION].nb_configurations!=2) { printf("Bad number of custom applis.\n"); } if (available_configurations[CAT_APPLI].list[0].id==NULL) { printf("Unexpected custom app 0 NULL\n"); } else if (strcmp(available_configurations[CAT_APPLI].list[0].id,"11111111")) { printf("Unexpected custom app : <%s>\n",available_configurations[CAT_APPLI].list[0].id); } if (available_configurations[CAT_USER].list[0].id==NULL) { printf("Unexpected custom user 0 NULL\n"); } else if (strcmp(available_configurations[CAT_USER].list[0].id,"22222222")) { printf("Unexpected custom profile : <%s>\n",available_configurations[CAT_USER].list[0].id); } if (available_configurations[CAT_SESSION].list[0].id==NULL) { printf("Unexpected custom session 0 NULL\n"); } else if (strcmp(available_configurations[CAT_SESSION].list[0].id,"33333333")) { printf("Unexpected custom session 0 : <%s>\n",available_configurations[CAT_SESSION].list[0].id); } if (available_configurations[CAT_SESSION].list[1].id==NULL) { printf("Unexpected custom session 1 NULL\n"); } else if (strcmp(available_configurations[CAT_SESSION].list[1].id,"44444444")) { printf("Unexpected custom session 1 : <%s>\n",available_configurations[CAT_SESSION].list[1].id); } if (available_configurations[CAT_APPLI].list[0].description==NULL) { printf("Unexpected custom appli descrition 0 NULL\n"); } else if (strcmp(available_configurations[CAT_APPLI].list[0].description,APPDESC1)) { printf("Unexpected custom app description : <%s>\n",available_configurations[CAT_APPLI].list[0].description); } if (available_configurations[CAT_USER].list[0].description==NULL) { printf("Unexpected custom user 0 description NULL\n"); } else if (strcmp(available_configurations[CAT_USER].list[0].description,PROFDESC2)) { printf("Unexpected custom profile description : <%s>\n",available_configurations[CAT_USER].list[0].description); } if (available_configurations[CAT_SESSION].list[0].description==NULL) { printf("Unexpected custom session 0 description NULL\n"); } else if (strcmp(available_configurations[CAT_SESSION].list[0].description,SESSDESC3)) { printf("Unexpected custom session 0 description : <%s>\n",available_configurations[CAT_SESSION].list[0].description); } if (available_configurations[CAT_SESSION].list[1].description==NULL) { printf("Unexpected custom session 1 description NULL\n"); } else if (strcmp(available_configurations[CAT_SESSION].list[1].description,SESSDESC4)) { printf("Unexpected custom session 1 description : <%s>\n",available_configurations[CAT_SESSION].list[1].description); } printf(" Custom config list checked.\n"); mypause(); /*-----------------------------------------------------------------------------------------------*/ printf("\n\n ====================================== \n\n"); title("\nEnd of the test.\n"); } }
void video_recorder_init (void) { vp_os_mutex_init (&video_recorder_mutex); vp_os_cond_init (&video_recorder_condition, &video_recorder_mutex); isInit = TRUE; }