Skip to main content

Posts

Showing posts from May, 2014

Memory efficient queuing of variable length elements

In embedded environments memory can be a critical driver of the design of data structures and containers. Computing resources have been expanding steadily each year but there are still a wide range of systems with far less than a megabyte of memory. On systems with tens of kilobytes of memory, structures are often designed to be compact to maximize data density. Rather than splurging on memory aligned elements that would be faster for the processor to access, a developer will typically use types with minimal sizes based on the known range of values that the element is intending to hold. Fixed sized buffers At my day job a fixed size pool of messages was implemented to hold message data. While this achieved one design goal of using statically allocated buffers, avoiding dynamic allocations that might fail at runtime, it isn't efficient if there is a wide range of message sizes. It isn't efficient because each message uses a message buffer. With small message sizes the buff...

Yocto recipe SRC_URI for a BitBucket / GitHub ssh git repository

This is a particularly geeky post but because Google searches didn't turn up any information I thought it would be helpful to document the issue and solution for others. I was writing  Yocto recipes that pulled from BitBucket git repositories in ssh form and ran into several issues getting a SRC_URI that worked. GitHub uses the same syntax for their ssh repositories. A BitBucket / GitHub git url, in ssh form, looks like: < username >@bitbucket.org:< account name >/< repository name >.git a more concrete example for a git repository in one of my BitBucket accounts looks like: git@bitbucket.org:cmorgan/somerepository.git Yocto recipes can pull from git repositories by setting the SRC_URI variable appropriately. Unfortunately you can't just do: SRC_URI = "git@bitbucket.org:cmorgan/somerepository.git You'll get errors because the Yocto won't know what kind of url this is. You need to specify the protocol for Yocto to k...

SharpPcap's 10 year anniversary

I was updating the CodeProject SharpPcap tutorial  and noticed that it's been 10 years since the project was originally started. If you've ever been interested in trying out packet capture and network analysis, SharpPcap provides a pretty easy way to get started. The source download package comes with several examples that are easy to build under Visual Studio or MonoDevelop . Check out the CodeProject tutorial. If you have any questions you can post on the forums there or on the SourceForge project page . Some work on network packet analysis got me looking for libraries that could help. I wanted to develop the analysis application in C#/.NET to reduce the overall development time vs. C/C++. Rather than reinventing the wheel it seemed useful to build on the SharpPcap library, created in 2004. The original author, Tamir Gal, passed the maintenance of the project over to me in 2008. Since then the codebase has been rewritten and cleaned up, unit tests added, and the packet p...