- Added a a general data handling object
- Extended the callback interface to register scipts on callbacks - Fixed a stop bug in the anticollision object - Modified the HM code to do zero through a client connection
This commit is contained in:
@@ -1254,8 +1254,11 @@ extern int close(int fp);
|
||||
/* done */
|
||||
return 1;
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
int SINQHMZero(pSINQHM self, int iNumber, int iStart, int iEnd)
|
||||
/*------------------------------------------------------------------------
|
||||
This is the old version, using a master socjet, delete if the other version
|
||||
with client socket works alright.
|
||||
*/
|
||||
int SINQHMZero2(pSINQHM self, int iNumber, int iStart, int iEnd)
|
||||
{
|
||||
int status, iRet;
|
||||
struct req_buff_struct Req_buff;
|
||||
@@ -1303,6 +1306,55 @@ extern int close(int fp);
|
||||
}
|
||||
return 1; /* success, finally */
|
||||
}
|
||||
/*-----------------------------------------------------------------------*/
|
||||
int SINQHMZero(pSINQHM self, int iNumber, int iStart, int iEnd)
|
||||
{
|
||||
int status, iRet;
|
||||
struct req_buff_struct Req_buff;
|
||||
struct rply_buff_struct Rply_buff;
|
||||
|
||||
assert(self);
|
||||
|
||||
/* fill in the request data structure */
|
||||
Req_buff.bigend = htonl (0x12345678);
|
||||
Req_buff.cmnd = htonl (SQHM_ZERO);
|
||||
Req_buff.u.zero.hist_no = htonl (iNumber);
|
||||
Req_buff.u.zero.first_bin = htonl (iStart);
|
||||
Req_buff.u.zero.n_bins = htonl (iEnd);
|
||||
|
||||
/* send request */
|
||||
status = send(self->iClientSocket,(char *)&Req_buff, sizeof(Req_buff),0);
|
||||
if(status == -1)
|
||||
{
|
||||
return SEND_ERROR;
|
||||
}
|
||||
if(status != sizeof(Req_buff))
|
||||
{
|
||||
return SEND_ERROR;
|
||||
}
|
||||
|
||||
/* get a reply */
|
||||
iRet = recv(self->iClientSocket,(char *)&Rply_buff,sizeof(Rply_buff),
|
||||
MSG_WAITALL);
|
||||
if(iRet < 0)
|
||||
{
|
||||
return RECEIVE_ERROR;
|
||||
}
|
||||
if(iRet != sizeof(Rply_buff))
|
||||
{
|
||||
return INSUFFICIENT_DATA;
|
||||
}
|
||||
if(ntohl (Rply_buff.bigend) != 0x12345678)
|
||||
{
|
||||
return BYTE_ORDER_CHAOS;
|
||||
}
|
||||
iRet = ntohl(Rply_buff.status);
|
||||
if(iRet != KER__SUCCESS)
|
||||
{
|
||||
return HIST_BAD_CODE;
|
||||
}
|
||||
return 1; /* success, finally */
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
static int OpenMasterConnection(pSINQHM self)
|
||||
|
||||
Reference in New Issue
Block a user