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_Delivery.cpp
00001 #include "GMMP_Delivery.h" 00002 00003 int GMMP_Delivery_Req(Delivery_Req* pDelivery_Req, int nPacketSize) 00004 { 00005 if(pDelivery_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 return WriteTCP((char*)pDelivery_Req, nPacketSize); 00016 } 00017 00018 int GMMP_Delivery_Rsp(Delivery_Rsp* pDelivery_Rsp) 00019 { 00020 if(pDelivery_Rsp == NULL) 00021 { 00022 return SERVER_INFO_NOT_FOUND; 00023 } 00024 00025 if(CheckSocket() != 0) 00026 { 00027 return SERVER_INFO_NOT_FOUND; 00028 } 00029 00030 int nRet = ReadTCP((char*)&pDelivery_Rsp->header, sizeof(pDelivery_Rsp->header)); 00031 if(nRet != GMMP_SUCCESS) 00032 { 00033 return nRet; 00034 } 00035 00036 ConvertShort cvtshort; 00037 cvtshort.sU8 = 0; 00038 memcpy(cvtshort.usShort, pDelivery_Rsp->header.usMessageLength, sizeof(pDelivery_Rsp->header.usMessageLength)); 00039 00040 int nReadSize = ltobs(cvtshort.sU8)- sizeof(pDelivery_Rsp->header); 00041 00042 return ReadTCP((char*)&pDelivery_Rsp->body, nReadSize); 00043 } 00044
Generated on Tue Jul 12 2022 21:35:52 by
