SNIC UART Interface library: Serial to Wi-Fi library for Murata TypeYD Wi-Fi module. For more information about TypeYD: http://www.murata.co.jp/products/microwave/module/lbwb1zzydz/index.html
Dependents: SNIC-xively-jumpstart-demo SNIC-FluentLogger-example TCPEchoServer murataDemo ... more
Fork of YDwifiInterface by
Diff: YDwifi/YDwifiUartCommand.cpp
- Revision:
- 7:e88ccbe0225f
- Parent:
- 3:9f90024d7fb2
--- a/YDwifi/YDwifiUartCommand.cpp Thu Mar 13 10:33:18 2014 +0000
+++ b/YDwifi/YDwifiUartCommand.cpp Fri Mar 14 08:48:12 2014 +0000
@@ -51,6 +51,7 @@
int C_YDwifiUartCommand::wait()
{
int ret = 0;
+
// Get thread ID
mCommandThreadID = osThreadGetId();
@@ -60,13 +61,14 @@
{
ret = -1;
}
+
return ret;
}
int C_YDwifiUartCommand::signal()
{
// set signal
- return osSignalSet(mCommandThreadID, UART_COMMAND_SIGNAL);;
+ return osSignalSet(mCommandThreadID, UART_COMMAND_SIGNAL);
}
bool C_YDwifiUartCommand::isWaitingCommand( unsigned int command_id, unsigned char *payload_p )
@@ -89,11 +91,16 @@
}
tagSCAN_RESULT_T scan_result;
- int ap_count = payload_p[2];
+ int ap_count = payload_p[2];
+
+ if( ap_count == 0 )
+ {
+ mScanResultHandler_p( NULL );
+ }
+
unsigned char *ap_info_p = &payload_p[3];
int ap_info_idx = 0;
-
- printf("%d\r\n", ap_count);
+
for( int i = 0; i < ap_count; i++ )
{
scan_result.channel = ap_info_p[ap_info_idx];
muRata

Murata TypeYD