This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

UDP socket in AP mode hangs on !IS_IP_ACQUIRED(g_ulStatus)

Other Parts Discussed in Thread: CC3200

Hi,

I write an application to send and receive message between client and server use CC3200 launchpad as server and android phone as client.

I modified the UDP socket demo by change the code configure device in STA mode to conficgure device in AP mode.

Default code :

	lRetVal = ConfigureSimpleLinkToDefaultState();

	if (lRetVal < 0) {
		if (DEVICE_NOT_IN_STATION_MODE == lRetVal)
			UART_PRINT(
					"Failed to configure the device in its default state \n\r");
		LOOP_FOREVER()
		;
	}

	UART_PRINT("Device is configured in default state \n\r");

	//
	// Asumption is that the device is configured in station mode already
	// and it is in its default state
	//
	lRetVal = sl_Start(0, 0, 0);
	if (lRetVal < 0 || lRetVal != ROLE_STA) {
		UART_PRINT("Failed to start the device \n\r");
		LOOP_FOREVER()
		;
	}

	UART_PRINT("Device started as STATION \n\r");

	UART_PRINT("Connecting to AP: %s ...\r\n", SSID_NAME);

	//
	//Connecting to WLAN AP
	//
	lRetVal = WlanConnect();
	if (lRetVal < 0) {
		UART_PRINT("Failed to establish connection w/ an AP \n\r");
		LOOP_FOREVER()
		;
	}

	UART_PRINT("Connected to AP: %s \n\r", SSID_NAME);

	UART_PRINT("Device IP: %d.%d.%d.%d\n\r\n\r", SL_IPV4_BYTE(g_ulIpAddr, 3),
			SL_IPV4_BYTE(g_ulIpAddr, 2), SL_IPV4_BYTE(g_ulIpAddr, 1),
			SL_IPV4_BYTE(g_ulIpAddr, 0));

My code :

//	lRetVal = ConfigureSimpleLinkToDefaultState();
//
//	UART_PRINT("Device is configured in default state \n\r");
//	//
//	// Asumption is that the device is configured in station mode already
//	// and it is in its default state. Open simplelink device
//	//
//	lRetVal = sl_Start(0, 0, 0);
//
//	if (lRetVal < 0) {
//		UART_PRINT("Failed to start the device \n\r");
//		LOOP_FOREVER();
//	}
//
//	UART_PRINT("Device started as STATION \n\r");
//	if (lRetVal != ROLE_AP) {
//		if (ConfigureMode(lRetVal) != ROLE_AP) {
//			UART_PRINT("Unable to set AP mode, exiting Application...\n\r");
//			sl_Stop(SL_STOP_TIMEOUT);
//			LOOP_FOREVER();
//		}
//	}
//	while (!IS_IP_ACQUIRED(g_ulStatus)) {  <<==== I'm stuck here
//		//looping till ip is acquired
//	}

Default code work ok, but my code have a problem that it hang on IS_IP_ACQUIRED(g_ulStatus). Look like it loop forever

With my code device is in AP mode - I think - I can find and connect my phone to device's access point.

Can someone give me an instruction ??