33 #include "libIARMCore.h"
37 #include "safec_lib.h"
45 printf(
"mfrClient Entering %d\r\n", getpid());
48 errno_t safec_rc = -1;
54 param->
type = mfrSERIALIZED_TYPE_MANUFACTURER;
59 if(ret != IARM_RESULT_SUCCESS)
61 printf(
"Call failed for %s: error code:%d\n",
"mfrSERIALIZED_TYPE_MANUFACTURER",ret);
65 len = param->bufLen + 1;
66 pTmpStr = (
char *)malloc(len);
67 safec_rc = memset_s(pTmpStr, len, 0, len);
69 safec_rc = memcpy_s(pTmpStr, len, param->buffer, param->bufLen);
77 printf(
"%s returned (%d)::%s ",
"mfrSERIALIZED_TYPE_MANUFACTURER",ret, pTmpStr);
80 IARM_Free(IARM_MEMTYPE_PROCESSLOCAL,param);
83 param->type = mfrSERIALIZED_TYPE_MANUFACTUREROUI;
88 if(ret != IARM_RESULT_SUCCESS)
90 printf(
"Call failed for %s: error code:%d\n",
"mfrSERIALIZED_TYPE_MANUFACTUREROUI",ret);
94 len = param->bufLen + 1;
95 pTmpStr = (
char *)malloc(len);
96 safec_rc = memset_s(pTmpStr, len, 0, len);
98 safec_rc = memcpy_s(pTmpStr, len, param->buffer, param->bufLen);
106 printf(
"%s returned (%d)::%s",
"mfrSERIALIZED_TYPE_MANUFACTUREROUI",ret,pTmpStr);
109 IARM_Free(IARM_MEMTYPE_PROCESSLOCAL,param);
111 param->type = mfrSERIALIZED_TYPE_MODELNAME;
116 if(ret != IARM_RESULT_SUCCESS)
118 printf(
"Call failed for %s: error code:%d\n",
"mfrSERIALIZED_TYPE_MODELNAME",ret);
122 len = param->bufLen + 1;
123 pTmpStr = (
char *)malloc(len);
124 safec_rc = memset_s(pTmpStr, len, 0, len);
126 safec_rc = memcpy_s(pTmpStr, len, param->buffer, param->bufLen);
134 printf(
"%s returned (%d)::%s",
"mfrSERIALIZED_TYPE_MODELNAME",ret,pTmpStr);
137 IARM_Free(IARM_MEMTYPE_PROCESSLOCAL,param);
140 param->type = mfrSERIALIZED_TYPE_DESCRIPTION;
145 if(ret != IARM_RESULT_SUCCESS)
147 printf(
"Call failed for %s: error code:%d\n",
"mfrSERIALIZED_TYPE_DESCRIPTION",ret);
151 len = param->bufLen + 1;
152 pTmpStr = (
char *)malloc(len);
153 safec_rc = memset_s(pTmpStr, len, 0, len);
155 safec_rc = memcpy_s(pTmpStr, len, param->buffer, param->bufLen);
163 printf(
"%s returned (%d)::%s",
"mfrSERIALIZED_TYPE_DESCRIPTION",ret,pTmpStr);
166 IARM_Free(IARM_MEMTYPE_PROCESSLOCAL,param);
168 param->type = mfrSERIALIZED_TYPE_PRODUCTCLASS;
173 if(ret != IARM_RESULT_SUCCESS)
175 printf(
"Call failed for %s: error code:%d\n",
"mfrSERIALIZED_TYPE_PRODUCTCLASS",ret);
179 len = param->bufLen + 1;
180 pTmpStr = (
char *)malloc(len);
181 safec_rc = memset_s(pTmpStr, len, 0, len);
183 safec_rc = memcpy_s(pTmpStr, len, param->buffer, param->bufLen);
191 printf(
"%s returned (%d)::%s",
"mfrSERIALIZED_TYPE_PRODUCTCLASS",ret,pTmpStr);
194 IARM_Free(IARM_MEMTYPE_PROCESSLOCAL,param);
196 param->type = mfrSERIALIZED_TYPE_SERIALNUMBER;
201 if(ret != IARM_RESULT_SUCCESS)
203 printf(
"Call failed for %s: error code:%d\n",
"mfrSERIALIZED_TYPE_SERIALNUMBER",ret);
207 len = param->bufLen + 1;
208 pTmpStr = (
char *)malloc(len);
209 safec_rc = memset_s(pTmpStr, len, 0, len);
211 safec_rc = memcpy_s(pTmpStr, len, param->buffer, param->bufLen);
219 printf(
"%s returned (%d)::%s",
"mfrSERIALIZED_TYPE_SERIALNUMBER",ret,pTmpStr);
223 IARM_Free(IARM_MEMTYPE_PROCESSLOCAL,param);
225 param->type = mfrSERIALIZED_TYPE_HARDWAREVERSION;
230 if(ret != IARM_RESULT_SUCCESS)
232 printf(
"Call failed for %s: error code:%d\n",
"mfrSERIALIZED_TYPE_HARDWAREVERSION",ret);
236 len = param->bufLen + 1;
237 pTmpStr = (
char *)malloc(len);
238 safec_rc = memset_s(pTmpStr, len, 0, len);
240 safec_rc = memcpy_s(pTmpStr, len, param->buffer, param->bufLen);
248 printf(
"%s returned (%d)::%s",
"mfrSERIALIZED_TYPE_HARDWAREVERSION",ret,pTmpStr);
251 IARM_Free(IARM_MEMTYPE_PROCESSLOCAL,param);
253 param->type = mfrSERIALIZED_TYPE_SOFTWAREVERSION;
258 if(ret != IARM_RESULT_SUCCESS)
260 printf(
"Call failed for %s: error code:%d\n",
"mfrSERIALIZED_TYPE_SOFTWAREVERSION",ret);
264 len = param->bufLen + 1;
265 pTmpStr = (
char *)malloc(len);
266 safec_rc = memset_s(pTmpStr, len, 0, len);
268 safec_rc = memcpy_s(pTmpStr, len, param->buffer, param->bufLen);
276 printf(
"%s returned (%d)::%s",
"mfrSERIALIZED_TYPE_SOFTWAREVERSION",ret,pTmpStr);
279 IARM_Free(IARM_MEMTYPE_PROCESSLOCAL,param);
281 param->type = mfrSERIALIZED_TYPE_PROVISIONINGCODE;
286 if(ret != IARM_RESULT_SUCCESS)
288 printf(
"Call failed for %s: error code:%d\n",
"mfrSERIALIZED_TYPE_PROVISIONINGCODE",ret);
292 len = param->bufLen + 1;
293 pTmpStr = (
char *)malloc(len);
294 safec_rc = memset_s(pTmpStr, len, 0, len);
296 safec_rc = memcpy_s(pTmpStr, len, param->buffer, param->bufLen);
304 printf(
"%s returned (%d)::%s",
"mfrSERIALIZED_TYPE_PROVISIONINGCODE",ret,pTmpStr);
307 IARM_Free(IARM_MEMTYPE_PROCESSLOCAL,param);
309 param->type = mfrSERIALIZED_TYPE_FIRSTUSEDATE;
314 if(ret != IARM_RESULT_SUCCESS)
316 printf(
"Call failed for %s: error code:%d\n",
"mfrSERIALIZED_TYPE_FIRSTUSEDATE",ret);
320 len = param->bufLen + 1;
321 pTmpStr = (
char *)malloc(len);
322 safec_rc = memset_s(pTmpStr, len, 0, len);
324 safec_rc = memcpy_s(pTmpStr, len, param->buffer, param->bufLen);
332 printf(
"%s returned (%d)::%s",
"mfrSERIALIZED_TYPE_FIRSTUSEDATE",ret, pTmpStr);
335 IARM_Free(IARM_MEMTYPE_PROCESSLOCAL,param);
337 param->type = mfrSERIALIZED_TYPE_PDRIVERSION;
342 if(ret != IARM_RESULT_SUCCESS)
344 printf(
"Call failed for %s: error code:%d\n",
"mfrSERIALIZED_TYPE_PDRIVERSION",ret);
348 len = param->bufLen + 1;
349 pTmpStr = (
char *)malloc(len);
350 safec_rc = memset_s(pTmpStr, len, 0, len);
352 safec_rc = memcpy_s(pTmpStr, len, param->buffer, param->bufLen);
360 printf(
"%s returned (%d)::[%s]\r\n",
"mfrSERIALIZED_TYPE_PDRIVERSION",ret, pTmpStr);
363 IARM_Free(IARM_MEMTYPE_PROCESSLOCAL,param);
369 printf(
"Client Exiting\r\n");