.net-micro-framework

How to convert this hex string into a long?

不打扰是莪最后的温柔 提交于 2020-04-12 09:12:30
问题 I have: "0xE94C827CEB" in hex but as a string. Which is: 1002011000043 (dd mm yyyy HH mm ss) Unfortunately I don't know how to do the conversion if I only have it in string format, and I don't have a Convert.ToLong("0xE94C827CEB", 16) function because I'm using the .NET Micro Framework (also, don't have NumberStyles namespace available.) Is there a function out there that will convert this for me? Thanks 回答1: I don't know of any function to do it, but I think you can do it quite simply by

Extension methods with .NET Micro Framework

偶尔善良 提交于 2020-01-02 08:19:29
问题 It seems that extensions methods are not supported/working with the .NET Micro Framework. Is there any way to get this usefull language feature working? 回答1: When you add the ExtensionAttribute class to your project you can use extension methods also in the .NET Micro Framework. namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)] public sealed class ExtensionAttribute : Attribute { } } 来源: https:/

Draw a sphere using 3D pixels (voxels)

♀尐吖头ヾ 提交于 2019-12-30 02:18:27
问题 Can you suggest an algorithm that can draw a sphere in 3D space using only the basic plot(x,y,z) primitive (which would draw a single voxel)? I was hoping for something similar to Bresenham's circle algorithm, but for 3D instead of 2D. FYI, I'm working on a hardware project that is a low-res 3D display using a 3-dimensional matrix of LEDs, so I need to actually draw a sphere, not just a 2D projection (i.e. circle). The project is very similar to this: ... or see it in action here. One

Serving Silverlight apps from the webserver

六月ゝ 毕业季﹏ 提交于 2019-12-25 11:47:34
问题 I am building my own web server and want to serve from it a Silverlight application. Is there anything else I have to do besides setting the mime type and pushing the application through the wire? It probably makes no difference, but the web-server is in C# (the micro-edition). 回答1: No, silverlight is all run on the client, so unless you want to do some webservices or whatever, you needn't do anything other than set the mime-type. It is really just like a separate file that you serve to the

Ideas wanted for analyzing near-realtime data over specific intervals with memory/cpu efficiency

血红的双手。 提交于 2019-12-23 23:45:14
问题 I have some environmental sensors and I want to detect sudden changes in temperature, and slow trends over time... however I'd like to do most of the math based on what's in memory with parameters that may look like this: (subject to change) (note: Items in parens are computed in realtime as data is added) 5 minute (derivative, max, min, avg) + 36 datapoints for most current 3 hours 10 minute (derivative, max, min, avg) + 0 datapoints, calc is based on 5min sample 30 minute (derivative, max,

Is there a compiler switch to turn off support for Generics in C#?

点点圈 提交于 2019-12-22 08:48:59
问题 I am working with a partner where we are trying to move a complex driver from the .NET platform to the .NET MicroFramework. The problem is that the .NET MF doesnt support Generics and when we try to build the application the last "link" operation exits with the error code "CLR_E_PARSER_UNSUPPORTED_GENERICS". There is however no information on WHERE (module, code-line). As far as we know nobody has intentionally inserted Generics and they have been really looking over the code to identify what

Parsing an RFC822-Datetime in .NETMF 4.0

六眼飞鱼酱① 提交于 2019-12-22 07:50:18
问题 I have an application written in .NETMF that requires that I be able to parse an RFC822-Datetime. Normally, this would be easy, but NETMF does not have a DateTime.parse() method, nor does it have some sort of a pattern matching implementation, so I'm pretty much stuck. Any ideas? EDIT: "Intelligent" solutions are probably needed. Part of the reason this is difficult is that the datetime in question has a tendency to have extra spaces in it (but only sometimes). A simple substring solution

Cannot implicity convert type 'int' to 'ushort' : already explicity cast

て烟熏妆下的殇ゞ 提交于 2019-12-21 17:23:32
问题 I am trying to explicity cast an int into a ushort but am getting the Cannot implicity convert type 'int' to 'ushort' ushort quotient = ((12 * (ushort)(channel)) / 16); I am using .Net Micro framework so BitConverter is unavailable. Why I am using ushort in the first place has to do with how my data is being sent over SPI. I can understand this particular error has been brought up before on this site but I cannot see why when I am explicity declaring that I dont care if any data goes missing,

Json Library for .Net Microframework

北城余情 提交于 2019-12-21 12:17:25
问题 I'm running a light webserver using .Net Microframework and I was wondering what libraries would work well for for mainly JSON serialization, but possibly deserialization as well. Problem I've found with a lot of JSON libraries is they use fancy .Net features not available in MF, and are more complicated then what I need. I could easily write a simple library to accomplish my tasks but I was wondering if anything else was available. Thanks 回答1: There is a lightweight JSON parser in the

Dynamics of the using keyword

做~自己de王妃 提交于 2019-12-21 05:04:38
问题 Consider the following code: // module level declaration Socket _client; void ProcessSocket() { _client = GetSocketFromSomewhere(); using (_client) { DoStuff(); // receive and send data Close(); } } void Close() { _client.Close(); _client = null; } Given that that the code calls the Close() method, which closes the _client socket and sets it to null , while still inside the `using' block, what exactly happens behind the scenes? Does the socket really get closed? Are there side effects? P.S.