Loading, please wait.
From the monthly archives: April 2015
We are pleased to present below all posts archived in 'April 2015'. If you still can't find what you are looking for, try using the search box.
Now … I can write something !!
About two weeks ago I received a great present from Secret Labs (thanks to Chris Walker) … the new Netduino 3 Wi-Fi board !
Read the rest of entry »
On April 25, 2015, the Global Azure Bootcamp will be take place at approximately 190 locations worldwide.
Read the rest of entry »
There is a new .Net Micro Framework board in town !
In the past few months, MikroElektronika release the Quail Board as a solution for building hardware prototypes using all the best features of .Net Micro Framework and the related “click” boards for a lot of type of external devices, like sensors (humidity, temperature, …), wifi module, OLED and so on.
Read the rest of entry »
It was and it will be a very busy time for me ... and if you want to hear me talk about the Internet of Things around Italy (and the "world"), you just need to read the agenda of upcoming events !
Tomorrow, on Saturday April 18th, there will be the third edition of the Microsoft Embedded Conference in Naples that has become the Internet of Things Conference organized as always by the DotNetCampania community thanks to the sponsorship of Microsoft Italy.
Read the rest of entry »
The following is most of the code for the JSON Parser state machine function.
Read the rest of entry »
Increments (the enum) the state.
// For many states when its parse requierment is satified: state <-- state++
void IncrementState()
{
parseState = (Expecting)((int)parseState + 1);
}
If in a state of “readiness” checks if the current character is the expected one. If so increment or change the state.
// For states where state increments by one if the expected character is the
// current one in the stream.
BOOL Expect(char c)
{
char ExpectArray[11] = "[{\"X:XX,X]"; //X is don't care
if (c == ExpectArray[parseState])
{
IncrementState();
return true;
}
//A 'fix' to facilitate parsing of JSON strings that aren't arrays:
else if (('{' == c) && (startOfArray == parseState))
{
//Permit parsing of records only
parseState = startOfName;
}
else
{
//Expectation wasn't satified so error
output.print(F("Expected: "));
output.println(ExpectArray[parseState]);
output.print(F("Got: "));
output.println(c);
parseState = error;
output.print(F("Expect Next Err: "));
output.println(parseState);
ErrNo = 10;
return false;
}
return true;
}
The Parser Function is a giant Switch-Case statement.
//The current state of the State Machine
Expecting parseState = startOfArray;
/*
Parses a JSon array of records of name value pairs
*/
BOOL ParseJsonString(char c)
{
switch (parseState)
{
case startOfArray:
result = Expect(c);
if (result)
{
//Start of array so no records yet.
RecordNo = 0;
output.println(F("\r\n1: Starting parse of array."));
}
...
...
...
}
// Parser state machine states:
enum Expecting
{
startOfArray,
startOfRecord,
startOfName,
gettingName,
nameValueSeparator,
startOfValue,
gettingValue,
gettingEndOfValueORRecord,
gotEndOfRecord,
gettingRecordSeparator,
done,
error,
gettingString,
gettingBoolean,
gettingInteger,
gettingFloat,
gettingNull
}
A detailed description of the CEJSON JSON Parser.
Read the rest of entry »
Pages:
Previous123NextReturn Top