Monday, January 27, 2014

. NET Gadgeteer. NET Micro Framework mail online Device Embedded ET Robocon KINECT For Windows SDK


. NET Gadgeteer. NET Micro Framework mail online Device Embedded ET Robocon KINECT For Windows SDK KINECT SDK Pages Sensor Sensor & Location Platform VC + + Visual Studio 2010 Windows 7 Windows 8 Windows 8.1 Windows Azure Windows Embedded Windows Phone 7 Windows Store app WinRT API WPF XNA Obaka device cooperation built
Archives January 2014 (6) December 2013 (2) November 2013 (2) October 2013 (8) September 2013 (3) August 2013 (4) July 2013 (4) June 2013 (2) May 2013 (1) April 2013 (4 ) March 2013 (3) February 2013 (7) January 2013 (3) December 2012 (3) November 2012 (4) October 2012 (5) September 2012 (10) August 2012 (1) July 2012 (2) June 2012 (2 ) May 2012 (2) March 2012 (6) February 2012 (10) January 2012 (3) December 2011 (8) November 2011 (14) October 2011 (14) September 2011 (6) August 2011 (7) July 2011 (6 ) June 2011 (5) May 2011 (4) April 2011 (3) March 2011 (2) February mail online 2011 (2) November 2010 (4) September 2010 (1) August 2010 (5) July 2010 (1) June 2010 (3 ) May 2010 (2) April 2010 (9) March 2010 (9) February 2010 (5) January 2010 (3) December 2009 (8) November 2009 (9) October 2009 (1) September 2009 (2) July 2009 (1 ) June 2009 (1) May 2009 (1) March 2009 (2) February 2009 (2) January 2009 (2) December 2008 (1) September 2007 (3) August 2007 (1) July 2007 (3) May 2007 (3 )
Notification is sent at any time. Response mail online command is sent as a response when it has sent a reply with a command from the PC. I will provide a loop that always receive transmissions sent from the device. When sending a reply with a command from the PC, enters the waiting after data transmission, when receiving a data packet, determines whether the response of the response with the command or notification, waiting after data transmission if a response is received loop side If Kume logic or buffering, to release, if the notification, such as issuing in an event, it works fine.
private ManualResetEvent mail online mre = new ManualResetEvent (false); private byte lastCommandSent; private List <byte []> receivedMessages = new List <byte []> (); private async Task DataReceive (StreamSocket socket) {DataReader dataReader = new DataReader (socket. InputStream);! while (btSocket = null) {var loadResult = await dataReader.LoadAsync (2); byte [] headerBuffer = new byte [loadResult]; dataReader.ReadBytes (headerBuffer); int lsb = headerBuffer [0]; int msb = headerBuffer [1]; int size = lsb + msb * 256; byte [] readBuffer = new byte [size]; mail online loadResult = await dataReader.LoadAsync (size); dataReader.ReadBytes (readBuffer); if (readBuffer [0]! = {for the / / notification var received = readBuffer.Copy (0, size)};; buffering receivedMessages.Add (received) lock (this) {a / / notification data packet} (byte) CommandType.Reply) else { / / If the response if command (readBuffer [1] == lastCommandSent) {Register LastResponse = readBuffer.Copy response to the command buffer / / receive data (0, size);}

No comments:

Post a Comment