int getObjectId();
static int getObjectId(char* methodBytes);
int getMethodId();
+ static int getMethodId(char* methodBytes);
void** getMethodParams(string paramCls[], int numParam, void* paramObj[]);
private:
// Need object bytes variable
char retObjBytes[retLen];
returnToBytes(retObj, type, retObjBytes, numRet);
- IoTRMIUtil::printBytes(retObjBytes, retLen, false);
rmiServer->sendBytes(retObjBytes, retLen);
}
char* IoTRMIObject::getMethodBytes() {
// Get method in bytes and update method length
- //fflush(NULL);
+ fflush(NULL);
methodBytes = rmiServer->receiveBytes(methodBytes, &methodLen);
fflush(NULL);
return methodBytes;
}
+// Get methodId from bytes (static version)
+int IoTRMIObject::getMethodId(char* methodBytes) {
+
+ // Get method Id
+ char methodIdBytes[IoTRMIUtil::METHOD_ID_LEN];
+ memcpy(methodIdBytes, methodBytes + IoTRMIUtil::OBJECT_ID_LEN, IoTRMIUtil::METHOD_ID_LEN);
+ // Get method signature
+ int methodId = 0;
+ IoTRMIUtil::byteArrayToInt(&methodId, methodIdBytes);
+
+ return methodId;
+}
+
+
// Get method parameters and return an array of parameter objects
//
// For primitive objects: