Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetNetIf HTTPServer RPCInterface mbed
Fork of HTTPServerExample by
Revision 3:69dbef5163fd, committed 2013-04-15
- Comitter:
- geissme
- Date:
- Mon Apr 15 09:13:21 2013 +0000
- Parent:
- 2:f8e64bf9a474
- Commit message:
- test
Changed in this revision
| HTTPServerExample.cpp | Show annotated file Show diff for this revision Revisions of this file |
| RPCInterface.lib | Show annotated file Show diff for this revision Revisions of this file |
--- a/HTTPServerExample.cpp Fri Jul 09 14:46:03 2010 +0000
+++ b/HTTPServerExample.cpp Mon Apr 15 09:13:21 2013 +0000
@@ -1,15 +1,58 @@
#include "mbed.h"
#include "EthernetNetIf.h"
#include "HTTPServer.h"
+#include "RPCVariable.h"
+#include "RPCFunction.h"
DigitalOut led1(LED1, "led1");
DigitalOut led2(LED2, "led2");
DigitalOut led3(LED3, "led3");
DigitalOut led4(LED4, "led4");
+void setBufferedVariables();
+
+int Flag = 0;
+
+float SwitchingFrequency = 10;
+float FundamentalFrequency = 20;
+float ModulationIndex = 30;
+float PhaseShift12 = 40;
+float PhaseShift23 = 50;
+float DeadTime = 60;
+
+float SwitchingFrequencyBuff = SwitchingFrequency;
+float FundamentalFrequencyBuff = FundamentalFrequency;
+float ModulationIndexBuff = ModulationIndex;
+float PhaseShift12Buff = PhaseShift12;
+float PhaseShift23Buff = PhaseShift23;
+float DeadTimeBuff = DeadTime;
+
+RPCVariable<int> RPCFlag(&Flag, "Flag");
+
+RPCVariable<float> RPCSwitchingFrequency(&SwitchingFrequency, "SwitchingFrequency");
+RPCVariable<float> RPCFundamentalFrequency(&FundamentalFrequency, "FundamentalFrequency");
+RPCVariable<float> RPCModulationIndex(&ModulationIndex, "ModulationIndex");
+RPCVariable<float> RPCPhaseShift12(&PhaseShift12, "PhaseShift12");
+RPCVariable<float> RPCPhaseShift23(&PhaseShift23, "PhaseShift23");
+RPCVariable<float> RPCDeadTime(&DeadTime, "DeadTime");
+
+RPCVariable<float> RPCSwitchingFrequencyBuff(&SwitchingFrequencyBuff, "SwitchingFrequencyBuff");
+RPCVariable<float> RPCFundamentalFrequencyBuff(&FundamentalFrequencyBuff, "FundamentalFrequencyBuff");
+RPCVariable<float> RPCModulationIndexBuff(&ModulationIndexBuff, "ModulationIndexBuff");
+RPCVariable<float> RPCPhaseShift12Buff(&PhaseShift12Buff, "PhaseShift12Buff");
+RPCVariable<float> RPCPhaseShift23Buff(&PhaseShift23Buff, "PhaseShift23Buff");
+RPCVariable<float> RPCDeadTimeBuff(&DeadTimeBuff, "DeadTimeBuff");
+
+
+
LocalFileSystem fs("webfs");
-EthernetNetIf eth;
+EthernetNetIf eth(
+ IpAddr( 192, 168, 0, 128 ), // IP Address
+ IpAddr( 255, 255, 255, 0 ), // Network Mask
+ IpAddr( 192, 168, 0, 254 ), // Gateway
+ IpAddr( 10, 41, 196, 60) // DNS
+);
HTTPServer svr;
int main() {
@@ -36,6 +79,7 @@
svr.bind(80);
printf("Listening...\n");
+
Timer tm;
tm.start();
@@ -43,13 +87,37 @@
while(true)
{
Net::poll();
- if(tm.read()>.5)
+ if(Flag==1){
+ setBufferedVariables();
+ printf("Switching Freq is: %f\n", SwitchingFrequency);
+ printf("Fundamental Freq is: %f\n", FundamentalFrequency);
+ printf("Modulation Index is: %f\n", ModulationIndex);
+ printf("Phase Shift 1-2 is: %f\n", PhaseShift12);
+ printf("Phase Shift 2-3 is: %f\n", PhaseShift23);
+ printf("Deadtime is: %f\n", DeadTime);
+ Flag = 0;
+ }
+ /*
+ if(tm.read()>.1)
{
- led1=!led1; //Show that we are alive
+ led2=!led2; //Show that we are alive
+
+
tm.start();
- }
+
+ }*/
}
return 0;
}
+
+void setBufferedVariables(){
+ SwitchingFrequency = SwitchingFrequencyBuff;
+ FundamentalFrequency = FundamentalFrequencyBuff;
+ ModulationIndex = ModulationIndexBuff;
+ PhaseShift12 = PhaseShift12Buff;
+ PhaseShift23 = PhaseShift23Buff;
+ DeadTime = DeadTimeBuff;
+ printf("Daten schreiben\n");
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RPCInterface.lib Mon Apr 15 09:13:21 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/MichaelW/code/RPCInterface/#682c65afe534
