Commit 8a3b42dd by 李维杰

add request logic

parent c58b6f67
...@@ -51,6 +51,6 @@ namespace offcn ...@@ -51,6 +51,6 @@ namespace offcn
} }
void CmdProcesserServer::OnServerMessageArrived(std::string topic, std::string message) void CmdProcesserServer::OnServerMessageArrived(std::string topic, std::string message)
{ {
printf("receive message : topic = %s, context : %s\n", topic.c_str(), message.c_str()); printf("\nreceive message : topic = %s, context : %s\n", topic.c_str(), message.c_str());
} }
} }
\ No newline at end of file
...@@ -22,12 +22,14 @@ ...@@ -22,12 +22,14 @@
<ClCompile Include="..\thirdparty\jsoncpp\src\json_reader.cpp" /> <ClCompile Include="..\thirdparty\jsoncpp\src\json_reader.cpp" />
<ClCompile Include="..\thirdparty\jsoncpp\src\json_value.cpp" /> <ClCompile Include="..\thirdparty\jsoncpp\src\json_value.cpp" />
<ClCompile Include="..\thirdparty\jsoncpp\src\json_writer.cpp" /> <ClCompile Include="..\thirdparty\jsoncpp\src\json_writer.cpp" />
<ClCompile Include="..\thirdparty\mqtt\mqtt_request.cc" />
<ClCompile Include="..\thirdparty\mqtt\mqtt_wrapper.cc" /> <ClCompile Include="..\thirdparty\mqtt\mqtt_wrapper.cc" />
<ClCompile Include="src\cmd_processer_client.cc" /> <ClCompile Include="src\cmd_processer_client.cc" />
<ClCompile Include="src\kcp-client.cpp" /> <ClCompile Include="src\kcp-client.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\thirdparty\jsoncpp\src\json_tool.h" /> <ClInclude Include="..\thirdparty\jsoncpp\src\json_tool.h" />
<ClInclude Include="..\thirdparty\mqtt\mqtt_request.h" />
<ClInclude Include="..\thirdparty\mqtt\mqtt_wrapper.h" /> <ClInclude Include="..\thirdparty\mqtt\mqtt_wrapper.h" />
<ClInclude Include="src\cmd_processer_client.h" /> <ClInclude Include="src\cmd_processer_client.h" />
</ItemGroup> </ItemGroup>
......
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
<ClCompile Include="..\thirdparty\jsoncpp\src\json_writer.cpp"> <ClCompile Include="..\thirdparty\jsoncpp\src\json_writer.cpp">
<Filter>源文件\json</Filter> <Filter>源文件\json</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\thirdparty\mqtt\mqtt_request.cc">
<Filter>源文件\mqtt</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\thirdparty\mqtt\mqtt_wrapper.h"> <ClInclude Include="..\thirdparty\mqtt\mqtt_wrapper.h">
...@@ -50,6 +53,9 @@ ...@@ -50,6 +53,9 @@
<ClInclude Include="..\thirdparty\jsoncpp\src\json_tool.h"> <ClInclude Include="..\thirdparty\jsoncpp\src\json_tool.h">
<Filter>源文件\json</Filter> <Filter>源文件\json</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\thirdparty\mqtt\mqtt_request.h">
<Filter>源文件\mqtt</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\thirdparty\jsoncpp\src\json_valueiterator.inl"> <None Include="..\thirdparty\jsoncpp\src\json_valueiterator.inl">
......
#include "cmd_processer_client.h" #include "cmd_processer_client.h"
#include "mqtt_request.h"
namespace offcn namespace offcn
{ {
...@@ -46,7 +47,7 @@ namespace offcn ...@@ -46,7 +47,7 @@ namespace offcn
printf("subscribe topic success!\n"); printf("subscribe topic success!\n");
std::string topic = kGlobalTopic; std::string topic = kGlobalTopic;
std::string req = "I am Programmer"; std::string req = MqttRequest::JoinRequest(kLocalID);;
mqtt_wrapper_->SendRequest(topic, req); mqtt_wrapper_->SendRequest(topic, req);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment