-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit. Working on a Rest client.
- Loading branch information
1 parent
180aa90
commit 3a8c9c5
Showing
16 changed files
with
814 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef __DEBUG_H__ | ||
#define __DEBUG_H__ | ||
|
||
static const char sChar = 0x2; | ||
static const char eChar = 0x3; | ||
static const char dStringStart = ':'; | ||
|
||
//#define DEBUG | ||
#define DEBUG_LEVEL 0 | ||
|
||
#define DEBUG_LOG(level, message) \ | ||
if (DEBUG_LEVEL >= level) {\ | ||
Serial.print(sChar);\ | ||
Serial.print(dStringStart);\ | ||
Serial.print(message);\ | ||
Serial.print(eChar);\ | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef HARDWARE_H | ||
#define HARDWARE_H | ||
|
||
#define SDFAT_CHIP_SELECT 77 | ||
#define VS1011_RST 73 | ||
#define VS1011_XDCS 72 | ||
#define VS1011_XCS 71 | ||
#define VS1011_DREQ 70 | ||
#define WIFLY_RST 49 | ||
#define WIFLY_GPIO6 76 | ||
#define GREEN_LED 78 | ||
#define RED_LED 79 | ||
|
||
#endif // HARDWARE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "Wifly.h" | ||
#include <SoftwareSerial.h> | ||
WiflyClass Wifly = WiflyClass(2,3); | ||
|
||
void setup() | ||
{ | ||
Serial.begin(9600); | ||
Serial.write("Test"); | ||
Wifly.init(); | ||
Wifly.setConfig("casanova","bitchhunter"); | ||
Wifly.join("casanova"); | ||
Wifly.checkAssociated(); | ||
while(!Wifly.connect("192.168.1.138","90")); | ||
Wifly.writeToSocket("Connected!"); | ||
} | ||
void loop() | ||
{ | ||
if(Wifly.canReadFromSocket()) | ||
{ | ||
Wifly.readFromSocket(); | ||
} | ||
if(Serial.available()) | ||
{ | ||
Wifly.print((char)Serial.read()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 2012 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KegServer", "KegServer.vcxproj", "{89E09E6D-1332-4D67-9ED1-F8171CF54191}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Win32 = Debug|Win32 | ||
Release|Win32 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{89E09E6D-1332-4D67-9ED1-F8171CF54191}.Debug|Win32.ActiveCfg = Debug|Win32 | ||
{89E09E6D-1332-4D67-9ED1-F8171CF54191}.Debug|Win32.Build.0 = Debug|Win32 | ||
{89E09E6D-1332-4D67-9ED1-F8171CF54191}.Release|Win32.ActiveCfg = Release|Win32 | ||
{89E09E6D-1332-4D67-9ED1-F8171CF54191}.Release|Win32.Build.0 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup Label="ProjectConfigurations"> | ||
<ProjectConfiguration Include="Debug|Win32"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|Win32"> | ||
<Configuration>Release</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
</ItemGroup> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>{89E09E6D-1332-4D67-9ED1-F8171CF54191}</ProjectGuid> | ||
<RootNamespace>KegServer</RootNamespace> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | ||
<ConfigurationType>Application</ConfigurationType> | ||
<UseDebugLibraries>true</UseDebugLibraries> | ||
<PlatformToolset>v110</PlatformToolset> | ||
<CharacterSet>MultiByte</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | ||
<ConfigurationType>Application</ConfigurationType> | ||
<UseDebugLibraries>false</UseDebugLibraries> | ||
<PlatformToolset>v110</PlatformToolset> | ||
<WholeProgramOptimization>true</WholeProgramOptimization> | ||
<CharacterSet>MultiByte</CharacterSet> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
<ImportGroup Label="ExtensionSettings"> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<PropertyGroup Label="UserMacros" /> | ||
<PropertyGroup /> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<ClCompile> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>Disabled</Optimization> | ||
<AdditionalIncludeDirectories>C:\Dev\arduino-1.0.4\hardware\arduino\cores\arduino;C:\Dev\arduino-1.0.4\hardware\arduino\variants\standard;C:\Dev\Mine\Keg\KegServer\libraries\SoftwareSerial;C:\Dev\Mine\Keg\KegServer\libraries\SoftwareSerial\utility;c:\dev\arduino-1.0.4\hardware\tools\avr\avr\include\;c:\dev\arduino-1.0.4\hardware\tools\avr\avr\include\avr\;c:\dev\arduino-1.0.4\hardware\tools\avr\avr\;c:\dev\arduino-1.0.4\hardware\tools\avr\lib\gcc\avr\4.3.2\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | ||
<ForcedIncludeFiles>C:\Dev\Mine\Keg\KegServer\KegServer\Visual Micro\.KegServer.vsarduino.h;%(ForcedIncludeFiles)</ForcedIncludeFiles> | ||
<IgnoreStandardIncludePath>true</IgnoreStandardIncludePath> | ||
<PreprocessorDefinitions>ARDUINO=104;__AVR_ATmega328P__;F_CPU=16000000L;__AVR__;__cplusplus;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
</ClCompile> | ||
<Link> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<ClCompile> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>MaxSpeed</Optimization> | ||
<FunctionLevelLinking>true</FunctionLevelLinking> | ||
<IntrinsicFunctions>true</IntrinsicFunctions> | ||
</ClCompile> | ||
<Link> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemGroup> | ||
<None Include="KegServer.ino"> | ||
<FileType>CppCode</FileType> | ||
</None> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="Debug.h" /> | ||
<ClInclude Include="Hardware.h" /> | ||
<ClInclude Include="RestClient.h" /> | ||
<ClInclude Include="RestRequest.h" /> | ||
<ClInclude Include="Visual Micro\.KegServer.vsarduino.h" /> | ||
<ClInclude Include="Wifly.h" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="RestClient.cpp" /> | ||
<ClCompile Include="Wifly.cpp" /> | ||
</ItemGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
<ImportGroup Label="ExtensionTargets"> | ||
</ImportGroup> | ||
<ProjectExtensions> | ||
<VisualStudio> | ||
<UserProperties arduino.board.name="uno" arduino.board.desc="Arduino Uno" arduino.board.property_bag="uno.name=Arduino Uno
uno.upload.protocol=arduino
uno.upload.maximum_size=32256
uno.upload.speed=115200
uno.bootloader.low_fuses=0xff
uno.bootloader.high_fuses=0xde
uno.bootloader.extended_fuses=0x05
uno.bootloader.path=optiboot
uno.bootloader.file=optiboot_atmega328.hex
uno.bootloader.unlock_bits=0x3F
uno.bootloader.lock_bits=0x0F
uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.core=arduino
uno.build.variant=standard
" arduino.build.mcu="atmega328p" arduino.build.f_cpu="16000000L" arduino.build.core="arduino" arduino.upload.protocol="arduino" arduino.upload.speed="115200" arduino.upload.maximum_size="32256" arduino.upload.port="COM3" /> | ||
</VisualStudio> | ||
</ProjectExtensions> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<Filter Include="Source Files"> | ||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> | ||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> | ||
</Filter> | ||
<Filter Include="Header Files"> | ||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> | ||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> | ||
</Filter> | ||
<Filter Include="Resource Files"> | ||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> | ||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> | ||
</Filter> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="KegServer.ino" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="Visual Micro\.KegServer.vsarduino.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
<ClInclude Include="Debug.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
<ClInclude Include="Hardware.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
<ClInclude Include="Wifly.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
<ClInclude Include="RestClient.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
<ClInclude Include="RestRequest.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="Wifly.cpp"> | ||
<Filter>Source Files</Filter> | ||
</ClCompile> | ||
<ClCompile Include="RestClient.cpp"> | ||
<Filter>Source Files</Filter> | ||
</ClCompile> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.