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.
Dependents: ThingPlug_Ethernet_Example
Fork of GMMP_mbed by
GMMP_Control.cpp
00001 #include "GMMP_Control.h" 00002 00003 int GMMP_Control_Req(Control_Req* pControl_Req) 00004 { 00005 if(pControl_Req == NULL) 00006 { 00007 return SERVER_INFO_NOT_FOUND; 00008 } 00009 00010 if(CheckSocket() != 0) 00011 { 00012 return SERVER_INFO_NOT_FOUND; 00013 } 00014 00015 int nRet = ReadTCP( (char*)&pControl_Req->header , sizeof(pControl_Req->header) ); 00016 if(nRet == GMMP_SUCCESS) 00017 { 00018 return nRet; 00019 } 00020 00021 ConvertShort cvtshort; 00022 cvtshort.sU8 = 0; 00023 memcpy(cvtshort.usShort, pControl_Req->header.usMessageLength, sizeof(pControl_Req->header.usMessageLength) ); 00024 00025 int nReadSize = ltobs(cvtshort.sU8) - sizeof(pControl_Req->header) ; 00026 00027 return ReadTCP( (char*)&pControl_Req->body, nReadSize); 00028 } 00029 00030 int GMMP_Control_Rsp(Control_Rsp* pControl_Rsp) 00031 { 00032 if(pControl_Rsp == NULL) 00033 { 00034 return SERVER_INFO_NOT_FOUND; 00035 } 00036 00037 if(CheckSocket() != 0) 00038 { 00039 return SERVER_INFO_NOT_FOUND; 00040 } 00041 00042 return WriteTCP( (char*)pControl_Rsp, sizeof(Control_Rsp) ); 00043 } 00044 00045
Generated on Tue Jul 12 2022 21:35:52 by
