.net-micro-framework

How do we trouble shoot a long-running NETMF program that stops in production?

一世执手 提交于 2019-12-01 12:28:17
Situtation I have a FEZ Cobra II NET running test code. It sends data every second to a server on the LAN. The server writes the data to a text file. After 27 hours and 97,200 successful sends, the Cobra stops sending. Clearly I am not going to debug for 27 hours, and I am not sure how else to trouble shoot, because standard software trouble shooting approaches do not apply. Question If I were to write to log errors on the Cobra, how would I access them? Does NETMF have application logs? How can we access them? Is there an event viewer? What other trouble shooting / debugging steps are viable

How do we trouble shoot a long-running NETMF program that stops in production?

浪尽此生 提交于 2019-12-01 10:14:37
问题 Situtation I have a FEZ Cobra II NET running test code. It sends data every second to a server on the LAN. The server writes the data to a text file. After 27 hours and 97,200 successful sends, the Cobra stops sending. Clearly I am not going to debug for 27 hours, and I am not sure how else to trouble shoot, because standard software trouble shooting approaches do not apply. Question If I were to write to log errors on the Cobra, how would I access them? Does NETMF have application logs? How

BitArray alternative for the .NET Micro Framework

泪湿孤枕 提交于 2019-12-01 07:02:26
问题 Is there a BitArray alternative for the .NET Micro Framework? I was thinking about simply using a bool[], but how can you convert it back into a byte[] ? In the full framework, considering "bits" is a BitArray, the following works: byte[] data = new byte[dimensions / 8]; bits.CopyTo(data, 0); But I cannot seem to find the BitArray class in the micro framework 回答1: It's not terribly difficult to duplicate the functionality of BitArray . First, if you need fewer than 65 bits, then you can do it

Writing C# debug output to .txt file

久未见 提交于 2019-11-29 01:25:02
I'm running code on a microcontroller with .NET Micro Framework , and I want my debug output to write to a text file. How does this work? Ekk Use Trace . It is designed to do what you need. using System; using System.Diagnostics; class Test { static void Main() { Trace.Listeners.Add(new TextWriterTraceListener("yourlog.log")); Trace.AutoFlush = true; Trace.Indent(); Trace.WriteLine("Entering Main"); Console.WriteLine("Hello World."); Trace.WriteLine("Exiting Main"); Trace.Unindent(); Trace.Flush(); } } The most flexible solution for using a out-of-the-box tracing is to make an application

Converting 'float' to 'byte[4]' and back to 'float' in .NET Micro Framework

匆匆过客 提交于 2019-11-28 00:11:59
What's the best way to convert a float to a byte[4] and then back to a 'float'? I am doing this in C# .NET Micro Framework , so there is no BitConverter available for my use. I've modified the BitConverter class from a Netduino implementation to allow endianness specification (it's not the "best way", but it works). If the byte array is sent over the network, I would use BigEndian . Just a reminder that unsafe is not officially supported in NETMF. using System; using System.Diagnostics; namespace netduino { public static class BitConverter { public static byte[] GetBytes(uint value) { return

Writing C# debug output to .txt file

戏子无情 提交于 2019-11-27 13:02:43
问题 I'm running code on a microcontroller with .NET Micro Framework, and I want my debug output to write to a text file. How does this work? 回答1: Use Trace. It is designed to do what you need. using System; using System.Diagnostics; class Test { static void Main() { Trace.Listeners.Add(new TextWriterTraceListener("yourlog.log")); Trace.AutoFlush = true; Trace.Indent(); Trace.WriteLine("Entering Main"); Console.WriteLine("Hello World."); Trace.WriteLine("Exiting Main"); Trace.Unindent(); Trace